/* Magnify CSS - Circular magnifying glass effect for XYZ grid images */

.magnify-container {
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    border-radius: 8px;
    transition: none;
}

.magnify-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Desktop magnifying glass effect */
@media (min-width: 769px) {
    .magnify-container {
        position: relative;
    }
}

/* Mobile overlay styles */
.magnify-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.magnify-overlay.active {
    display: block;
}

.magnify-overlay-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Vertical image positioning (enlarged at top) */
.magnify-overlay-content.vertical {
    align-items: flex-start;
    justify-content: center;
}

.magnify-overlay-content.vertical .magnify-overlay-image {
    width: 90vw;
    height: auto;
    min-height: 100vh;
    object-fit: contain;
    object-position: top center;
}

/* Horizontal image positioning (enlarged at left) */
.magnify-overlay-content.horizontal {
    align-items: flex-start;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
}

.magnify-overlay-content.horizontal .magnify-overlay-image {
    height: 90vh;
    width: auto;
    min-width: 200vw;
    max-width: none;
    object-fit: cover;
    object-position: left top;
    flex-shrink: 0;
}

.magnify-overlay-image {
    max-width: none;
    border-radius: 4px;
}

.magnify-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    color: #333;
}

.magnify-close:hover {
    background: rgba(255, 255, 255, 1);
}

/* Scrollbar styling for overlay */
.magnify-overlay::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.magnify-overlay::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.magnify-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.magnify-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Instruction text for mobile */
.magnify-instruction {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10001;
    opacity: 1;
    animation: fadeInOut 4s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .magnify-container {
        cursor: pointer;
    }
    
    .magnify-container::after {
        content: "📱 Tap to enlarge";
        position: absolute;
        bottom: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 12px;
        opacity: 0.8;
        pointer-events: none;
    }
}