/* Gallery Section Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 10px 0;
}

.gallery-card {
    position: relative;
    border-radius: 18px;
    background-color: #f1f5f9;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transform: translateY(30px);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    
    /* Skeleton Loader Background */
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-card.loaded {
    animation: none;
    background: #0f172a;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.gallery-card.loaded:hover {
    box-shadow: 0 15px 35px rgba(15, 82, 186, 0.18);
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card.loaded .gallery-thumb {
    opacity: 1;
}

.gallery-card.loaded:hover .gallery-thumb {
    transform: scale(1.08);
}

/* Glassmorphic Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 82, 186, 0.15) 100%);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    z-index: 2;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gallery-category {
    font-family: 'Poppins', sans-serif;
    color: #93c5fd;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 5px;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    transform: translateY(10px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card:hover .gallery-category,
.gallery-card:hover .gallery-title {
    transform: translateY(0);
}

/* Lightbox Modal Styles */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow: hidden;
}

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

.lightbox-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1;
}

.lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3;
    color: #ffffff;
}

.lightbox-counter {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #94a3b8;
}

.lightbox-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lightbox-control-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    outline: none;
}

.lightbox-control-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.lightbox-control-btn svg {
    transition: transform 0.3s ease;
}

.lightbox-control-btn.paused svg {
    transform: scale(0.9);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lightbox-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(15, 82, 186, 0.4);
}

.lightbox-prev { left: 40px; }
.lightbox-next { right: 40px; }

.lightbox-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-modal.show .lightbox-content-wrapper {
    transform: scale(1);
}

.lightbox-img-container {
    position: relative;
    max-width: 100%;
    max-height: 65vh;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    background-color: #000;
}

.lightbox-img-container img {
    max-width: 100%;
    max-height: 65vh;
    display: block;
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.1s ease;
    cursor: zoom-in;
}

.lightbox-img-container img.zoomed {
    cursor: zoom-out;
}

.lightbox-caption-container {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    color: #ffffff;
}

.lightbox-caption-category {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #38bdf8;
    letter-spacing: 2px;
    margin-bottom: 6px;
    display: block;
}

.lightbox-caption-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.lightbox-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: var(--primary);
    width: 0%;
    z-index: 4;
}

/* Responsiveness */
@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .lightbox-arrow {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }
    .lightbox-prev { left: 20px; }
    .lightbox-next { right: 20px; }
    .lightbox-caption-title {
        font-size: 18px;
    }
}

@media (max-width: 575px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .lightbox-arrow {
        display: none; /* Hide arrows on small mobile, use swipe */
    }
    .lightbox-header {
        padding: 15px 20px;
    }
    .lightbox-content-wrapper {
        max-width: 92%;
    }
    .lightbox-img-container {
        max-height: 55vh;
    }
    .lightbox-img-container img {
        max-height: 55vh;
    }
    .lightbox-caption-title {
        font-size: 16px;
    }
}