/* ==========================================================================
   GALLERY PAGE STYLES
   ========================================================================== */

/* Gallery Hero Section */
.gallery-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../imgs/pattern.png') repeat;
    opacity: 0.1;
    z-index: 1;
}

.gallery-hero .container {
    position: relative;
    z-index: 2;
}

/* Album Sections */
.album-section {
    margin-bottom: 4rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.album-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007bff, #6610f2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.album-section:hover .album-icon {
    transform: scale(1.1);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Gallery Images */
.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0.8;
}

.gallery-image.loaded {
    opacity: 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay .btn {
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
}

.gallery-overlay .btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
    transform: scale(1.1);
}

/* Gallery Info */
.gallery-info {
    padding: 1rem;
}

.gallery-info h6 {
    color: #333;
    margin-bottom: 0.5rem;
}

.image-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.image-meta .d-flex {
    align-items: center;
}

.image-meta i {
    font-size: 0.8rem;
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.filter-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.filter-btn i {
    font-size: 0.9rem;
}

/* Stats Section */
.stats-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../imgs/pattern.png') repeat;
    opacity: 0.05;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.15);
}

.stat-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    transition: transform 0.3s ease;
}

.stat-item:hover .stat-icon {
    transform: scale(1.1);
}

.stat-item h4 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stat-item p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Empty Gallery State */
.empty-gallery {
    text-align: center;
    padding: 5rem 2rem;
    color: #6c757d;
}

.empty-gallery i {
    color: #dee2e6;
    margin-bottom: 2rem;
}

.empty-gallery h3 {
    color: #495057;
    margin-bottom: 1rem;
}

.empty-gallery .lead {
    color: #6c757d;
    margin-bottom: 2rem;
}

.empty-gallery .btn {
    margin-top: 1rem;
}

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    z-index: 1000;
    border: none;
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
    transition: all 0.3s ease;
}

#backToTop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,123,255,0.4);
}

/* Loading Animation */
.gallery-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.gallery-image.loaded {
    background: none;
    animation: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 100px 0 60px;
    }
    
    .gallery-hero h1 {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .album-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .album-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        min-width: 200px;
        justify-content: center;
    }
    
    .stats-section {
        padding: 2rem 0;
    }
    
    .stat-item {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .stat-item h4 {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-image {
        height: 180px;
    }
    
    .album-section {
        padding: 1rem;
    }
    
    .filter-btn {
        min-width: 100%;
    }
    
    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .album-section {
        background: #2d3748;
        color: white;
    }
    
    .gallery-item {
        background: #2d3748;
    }
    
    .gallery-info h6 {
        color: white;
    }
    
    .filter-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .filter-btn:hover,
    .filter-btn.active {
        background: #007bff;
        border-color: #007bff;
        color: white;
    }
}

/* Print Styles */
@media print {
    .gallery-hero,
    .filter-section,
    .stats-section,
    #backToTop {
        display: none !important;
    }
    
    .album-section {
        break-inside: avoid;
        margin-bottom: 2rem;
        padding: 1rem;
        border: 1px solid #333;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .gallery-image {
        height: 150px;
    }
    
    .gallery-overlay {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .filter-btn {
        border-width: 3px;
    }
    
    .gallery-item {
        border: 2px solid #333;
    }
    
    .album-section {
        border: 2px solid #333;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .album-section:hover {
        transform: none;
    }
}
