/* Gallery Page Specific Styles - Performance Optimized */
/* Gallery Hero with Background Image */
.gallery-hero {
    height: 70vh;
    min-height: 500px;
    background: 
        linear-gradient(rgba(37, 99, 235, 0.7), rgba(59, 130, 246, 0.6)),
        url('../images/Stock/13.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 20px 60px;
    overflow-x: hidden;
    position: relative;
}

.gallery-hero .hero-content h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.gallery-hero .hero-content p {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-size: clamp(1rem, 2vw, 1.3rem);
    max-width: 600px;
    margin: 0 auto 30px;
}

.gallery-hero .hero-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-hero .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.gallery-hero .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.gallery-hero .btn-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.gallery-hero .btn-secondary:hover {
    background: white;
    color: var(--primary-blue);
}

/* Gallery Info Section */
.gallery-info {
    background: var(--bg-white);
    padding: 80px 0;
    overflow-x: hidden;
}

.info-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.info-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 25px;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.info-content h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    border-radius: 2px;
}

.info-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 40px;
    font-weight: 500;
}

.event-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 500px;
    margin: 0 auto;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary-blue);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.detail-item i {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.detail-item h4 {
    color: var(--text-dark);
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 1rem;
}

.detail-item p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Gallery Grid Section */
.gallery-grid-section {
    background: var(--bg-light);
    padding: 80px 0;
    overflow-x: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text-dark);
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-blue));
    border-radius: 2px;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    font-weight: 500;
}

/* Gallery Grid - Performance Optimized */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: var(--bg-white);
    transition: all 0.3s ease;
    aspect-ratio: 4/3;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.gallery-item:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    background: #f8fafc;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* Lazy loading styles */
.gallery-image.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image.loaded {
    opacity: 1;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 20px 20px;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.gallery-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

/* Load More Button */
.gallery-load-more {
    text-align: center;
}

.gallery-load-more .btn-secondary {
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: 600;
    transform: translateZ(0);
}

.gallery-load-more .btn-secondary:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: translateY(-2px) translateZ(0);
}

/* Other Galleries Section */
.other-galleries {
    background: var(--bg-white);
    padding: 80px 0;
    overflow-x: hidden;
}

.gallery-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.gallery-link-card {
    display: block;
    background: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout style paint;
}

.gallery-link-card:hover {
    transform: translateY(-8px) translateZ(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-blue);
}

.link-image {
    height: 200px;
    overflow: hidden;
}

.link-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    background: #f8fafc;
}

.gallery-link-card:hover .link-image img {
    transform: scale(1.08);
}

.link-content {
    padding: 25px;
}

.link-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--text-dark);
    font-weight: 600;
}

.link-content p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
}

/* No Images Message */
.no-images-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.no-images-message i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.no-images-message h3 {
    color: #64748b;
    margin-bottom: 10px;
}

.no-images-message p {
    color: #94a3b8;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Horizontal Scroll Prevention */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

.container {
    overflow-x: hidden;
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .event-details {
        grid-template-columns: repeat(3, 1fr);
        max-width: none;
    }

    .gallery-links-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .event-details {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
    }

    .gallery-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* Mobile Optimization */
@media (max-width: 767px) {
    .gallery-hero {
        height: 60vh;
        min-height: 400px;
        padding: 80px 20px 40px;
    }

    .info-content h2 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .detail-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .gallery-hero .hero-btns {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .gallery-hero .hero-btns .btn-primary,
    .gallery-hero .hero-btns .btn-secondary {
        width: 200px;
        text-align: center;
    }

    .gallery-load-more .btn-secondary {
        width: 100%;
        max-width: 300px;
    }

    /* Touch optimization */
    .gallery-item {
        transition: transform 0.2s ease;
    }

    .gallery-item:active {
        transform: scale(0.98);
    }
}

/* Performance optimizations for slow connections */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .gallery-link-card,
    .detail-item {
        transition: none;
    }
    
    .gallery-image {
        transition: none;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    transform: translateZ(0);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 5px;
    margin: 0 20px;
    transition: background 0.3s ease;
    transform: translateZ(0);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Print Styles */
@media print {
    .gallery-hero {
        background: none !important;
        color: black !important;
        height: auto;
    }
    
    .gallery-hero .hero-content h1,
    .gallery-hero .hero-content p {
        color: black !important;
        text-shadow: none !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .btn-primary,
    .btn-secondary {
        display: none !important;
    }
}