/* Premium Gallery Styles - Everest Public School */
:root {
    --gallery-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    --gallery-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --gallery-radius: 20px;
    --primary-blue: #1e40af;
    --primary-blue-light: rgba(30, 64, 175, 0.1);
}

.gallery-section {
    padding: 60px 0 100px;
    min-height: 80vh;
    position: relative;
    background: #fdfdfd;
}

/* Page Header refinement */
.page-header-gallery {
    padding: 100px 0;
    background: linear-gradient(rgba(30, 64, 175, 0.4), rgba(0, 51, 102, 0.4)), url('../images/index/slider2.jpg') center/cover no-repeat;
    text-align: center;
    color: white;
    margin-bottom: 0;
}

/* Category Filter Navigation */
.gallery-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #ffffff;
    border-radius: 60px;
    position: sticky;
    top: 90px;
    z-index: 900;
    max-width: fit-content;
    margin: -40px auto 60px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    /* Hide scrollbars */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (min-width: 769px) {
    .gallery-nav {
        justify-content: center;
    }
}

.gallery-nav::-webkit-scrollbar {
    display: none;
}

.gallery-tab {
    padding: 10px 24px;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: #555;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.gallery-tab:hover {
    color: var(--primary-blue);
}

.gallery-tab.active {
    background: var(--primary-blue);
    color: white;
}

/* Interactive Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
    position: relative;
}

.gallery-item {
    position: relative;
    border-radius: var(--gallery-radius);
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: var(--gallery-shadow);
    transform: translateZ(0);
    border: 3px solid var(--primary-blue);
}

.gallery-img-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.gallery-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Hover States */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--gallery-shadow-hover);
    border-color: var(--primary-blue);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Smooth Category Transitions */
.gallery-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Night Mode Overrides */
body.night-mode .gallery-section {
    background: #020617;
}

body.night-mode .gallery-nav {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

body.night-mode .gallery-tab {
    color: #94a3b8;
}

body.night-mode .gallery-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

body.night-mode .gallery-item {
    background: #1e293b;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Lightbox Premium Design */
.lightbox {
    background-color: rgba(2, 6, 23, 0.98) !important;
}

.lightbox-content {
    max-width: 1200px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.8);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-content.slide-in {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.lightbox-content.slide-next {
    opacity: 0;
    transform: translateX(60px) scale(0.95);
}

.lightbox-content.slide-prev {
    opacity: 0;
    transform: translateX(-60px) scale(0.95);
}

.lightbox-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.1) rotate(90deg);
}

/* Lightbox Navigation */
.lightbox-nav {
    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;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 3005;
}

.lightbox-nav:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Standard Animations Integration (AOS) */
[data-aos] {
    transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}

/* Responsive Grid Adjustments */
@media (max-width: 1100px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-nav {
        margin-top: 20px;
        top: 80px;
        padding: 8px 12px;
        gap: 8px;
        max-width: 95%;
        border-radius: 40px;
    }

    .gallery-tab {
        padding: 8px 18px;
        font-size: 0.9rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .gallery-item:hover {
        transform: translateY(-8px);
    }
}
