/* ===================================
   ORACNOOS - Image Gallery & Lightbox
   Modern image viewer with navigation
   =================================== */

/* ===================================
   IMAGE WRAPPER (Zoom Hint)
   =================================== */

.image-wrapper {
    position: relative;
    display: inline-block;
    margin: var(--spacing-lg) 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.image-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-xl);
    transition: transform var(--transition-base);
}

.image-wrapper:hover img {
    transform: scale(1.02);
}

.zoom-hint {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-lg);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.image-wrapper:hover .zoom-hint {
    opacity: 1;
}

/* ===================================
   IMAGE GALLERY GRID
   =================================== */

.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.image-gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-bounce);
    border: 2px solid rgba(0, 229, 255, 0.1);
}

.image-gallery-grid img:hover {
    transform: scale(1.05);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: var(--shadow-glow-hover);
}

/* ===================================
   LIGHTBOX OVERLAY
   =================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
}

/* ===================================
   LIGHTBOX CONTROLS
   =================================== */

.lightbox-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: all var(--transition-bounce);
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 64, 129, 0.8);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.5);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    transition: all var(--transition-bounce);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: var(--spacing-xl);
}

.lightbox-next {
    right: var(--spacing-xl);
}

.lightbox-nav:hover {
    background: rgba(0, 229, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
}

.lightbox-prev:hover {
    transform: translateY(-50%) translateX(-5px) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) translateX(5px) scale(1.1);
}

/* ===================================
   LIGHTBOX CONTENT
   =================================== */

.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    max-width: 600px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-base);
    line-height: 1.6;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
}

.lightbox-counter {
    position: absolute;
    top: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    color: white;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

/* ===================================
   LIGHTBOX THUMBNAILS
   =================================== */

.lightbox-thumbnails {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    max-width: 80vw;
    overflow-x: auto;
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
}

.thumbnails-track {
    display: flex;
    gap: var(--spacing-sm);
}

.thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-base);
    opacity: 0.6;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-item:hover {
    opacity: 1;
    border-color: rgba(0, 229, 255, 0.5);
}

.thumbnail-item.active {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* ===================================
   IMAGE CAROUSEL (Alternative Layout)
   =================================== */

.image-carousel {
    position: relative;
    margin: var(--spacing-xl) 0;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform var(--transition-base);
}

.carousel-slide {
    flex-shrink: 0;
    width: 100%;
    height: 400px;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-dots {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-sm);
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--transition-base);
}

.carousel-dot.active {
    background: var(--primary-color);
    width: 30px;
    border-radius: var(--radius-full);
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .lightbox-container {
        padding: var(--spacing-md);
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 85vh;
    }
    
    .lightbox-image {
        max-height: 60vh;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
    }
    
    .lightbox-prev {
        left: var(--spacing-sm);
    }
    
    .lightbox-next {
        right: var(--spacing-sm);
    }
    
    .lightbox-close {
        top: var(--spacing-sm);
        right: var(--spacing-sm);
        width: 45px;
        height: 45px;
    }
    
    .lightbox-thumbnails {
        max-width: 90vw;
        padding: var(--spacing-sm);
    }
    
    .thumbnail-item {
        width: 60px;
        height: 45px;
    }
    
    .image-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }
    
    .lightbox-caption {
        font-size: var(--font-size-sm);
        padding: var(--spacing-sm);
    }
    
    .image-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   TOUCH GESTURES (Mobile)
   =================================== */

@media (hover: none) and (pointer: coarse) {
    .lightbox-content {
        touch-action: pan-x;
    }
    
    /* Swipe hint */
    .lightbox-overlay.active::after {
        content: '← Swipe →';
        position: absolute;
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
        color: rgba(255, 255, 255, 0.5);
        font-size: var(--font-size-sm);
        animation: fadeOut 3s ease-out forwards;
    }
    
    @keyframes fadeOut {
        0% {
            opacity: 1;
        }
        70% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }
}

/* ===================================
   PRINT
   =================================== */

@media print {
    .lightbox-overlay,
    .zoom-hint,
    .image-gallery-grid {
        display: none !important;
    }
    
    .image-wrapper img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.lightbox-close:focus,
.lightbox-nav:focus,
.thumbnail-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===================================
   LOADING STATE
   =================================== */

.lightbox-image {
    background: linear-gradient(
        90deg,
        rgba(0, 229, 255, 0.1) 0%,
        rgba(255, 64, 129, 0.1) 50%,
        rgba(0, 229, 255, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.lightbox-image[src]:not([src=""]) {
    background: none;
    animation: none;
}

