/* Event Lightbox Overlay Styles */
.event-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(10,10,15,0.96) 0%, rgba(5,5,10,0.99) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.event-lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(80px) brightness(0.35);
    -webkit-filter: blur(80px) brightness(0.35);
    transition: background-image 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
    transform: scale(1.2);
}

.lightbox-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 3D FAN Layout (3 left, 3 right, 1 center) - Fill Space */
.sliding-3d-wrap {
    position: relative;
    height: 550px; 
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 3000px;
    overflow: visible;
}

.sliding-card {
    position: absolute;
    width: 700px; /* Rectangular Width */
    height: 480px; 
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(0,0,0,0.9);
    transition: all 0.85s cubic-bezier(0.19, 1, 0.22, 1);
    will-change: transform, opacity;
    border: 1px solid rgba(255,255,255,0.1);
}

.sliding-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5);
    transition: all 0.85s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Classes to strictly show 3 on each side - Wider spread and higher visibility */
.s-card-0, .s-card-1, .s-card-2, .s-card-3 { 
    transform: translateX(-1200px) translateZ(-1400px) rotateY(70deg); 
    opacity: 0; 
    visibility: hidden; 
}

/* Left Side (Visible 3) */
.s-card-4 { transform: translateX(-700px) translateZ(-800px) rotateY(50deg); z-index: 4; opacity: 0.5; visibility: visible; } /* 3rd out */
.s-card-5 { transform: translateX(-450px) translateZ(-500px) rotateY(40deg); z-index: 5; opacity: 0.75; visibility: visible; } /* 2nd out */
.s-card-6 { transform: translateX(-200px) translateZ(-250px) rotateY(20deg); z-index: 6; opacity: 0.9; visibility: visible; } /* 1st out */

/* Center Focal Point */
.s-card-7 { transform: translateX(0) translateZ(300px) rotateY(0deg); z-index: 20; opacity: 1; visibility: visible; }

/* Right Side (Visible 3) */
.s-card-8 { transform: translateX(200px) translateZ(-250px) rotateY(-20deg); z-index: 6; opacity: 0.9; visibility: visible; } /* 1st out */
.s-card-9 { transform: translateX(450px) translateZ(-500px) rotateY(-40deg); z-index: 5; opacity: 0.75; visibility: visible; } /* 2nd out */
.s-card-10 { transform: translateX(700px) translateZ(-800px) rotateY(-50deg); z-index: 4; opacity: 0.5; visibility: visible; } /* 3rd out */

/* Hidden slots */
.s-card-11, .s-card-12, .s-card-13, .s-card-14 { 
    transform: translateX(1200px) translateZ(-1400px) rotateY(-70deg); 
    opacity: 0; 
    visibility: hidden; 
}

/* Active Highlight */
.s-card-7 img { filter: brightness(1.1); }
.s-card-7 { border-color: rgba(255,255,255,0.25); box-shadow: 0 50px 150px rgba(0,0,0,1); }

/* Caption */
.lightbox-caption {
    position: relative;
    margin-top: -10px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    color: #fff;
    z-index: 30;
    pointer-events: none;
}

.lightbox-caption h4 {
    font-size: 26px;
    font-weight: 600;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
    opacity: 0.95;
    margin: 0;
}

/* Controls - Centered at the correct vertical height */
.lightbox-controls {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 30px;
    z-index: 150;
    margin-top: 10px;
}

.lightbox-prev-btn, .lightbox-next-btn {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
}

.lightbox-prev-btn:hover, .lightbox-next-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-prev-btn i, .lightbox-next-btn i { font-size: 22px; }

/* Close */
.lightbox-close-btn {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 65px;
    height: 65px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 160;
    transition: all 0.4s ease;
}

.lightbox-close-btn:hover { transform: rotate(90deg) scale(1.1); background: rgba(255, 255, 255, 0.15); }

@media (max-width: 1400px) {
    .sliding-card { width: 550px; height: 380px; }
    .s-card-4 { transform: translateX(-550px) translateZ(-600px) rotateY(50deg); }
    .s-card-10 { transform: translateX(550px) translateZ(-600px) rotateY(-50deg); }
}

@media (max-width: 992px) {
    .event-lightbox-overlay { backdrop-filter: blur(20px); }
    
    .sliding-3d-wrap { 
      height: auto !important;
      min-height: 300px !important;
      perspective: none !important; 
      margin-top: 0;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      overflow: hidden !important; /* Contain the sliding cards */
    }
    
    .sliding-card { 
      width: 95% !important; 
      max-width: 500px !important;
      height: auto !important;
      aspect-ratio: 16 / 10 !important;
      border-radius: 8px !important;
      position: absolute !important; /* Stack together for horizontal slide */
      transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) !important;
      border: none !important;
      box-shadow: 0 15px 45px rgba(0,0,0,0.6) !important;
    }

    /* ---- HORIZONTAL SLIDE ANIMATION ---- */
    
    /* Left Side (Off-screen) */
    .s-card-0, .s-card-1, .s-card-2, .s-card-3, .s-card-4, .s-card-5, .s-card-6 { 
        transform: translateX(-120%) !important; 
        opacity: 0 !important;
        visibility: hidden !important;
    } 
    
    /* Active Center - Matches Reference Design */
    .s-card-7 { 
        transform: translateX(0) !important; 
        opacity: 1 !important; 
        visibility: visible !important; 
        z-index: 20 !important;
    }

    /* Right Side (Off-screen) */
    .s-card-8, .s-card-9, .s-card-10, .s-card-11, .s-card-12, .s-card-13, .s-card-14 { 
        transform: translateX(120%) !important; 
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .sliding-card img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; 
        filter: brightness(1) !important;
    }
    .lightbox-caption { 
        margin-top: 40px !important; 
        margin-bottom: 40px !important; 
        width: 100% !important;
        display: block !important;
        position: relative !important;
        padding: 0 30px !important; /* Side padding to prevent edge touches */
        box-sizing: border-box !important;
    }
    .lightbox-caption h4 { 
        font-size: 18px !important; 
        font-weight: 500 !important; 
        letter-spacing: 0.5px !important; 
        line-height: 1.4 !important; /* Better vertical spacing for wrapped text */
    }
    
    .lightbox-controls { gap: 40px !important; display: flex !important; justify-content: center !important; position: relative !important; margin-top: 0 !important; }
    .lightbox-prev-btn, .lightbox-next-btn {
      width: 85px;
      height: 85px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .lightbox-prev-btn i, .lightbox-next-btn i { font-size: 28px; font-weight: 300; }
    
    .lightbox-close-btn {
      top: 30px;
      right: 30px;
      width: 60px;
      height: 60px;
      font-size: 36px;
      font-weight: 200;
      background: rgba(255, 255, 255, 0.1);
      border: none;
    }
}

@media (max-width: 480px) {
    .sliding-3d-wrap { height: 280px; }
    .lightbox-caption { margin-top: 30px; margin-bottom: 40px; }
    .lightbox-prev-btn, .lightbox-next-btn { width: 75px; height: 75px; }
    .lightbox-close-btn { top: 20px; right: 20px; width: 50px; height: 50px; }
}
