/* css/gallery.css - Gallery Page Styles */

/* Page Header */
.gallery-header {
    background: linear-gradient(135deg, rgba(230, 126, 34, 0.1) 0%, rgba(211, 84, 0, 0.05) 100%);
    text-align: center;
    padding: var(--space-xxl) 0;
    position: relative;
    overflow: hidden;
}

.gallery-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/gallery-pattern.png') repeat;
    opacity: 0.05;
}

.gallery-header h1 {
    font-size: 4.8rem;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
    position: relative;
}

.gallery-header p {
    font-size: 1.8rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Filters */
.gallery-filters {
    background: var(--bg-white);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-light);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.3);
}

.filter-btn i {
    font-size: 1.6rem;
}

/* Main Gallery Grid */
.gallery-main {
    padding: var(--space-xxl) 0;
    background: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xxl);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow-light);
    cursor: pointer;
    transition: all var(--transition-normal);
    aspect-ratio: 1;
    background: var(--bg-white);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-medium);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: var(--text-white);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.gallery-item:hover .gallery-info {
    transform: translateY(0);
}

.gallery-info h4 {
    font-size: 1.8rem;
    margin-bottom: var(--space-xs);
    color: var(--text-white);
}

.category {
    display: inline-block;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.gallery-expand {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    opacity: 0;
    transform: scale(0.8);
}

.gallery-item:hover .gallery-expand {
    opacity: 1;
    transform: scale(1);
}

.gallery-expand:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: scale(1.1);
}

/* Load More Button */
.load-more-container {
    text-align: center;
}

.load-more-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 1.2rem 3rem;
    border-radius: var(--radius-lg);
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.load-more-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
}

.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.load-more-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Instagram Section */
.instagram-section {
    padding: var(--space-xxl) 0;
    background: var(--bg-white);
    text-align: center;
}

.instagram-section .section-header h2 {
    font-size: 3.2rem;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.instagram-section .section-header p {
    font-size: 1.8rem;
    color: var(--text-light);
    margin-bottom: var(--space-xl);
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.instagram-placeholder {
    grid-column: 1 / -1;
    padding: var(--space-xxl);
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    color: var(--text-light);
}

.instagram-placeholder i {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: var(--space-lg);
}

.instagram-placeholder p {
    font-size: 1.6rem;
    margin-bottom: var(--space-lg);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: scale(0.8);
    transition: transform var(--transition-normal);
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-white);
    transition: all var(--transition-fast);
}

.lightbox-close:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    color: var(--text-white);
    transition: all var(--transition-fast);
}

.lightbox-nav:hover {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-image-container {
    position: relative;
    max-width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.lightbox-image-container img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-info {
    padding: var(--space-lg);
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.lightbox-info h3 {
    font-size: 2.4rem;
    color: var(--text-dark);
    margin-bottom: var(--space-sm);
}

.lightbox-info p {
    color: var(--text-light);
    font-size: 1.6rem;
    line-height: 1.6;
    margin: 0;
}

/* Gallery Item Animations */
.gallery-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease 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 fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Masonry Layout Variation */
.gallery-grid.masonry {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: masonry;
    grid-auto-flow: dense;
}

.gallery-grid.masonry .gallery-item {
    aspect-ratio: auto;
}

.gallery-grid.masonry .gallery-item:nth-child(3n) {
    grid-row: span 2;
}

.gallery-grid.masonry .gallery-item:nth-child(5n) {
    grid-column: span 2;
}

/* Loading States */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: var(--space-xxl);
    color: var(--text-light);
    grid-column: 1 / -1;
}

.gallery-empty i {
    font-size: 6rem;
    margin-bottom: var(--space-lg);
    color: var(--border-color);
}

.gallery-empty h3 {
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .gallery-header h1 {
        font-size: 4rem;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--space-sm);
    }
    
    .filter-btn {
        white-space: nowrap;
    }
    
    .gallery-grid.masonry {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-header {
        padding: var(--space-xl) 0;
    }
    
    .gallery-header h1 {
        font-size: 3.6rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--space-md);
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .lightbox-prev {
        left: 1rem;
    }
    
    .lightbox-next {
        right: 1rem;
    }
    
    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .gallery-header h1 {
        font-size: 3.2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid.masonry {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1.4rem;
    }
    
    .lightbox-info {
        padding: var(--space-md);
    }
    
    .lightbox-info h3 {
        font-size: 2rem;
    }
    
    .instagram-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .gallery-filters,
    .load-more-container,
    .instagram-section,
    .gallery-overlay,
    .gallery-expand {
        display: none !important;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: var(--space-md) !important;
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid var(--border-color) !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .gallery-item {
        border: 2px solid var(--text-dark);
    }
    
    .filter-btn {
        border-width: 3px;
    }
    
    .gallery-overlay {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .filter-btn,
    .gallery-expand,
    .lightbox-nav {
        transition: none;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-item img {
        transition: none;
    }
    
    .gallery-overlay {
        opacity: 1;
        position: static;
        background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
    }
    
    .gallery-info {
        transform: none;
    }
}