/* =============================================
   IMAGE LIGHTBOX SYSTEM
   Professional fullscreen image viewer
   ============================================= */

/* Lightbox Overlay - Abdunklung des Hintergrunds */
.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Active State */
.image-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Container - 55% Größe */
.image-lightbox-container {
    position: relative;
    max-width: 55vw;
    max-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.image-lightbox-overlay.active .image-lightbox-container {
    transform: scale(1);
}

/* Lightbox Image - 55% Größe */
.image-lightbox-image {
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.8),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Close Button */
.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.image-lightbox-close:hover {
    background: var(--primary-color, #ff4d4d);
    border-color: var(--primary-color, #ff4d4d);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 77, 77, 0.4);
}

.image-lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.image-lightbox-close:hover svg {
    transform: scale(1.1);
}

/* Loading Spinner */
.image-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color, #ff4d4d);
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.image-lightbox-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes lightbox-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Image Caption */
.image-lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease 0.2s;
}

.image-lightbox-overlay.active .image-lightbox-caption {
    opacity: 1;
}

/* Album Cover - Kein Cursor Change */
.album-cover {
    position: relative;
}

/* Zoom Icon - erscheint NUR bei Hover über dem BILD selbst */
.album-cover .lightbox-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    pointer-events: none;
}

/* Hover auf ALBUM-COVER (dem Bild) → Lupe erscheint */
.album-cover:hover .lightbox-zoom-icon {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Hover auf Lupen-Icon selbst - eleganter Effekt */
.album-cover .lightbox-zoom-icon:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.album-cover .lightbox-zoom-icon:active {
    transform: translate(-50%, -50%) scale(1.0);
}

.album-cover .lightbox-zoom-icon svg {
    width: 28px;
    height: 28px;
    stroke: #333;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
}

.album-cover .lightbox-zoom-icon:hover svg {
    stroke: #000;
}

/* Verhindern von Text-Selektion während Lightbox aktiv ist */
.image-lightbox-overlay.active {
    user-select: none;
}

/* =============================================
   SPOTLIGHT SECTION - LIGHTBOX DEAKTIVIERT
   ============================================= */

/* Lupe in Spotlight-Section komplett verstecken */
.spotlight-card .album-cover .lightbox-zoom-icon,
.spotlight-cards .album-cover .lightbox-zoom-icon,
.spotlight-double-feature .album-cover .lightbox-zoom-icon {
    display: none !important;
}

/* Kein Hover-Effekt in Spotlight-Section */
.spotlight-card .album-cover:hover .lightbox-zoom-icon,
.spotlight-cards .album-cover:hover .lightbox-zoom-icon,
.spotlight-double-feature .album-cover:hover .lightbox-zoom-icon {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */

/* Tablets und kleinere Desktops - 62% Größe */
@media (max-width: 1024px) {
    .image-lightbox-container {
        max-width: 62vw;
        max-height: 62vh;
    }
    
    .image-lightbox-image {
        max-height: 62vh;
    }
}

/* Tablets - 68% Größe */
@media (max-width: 768px) {
    .image-lightbox-container {
        max-width: 68vw;
        max-height: 68vh;
    }
    
    .image-lightbox-image {
        max-height: 68vh;
    }
    
    .image-lightbox-close {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
    
    .image-lightbox-close svg {
        width: 22px;
        height: 22px;
    }
    
    .image-lightbox-caption {
        bottom: 20px;
        padding: 10px 20px;
        font-size: 0.9rem;
        max-width: 90%;
    }
    
    .album-cover .lightbox-zoom-icon {
        width: 55px;
        height: 55px;
    }
    
    .album-cover .lightbox-zoom-icon svg {
        width: 26px;
        height: 26px;
    }
}

/* SMARTPHONES - KOMPLETTE LIGHTBOX-FUNKTION DEAKTIVIERT */
@media (max-width: 600px) {
    /* Lightbox komplett verstecken auf Smartphones */
    .image-lightbox-overlay {
        display: none !important;
    }
    
    /* Lupe verstecken auf Smartphones */
    .album-cover .lightbox-zoom-icon {
        display: none !important;
    }
    
    /* Kein Hover-Effekt auf Smartphones */
    .album-cover:hover .lightbox-zoom-icon {
        display: none !important;
    }
}

/* Touch-Optimierung für Tablets (aber NICHT für Smartphones) */
@media (hover: none) and (pointer: coarse) and (min-width: 601px) {
    /* Auf Touch-Geräten (Tablets): Icon erscheint wenn Album die Klasse 'touched' hat */
    .album.touched .lightbox-zoom-icon {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
        width: 50px;
        height: 50px;
    }
    
    .album.touched .lightbox-zoom-icon svg {
        width: 24px;
        height: 24px;
    }
    
    /* ABER NICHT in Spotlight-Section */
    .spotlight-card .album.touched .lightbox-zoom-icon,
    .spotlight-cards .album.touched .lightbox-zoom-icon,
    .spotlight-double-feature .album.touched .lightbox-zoom-icon {
        display: none !important;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .image-lightbox-overlay,
    .image-lightbox-container,
    .image-lightbox-close,
    .album-cover .lightbox-zoom-icon {
        transition: none;
    }
    
    .image-lightbox-loading {
        animation: none;
    }
}