/**
 * Global Gallery Component Styles
 */

html {
    scroll-behavior: smooth;
}

.gallery-section {
    padding: 80px 0;
    background: white;
}

.gallery-section .section-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2.5rem;
    color: var(--text-dark);
}

.gallery-section .section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 50px;
    font-size: 1.1rem;
}

/* Gallery Grid - Default 9 columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 10px;
    margin-bottom: 40px;
}

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

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

.gallery-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-grid-6 {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.gallery-grid-9 {
    grid-template-columns: repeat(9, 1fr);
    gap: 10px;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
    transition: transform 0.3s ease;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 50%, rgba(254, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Extended Gallery */
.extended-gallery {
    display: none;
    animation: fadeIn 0.5s ease;
}

.extended-gallery.show {
    display: block;
}

/* Extended Gallery Items - Hidden by default, shown progressively */
.extended-gallery .gallery-item {
    display: none;
}

/* Browse More Button */
.gallery-more {
    text-align: center;
    margin-top: 40px;
}

#browseMore {
    padding: 15px 40px;
    background: white;
    color: var(--accent-red);
    border: 2px solid var(--accent-red);
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#browseMore:hover {
    background: var(--accent-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(254, 0, 0, 0.3);
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s ease;
}

.modal-caption {
    text-align: center;
    color: white;
    padding: 15px;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 5px;
    font-size: 1rem;
    min-width: 200px;
}

/* Modal Controls */
.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-red);
    background: rgba(0, 0, 0, 0.8);
}

.prev-image,
.next-image {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: all 0.3s ease;
    user-select: none;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.prev-image:hover,
.next-image:hover {
    background-color: var(--accent-red);
    transform: translateY(-50%) scale(1.1);
}

.prev-image {
    left: 30px;
}

.next-image {
    right: 30px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .gallery-grid,
    .gallery-grid-9 {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1200px) {
    .gallery-grid-6 {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-grid-5 {
        grid-template-columns: repeat(4, 1fr);
    }

    .gallery-grid,
    .gallery-grid-9 {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .gallery-grid,
    .gallery-grid-4,
    .gallery-grid-5,
    .gallery-grid-6,
    .gallery-grid-9 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 60px 20px;
    }

    .gallery-section .section-title {
        font-size: 2rem;
    }

    .gallery-grid,
    .gallery-grid-3,
    .gallery-grid-4,
    .gallery-grid-5,
    .gallery-grid-6,
    .gallery-grid-9 {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }
    
    .close-modal {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .prev-image,
    .next-image {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .prev-image {
        left: 10px;
    }
    
    .next-image {
        right: 10px;
    }
    
    .modal-caption {
        font-size: 0.9rem;
        padding: 10px;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-section .section-title {
        font-size: 1.8rem;
    }

    .gallery-section .section-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .gallery-grid,
    .gallery-grid-2,
    .gallery-grid-3,
    .gallery-grid-4,
    .gallery-grid-5,
    .gallery-grid-6,
    .gallery-grid-9 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #browseMore {
        padding: 12px 30px;
        font-size: 0.95rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Animation Delays for Gallery Items */
.animation-delay-50 {
    animation-delay: 50ms;
}

.animation-delay-100 {
    animation-delay: 100ms;
}

.animation-delay-150 {
    animation-delay: 150ms;
}

.animation-delay-200 {
    animation-delay: 200ms;
}

.animation-delay-250 {
    animation-delay: 250ms;
}

.animation-delay-300 {
    animation-delay: 300ms;
}

.animation-delay-350 {
    animation-delay: 350ms;
}

.animation-delay-400 {
    animation-delay: 400ms;
}

.animation-delay-450 {
    animation-delay: 450ms;
}

.animation-delay-500 {
    animation-delay: 500ms;
}

.animation-delay-550 {
    animation-delay: 550ms;
}

.animation-delay-600 {
    animation-delay: 600ms;
}