/* ==================================================
   CSS VARIABLES (Fallback just in case they aren't in index.css)
   ================================================== */
:root {
    --glass-border: rgba(255, 255, 255, 0.1);
    --ios-blue: #0A84FF;
    --text-main: #ffffff;
    --bg-dark: #121212;
}

.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--smooth-ease), transform 0.8s var(--smooth-ease);
    will-change: opacity, transform;
}

/* ==================================================
   GALLERY PAGE SPECIFIC STYLES 
   ================================================== */
.gallery-hero {
    min-height: 40vh;
    padding-top: 180px;
    padding-bottom: 80px;
}

.gallery-section-1, .gallery-section {
    width: 95%; 
    max-width: 95%;
    position: relative;
    z-index: 50;
    border-radius: 50px;
    overflow: hidden; 
}

.gallery-section-1 {
    margin-top: -60px;
    margin-bottom: 60px;
    padding: 60px 0; 
}

.gallery-section {
    margin-bottom: 60px; 
    padding: 60px 0; 
}

/* --- GALLERY FILTERS --- */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05); 
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover { background: rgba(255, 255, 255, 0.15); }
.filter-btn.active {
    background: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
}

/* --- NEW CONTROL BUTTONS & NATIVE SCROLL STYLES --- */
.gallery-header-row {
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end;
    margin-bottom: 30px; 
    flex-wrap: wrap; 
    gap: 15px;
    padding: 0 40px; /* Added padding so headers don't touch the very edge */
}

.section-title h2 {
    text-align: center;
    width: 100%;
    margin: 0;
}

.gallery-controls {
    display: flex; gap: 10px; align-items: center;
}

.icon-btn {
    background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
    color: white; border-radius: 50%; width: 45px; height: 45px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; transition: 0.3s;
}
.icon-btn:hover { background: rgba(255,255,255,0.2); }

.toggle-btn {
    background: rgba(10, 132, 255, 0.2); border: 1px solid var(--ios-blue);
    color: white; border-radius: 30px; padding: 0 20px; height: 45px;
    font-weight: 600; cursor: pointer; transition: 0.3s;
}
.toggle-btn:hover { background: var(--ios-blue); }
.toggle-btn.paused { background: rgba(255, 69, 58, 0.2); border-color: #FF453A; }
.toggle-btn.paused:hover { background: #FF453A; }

/* --- INFINITE AUTO-SCROLLING MARQUEE --- */
.scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
    padding: 20px 0;
    scroll-behavior: auto;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}
.scroll-wrapper::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.scroll-track {
    display: flex;
    gap: 30px;
    width: max-content;
    animation: none !important; /* Disabled old CSS animation so JS handles it cleanly */
}

/* 2. Style the wrapper to handle centering while loading */
.scroll-wrapper.is-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px; 
}

/* 3. Hide the track while it's loading so the text stays centered */
.scroll-wrapper.is-loading .scroll-track {
    display: none;
}

/* 4. Formatting for the loading text itself */
.loading-text {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.1rem;
    opacity: 0.8;
}

/* --- INDIVIDUAL GALLERY CARDS --- */
.gallery-item {
    flex: 0 0 350px; 
    padding: 15px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    cursor: zoom-in; 
    transition: transform 0.3s ease, border-color 0.3s ease;
    transform: translateZ(0); 
}

.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5); 
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05); 
}

.gallery-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.gallery-caption {
    margin-top: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

/* --- LIGHTBOX (FULL SCREEN IMAGE VIEWER) --- */
.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1; pointer-events: all;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active img { transform: scale(1); }

.close-lightbox {
    position: absolute;
    top: 30px; right: 40px;
    background: none; border: none;
    font-size: 3rem; color: white;
    cursor: pointer; opacity: 0.7; transition: 0.3s;
}

.close-lightbox:hover { opacity: 1; transform: scale(1.1); }

.lightbox-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
    color: white; width: 60px; height: 60px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer; transition: 0.3s;
    display: flex; justify-content: center; align-items: center; z-index: 10001;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.3); scale: 1.1; }
.lightbox-arrow.left { left: 30px; }
.lightbox-arrow.right { right: 30px; }

.lightbox-section-title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    letter-spacing: 1px;
}

.lightbox-caption-text {
    position: absolute; bottom: 40px; color: white; font-size: 1.5rem;
    font-weight: 600; text-shadow: 0 2px 10px rgba(0,0,0,0.8);  
}

/* --- TEXT MARQUEE SCROLLER --- */
.text-marquee-item {
    flex: 0 0 auto; /* Sizes the box perfectly to the text */
    padding: 15px 40px;
    border-radius: 50px; /* Pill shape */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px auto 20px;
    
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1px;
    white-space: nowrap; /* Stops text from wrapping to a second line */
    
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: 0.3s ease;
    cursor: default; /* No pointer finger since it's just text */
}

.text-marquee-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .text-marquee-item {
        font-size: 1.2rem;
        padding: 12px 30px;
    }
}

/* --- RESPONSIVE QUERIES --- */
@media (max-width: 768px) {
    .gallery-hero { min-height: auto; padding-top: 140px; padding-bottom: 80px; margin-top: 60px;}
    .gallery-section, .gallery-section-1 { padding: 40px 0; border-radius: 30px; margin: 30px auto;}
    .gallery-item { flex: 0 0 280px; }
    .gallery-item img { height: 180px; }
    
    .lightbox-arrow { width: 45px; height: 45px; font-size: 1.2rem; }
    .lightbox-arrow.left { left: 10px; }
    .lightbox-arrow.right { right: 10px; }
    .close-lightbox { top: 15px; right: 20px; font-size: 2.5rem; }
    
    .gallery-header-row { flex-direction: column; align-items: center; text-align: center; }
}