/* Professional Gallery Styles */

.gallery-section {
    background: var(--background-cream);
    border-radius: 25px;
    box-shadow: 0 15px 40px var(--shadow-soft);
    margin: 3rem 0;
    overflow: hidden;
    padding: 3rem;
    border: 1px solid var(--primary-light);
    position: relative;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--accent-gold) 0%, var(--accent-copper) 50%, var(--river-blue) 100%);
}

.gallery-section h2 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
    font-family: 'Playfair Display', serif;
}

.gallery-section h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-copper));
    border-radius: 2px;
}

.gallery-section p {
    text-align: center;
    color: var(--text-medium);
    margin-bottom: 2rem;
    font-style: italic;
}

/* Gallery Grid */
.gallery-grid-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.4s ease;
    background: var(--background-warm);
    box-shadow: 0 8px 25px var(--shadow-soft);
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px var(--shadow-medium);
}

.gallery-item-inner {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: 15px;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 69, 19, 0.8), rgba(218, 165, 32, 0.8));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

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

.gallery-overlay-content {
    text-align: center;
    color: var(--background-cream);
}

.gallery-overlay-content i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.gallery-overlay-content span {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* View Mode Toggle */
.gallery-view-toggle .btn {
    border-color: var(--primary-light);
    color: var(--text-medium);
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.gallery-view-toggle .btn:hover,
.gallery-view-toggle .btn.active {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--background-cream);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.3);
}

/* Pagination */
.gallery-pagination-container {
    margin-top: 3rem;
}

.pagination {
    justify-content: center;
    margin: 0;
}

.pagination .page-link {
    color: var(--text-medium);
    background: var(--background-warm);
    border: 1px solid var(--primary-light);
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    color: var(--background-cream);
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(218, 165, 32, 0.3);
}

.pagination .page-item.active .page-link {
    background: var(--primary-warm);
    border-color: var(--primary-warm);
    color: var(--background-cream);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-light);
    background: var(--background-warm);
    border-color: var(--primary-light);
    opacity: 0.5;
}

/* Modal Styles */
#professionalGalleryModal .modal-content {
    background: #000;
    border: none;
    border-radius: 0;
}

#professionalGalleryModal .modal-header {
    z-index: 1050;
}

#professionalGalleryModal .btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#professionalGalleryModal .btn-close-white:hover {
    opacity: 1;
}

#mainGalleryImage {
    transition: opacity 0.3s ease;
    max-height: 90vh;
    max-width: 90vw;
    object-fit: contain;
}

/* Navigation Buttons */
#prevImageBtn,
#nextImageBtn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prevImageBtn:hover,
#nextImageBtn:hover {
    background: rgba(218, 165, 32, 0.8) !important;
    border-color: var(--accent-gold) !important;
    transform: scale(1.1);
}

/* Thumbnail Strip */
#thumbnailStrip {
    max-width: 90vw;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-gold) transparent;
}

#thumbnailStrip::-webkit-scrollbar {
    height: 6px;
}

#thumbnailStrip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#thumbnailStrip::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 3px;
}

.gallery-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumbnail.active {
    border-color: var(--accent-gold);
    transform: scale(1.1);
}

.gallery-thumbnail:hover {
    transform: scale(1.05);
    border-color: rgba(218, 165, 32, 0.5);
}

.thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.gallery-thumbnail:not(.active) .thumbnail-img {
    opacity: 0.7;
}

.gallery-thumbnail.active .thumbnail-img,
.gallery-thumbnail:hover .thumbnail-img {
    opacity: 1;
}

/* Image Counter */
#imageCounter {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid-inner {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .gallery-section {
        padding: 2rem;
        margin: 2rem 0;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    #prevImageBtn,
    #nextImageBtn {
        width: 50px;
        height: 50px;
        font-size: 0.9rem;
    }
    
    .gallery-thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid-inner {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .gallery-section {
        padding: 1.5rem;
    }
    
    .gallery-image {
        height: 150px;
    }
    
    .gallery-view-toggle .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    #prevImageBtn,
    #nextImageBtn {
        width: 45px;
        height: 45px;
        font-size: 0.8rem;
    }
    
    .gallery-thumbnail {
        width: 50px;
        height: 38px;
    }
}

/* Loading Animation */
.gallery-item {
    opacity: 0;
    transform: translateY(20px);
    animation: galleryItemFadeIn 0.6s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes galleryItemFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.gallery-item:focus {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

.pagination .page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(218, 165, 32, 0.25);
}

/* Print Styles */
@media print {
    .gallery-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .gallery-overlay,
    .gallery-view-toggle,
    .gallery-pagination-container {
        display: none !important;
    }
}

