/* Gallery Section */
.gallery-section {
    background-color: var(--bg-color);
    padding: 80px 0;
}

[data-theme="dark"] .gallery-section {
    background-color: var(--card-bg);
}

.gallery-intro {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 50px;
    color: var(--text-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-category {
    margin-bottom: 60px;
}

.gallery-category-title {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.gallery-category-title i {
    margin-right: 15px;
    color: var(--secondary-color);
    font-size: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--card-bg);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.gallery-item-description {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
}

.gallery-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
    z-index: 10001;
    transition: var(--transition);
}

.gallery-modal-close:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.gallery-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border-radius: 5px;
}

.gallery-modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.gallery-modal-prev {
    left: 20px;
}

.gallery-modal-next {
    right: 20px;
}

.gallery-modal-image-container {
    position: relative;
    max-width: 85vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
}

.gallery-modal-image.loaded {
    display: block;
}

.gallery-modal-loading {
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
}

.gallery-modal-info {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.gallery-modal-info h3 {
    margin-bottom: 10px;
    color: white;
}

.gallery-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .gallery-item img {
        height: 200px;
    }

    .gallery-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .gallery-modal-image-container {
        max-width: 90vw;
        max-height: 70vh;
    }

    .gallery-modal-nav {
        font-size: 1.2rem;
        padding: 12px 15px;
    }

    .gallery-modal-prev {
        left: 10px;
    }

    .gallery-modal-next {
        right: 10px;
    }

    .gallery-modal-close {
        top: -35px;
        right: 10px;
    }

    .gallery-category-title {
        font-size: 1.5rem;
    }

    .gallery-category-title i {
        font-size: 1.5rem;
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }

    .gallery-item img {
        height: 180px;
    }

    .gallery-modal-image-container {
        max-width: 95vw;
        max-height: 60vh;
    }

    .gallery-modal-info {
        padding: 15px;
    }

    .gallery-intro {
        font-size: 1rem;
        margin-bottom: 40px;
    }
}
