/* ============================================
   Gallery Page Styles
   ============================================ */

.page-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
}

.page-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Gallery Filters */
.gallery-filters-section {
    padding: 2rem 0;
    background-color: white;
    box-shadow: var(--shadow-sm);
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Gallery Grid */
.gallery-section {
    padding: 3rem 0;
    background-color: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.gallery-item {
    background-color: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.gallery-item.hidden {
    display: none;
}

.gallery-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.1);
}

.gallery-image .image-placeholder {
    height: 100%;
    background: linear-gradient(135deg, var(--bg-light) 0%, #e5e7eb 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-light);
}

.gallery-image .image-placeholder svg {
    width: 4rem;
    height: 4rem;
    opacity: 0.5;
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.gallery-info p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Info Box */
.gallery-info-box {
    background-color: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 2rem;
}

.info-box-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.info-icon {
    width: 3rem;
    height: 3rem;
    color: #f59e0b;
    flex-shrink: 0;
}

.gallery-info-box h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.gallery-info-box p {
    color: var(--text-dark);
    line-height: 1.6;
}

.gallery-info-box code {
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Image count badge */
.image-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.image-count svg {
    width: 16px;
    height: 16px;
}

/* Lightbox Carousel */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.2);
}

/* Navigation arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    transition: all 0.2s ease;
    z-index: 10001;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.lightbox-nav:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* Image counter */
.lightbox-counter {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    z-index: 10001;
}

/* Thumbnails */
.lightbox-thumbnails {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10001;
}

.lightbox-thumb {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.lightbox-thumb:hover {
    opacity: 0.8;
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: white;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1.125rem;
    }

    .filters {
        gap: 0.75rem;
    }

    .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .info-box-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }

    .lightbox {
        padding: 1rem;
    }
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton-item {
    pointer-events: none;
}

.skeleton-item .gallery-image {
    height: 250px;
}

.skeleton-box {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #e8dfd3 25%, #f0ebe4 50%, #e8dfd3 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #e8dfd3 25%, #f0ebe4 50%, #e8dfd3 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
