/**
 * Bibercare CMS - Lightbox Modal Styles
 * Datei: public/assets/css/modules/lightbox.css
 * 
 * Funktionen:
 * - Vollbild Image Lightbox mit hellem, verschwommenem Hintergrund
 * - Smooth Animationen (Zoom-In)
 * - Close-Button mit Hover-Effekten
 * - Responsive für alle Bildschirmgrößen
 * - ESC und Klick-außerhalb zum Schließen
 * 
 * JS: public/assets/js/lightbox.js
 * 
 * Laden via page-config.json:
 *   "css": ["assets/css/modules/lightbox.css"]
 *   "js": ["assets/js/lightbox.js"]
 */

/* =================================
   LIGHTBOX MODAL CONTAINER
   Hintergrund: hell, verschwommen, durchsichtig
   ================================= */

.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}

/* =================================
   SICHTBARKEIT
   Nur .active Klasse steuert display
   aria-hidden ist nur für Screenreader
   ================================= */

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

/* =================================
   LIGHTBOX CONTENT
   ================================= */

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: lightboxZoomIn 0.3s ease;
    cursor: default;
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =================================
   LIGHTBOX IMAGE
   ================================= */

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    object-fit: contain;
}

/* =================================
   CLOSE BUTTON
   ================================= */

.lightbox-close {
    position: absolute;
    top: -55px;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 4px 16px rgba(44, 90, 160, 0.35);
}

.lightbox-close:hover {
    background-color: #1e4278;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.5);
}

.lightbox-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* =================================
   LIGHTBOX CAPTION
   ================================= */

.lightbox-caption {
    margin-top: 1.5rem;
    color: var(--text-dark, #2d3748);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    max-width: 80%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

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

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .lightbox-image {
        max-height: 80vh;
        border-radius: 8px;
    }

    .lightbox-caption {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .lightbox-close {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        top: 5px;
        right: 5px;
    }

    .lightbox-image {
        max-height: 75vh;
    }

    .lightbox-caption {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
        max-width: 90%;
    }
}

/* =================================
   ACCESSIBILITY
   ================================= */

.lightbox-close:focus {
    outline: 2px solid var(--primary-color, #2c5aa0);
    outline-offset: 3px;
}

/* Keyboard Navigation Hint */
.lightbox-modal.active::before {
    content: "ESC zum Schließen";
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(44, 90, 160, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
    pointer-events: none;
}

@media (max-width: 768px) {
    .lightbox-modal.active::before {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        bottom: 10px;
    }
}

/* =================================
   LOADING STATE (Optional)
   ================================= */

.lightbox-image.loading {
    opacity: 0.5;
}

.lightbox-modal.loading::after {
    content: "";
    position: absolute;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(44, 90, 160, 0.3);
    border-top-color: var(--primary-color, #2c5aa0);
    border-radius: 50%;
    animation: lightboxSpin 0.8s linear infinite;
}

@keyframes lightboxSpin {
    to {
        transform: rotate(360deg);
    }
}