/* ===== Gallery Specific Styles ===== */

/* Global text handling for gallery page */
h1, h2, h3, h4, h5, h6,
p, span, a, li {
    word-break: keep-all;
    word-wrap: break-word;
}

/* Gallery Filter */
.gallery-filter {
    background-color: var(--white);
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.gallery-item.hidden {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.gallery-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    transition: var(--transition-normal);
}

.gallery-placeholder-icon {
    opacity: 0.3;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-lg);
    opacity: 0;
    transition: var(--transition-normal);
}

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

.gallery-info h3 {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.gallery-info p {
    color: var(--white);
    font-size: 0.938rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.gallery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    font-size: 0.813rem;
    color: var(--white);
    opacity: 0.8;
}

.gallery-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.gallery-view-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 48px;
    height: 48px;
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition-normal);
}

.gallery-item:hover .gallery-view-btn {
    opacity: 1;
    transform: scale(1);
}

.gallery-view-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: scale(1.1);
}

/* Upload CTA */
.upload-cta {
    background: linear-gradient(135deg, #FFF5F5 0%, #FFFFFF 100%);
}

.upload-card {
    background-color: var(--white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md) auto;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
}

.upload-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.upload-card p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.lightbox-close {
    top: var(--spacing-md);
    right: var(--spacing-md);
}

.lightbox-prev {
    left: var(--spacing-md);
}

.lightbox-next {
    right: var(--spacing-md);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.lightbox-image {
    max-width: 90vw;
    max-height: 70vh;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 5rem;
    box-shadow: var(--shadow-lg);
}

.lightbox-info {
    background-color: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.lightbox-title {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.lightbox-description {
    color: var(--white);
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.lightbox-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--white);
    opacity: 0.8;
}

.lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Design */
/* Tablet */
@media screen and (max-width: 968px) {
    .gallery-header {
        padding: 2.5rem 0;
    }
    
    .page-title {
        font-size: 2.2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .filter-controls {
        gap: 0.75rem;
    }
    
    .filter-btn {
        padding: 0.7rem 1.25rem;
    }
}

/* Mobile */
@media screen and (max-width: 768px) {
    .gallery-header {
        padding: 2rem 0;
    }
    
    .page-title {
        font-size: 1.85rem;
        line-height: 1.35;
        margin-bottom: 0.75rem;
    }
    
    .page-description {
        font-size: 1rem;
    }
    
    /* Filters */
    .filters {
        padding: 1.5rem;
    }
    
    .filter-controls {
        gap: 0.625rem;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 0.7rem 1.125rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.875rem;
    }
    
    .gallery-item {
        aspect-ratio: 1;
        border-radius: 12px;
    }
    
    .gallery-image {
        border-radius: 12px;
    }
    
    .gallery-overlay {
        border-radius: 12px;
    }
    
    .gallery-info h3 {
        font-size: 1rem;
        margin-bottom: 0.375rem;
    }
    
    .gallery-info p {
        font-size: 0.8rem;
    }
    
    .gallery-stats {
        gap: 0.875rem;
        margin-top: 0.5rem;
    }
    
    .gallery-stat {
        font-size: 0.8rem;
    }
    
    /* Lightbox */
    .lightbox-content {
        max-width: 92vw;
        padding: 1rem;
    }
    
    .lightbox-image {
        max-width: 90vw;
        max-height: 55vh;
        border-radius: 12px;
    }
    
    .lightbox-caption {
        font-size: 0.95rem;
        padding: 0.875rem;
    }
    
    .lightbox-close {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
        top: 1rem;
        right: 1rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
    }
    
    .lightbox-prev {
        left: 0.75rem;
    }
    
    .lightbox-next {
        right: 0.75rem;
    }
    
    /* Upload Modal */
    .modal-content {
        width: 92%;
        max-width: 500px;
        padding: 2rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.35rem;
    }
    
    .upload-area {
        padding: 2rem 1.5rem;
    }
    
    .upload-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    
    .upload-text {
        font-size: 0.95rem;
    }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
    .gallery-header {
        padding: 1.5rem 0;
    }
    
    .page-title {
        font-size: 1.65rem;
    }
    
    .page-description {
        font-size: 0.95rem;
    }
    
    /* Filters */
    .filters {
        padding: 1.25rem 1rem;
    }
    
    .filter-controls {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        min-height: 42px;
    }
    
    /* Gallery Grid - 1 Column for better viewing */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item {
        aspect-ratio: 4/3;
        border-radius: 10px;
    }
    
    .gallery-info h3 {
        font-size: 0.95rem;
    }
    
    .gallery-info p {
        font-size: 0.75rem;
    }
    
    .gallery-stats {
        gap: 0.75rem;
    }
    
    .gallery-stat {
        font-size: 0.75rem;
    }
    
    /* Lightbox */
    .lightbox-content {
        max-width: 95vw;
        padding: 0.75rem;
    }
    
    .lightbox-image {
        max-width: 93vw;
        max-height: 50vh;
        border-radius: 10px;
    }
    
    .lightbox-caption {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    /* Upload Modal */
    .modal-content {
        width: 95%;
        padding: 1.75rem 1.25rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .upload-area {
        padding: 1.75rem 1.25rem;
    }
    
    .upload-icon {
        width: 50px;
        height: 50px;
        font-size: 1.35rem;
        margin-bottom: 0.875rem;
    }
    
    .upload-text {
        font-size: 0.9rem;
    }
    
    .upload-card h2 {
        font-size: 1.35rem;
    }
    
    .form-group input {
        font-size: 0.95rem;
        padding: 0.8rem 0.875rem;
    }
    
    .btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
    }
}