/* CSS SPÉCIFIQUE PAGE GALERIE - DESIGN MODERNE */

/* Override section padding */
.section {
    padding: var(--spacing-md) var(--spacing-md);
}

.page-title {
    padding-top: calc(70px + var(--spacing-sm));
    margin-bottom: var(--spacing-md);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-xl);
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(26, 23, 20, 0.4);
    border: 1.5px solid rgba(212, 165, 116, 0.3);
    border-radius: 50px;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background: rgba(212, 165, 116, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--color-primary);
    color: #000;
    border-color: var(--color-primary);
}

.filter-btn span {
    font-size: 1.2rem;
}

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

/* Album Cards Grid - Override for albums page */
#albumsGrid.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    justify-content: center;
    justify-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: rgba(26, 23, 20, 0.4);
    border: 1.5px solid rgba(212, 165, 116, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--color-primary);
    box-shadow: 0 20px 60px rgba(212, 165, 116, 0.4), 0 0 0 1px rgba(212, 165, 116, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: var(--spacing-lg);
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

.gallery-overlay h3 {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.gallery-category {
    font-size: 0.85rem;
    color: var(--color-text);
    margin-bottom: 4px;
}

.gallery-date {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Album Cards Grid */
.album-card {
    display: block;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(26, 23, 20, 0.6);
    border: 1.5px solid rgba(212, 165, 116, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 320px;
}

.album-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-primary);
    box-shadow: 0 15px 40px rgba(212, 165, 116, 0.35), 0 0 0 1px rgba(212, 165, 116, 0.3);
}

.album-cover {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(26, 23, 20, 0.9), rgba(212, 165, 116, 0.1));
}

.album-cover > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.album-cover > img[src=""], .album-cover > img:not([src]) {
    opacity: 0;
}

.album-card:hover .album-cover > img {
    opacity: 0;
    transform: scale(1.1);
}

.album-preview {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.album-card:hover .album-preview {
    opacity: 1;
}

.album-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    padding: var(--spacing-sm) var(--spacing-md);
    pointer-events: none;
}

.album-count {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.85rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.album-info {
    padding: var(--spacing-md);
    text-align: center;
}

.album-info h3 {
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 8px;
    transition: color 0.3s ease;
    font-weight: 700;
    text-align: center;
}

.album-card:hover .album-info h3 {
    color: #f4d4a8;
}

.album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    justify-content: center;
    align-items: center;
}

.album-category {
    background: rgba(212, 165, 116, 0.15);
    padding: 3px 10px;
    border-radius: 10px;
    color: var(--color-text);
    font-size: 0.75rem;
}

.album-date {
    color: var(--color-text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl);
    background: rgba(26, 23, 20, 0.4);
    border: 1.5px solid rgba(212, 165, 116, 0.3);
    border-radius: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 0 20px rgba(212, 165, 116, 0.5));
}

.empty-state h2 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.empty-state .cta-buttons {
    margin-top: var(--spacing-lg);
}

.empty-state .btn {
    min-width: 180px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 0;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox-counter {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(212, 165, 116, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 165, 116, 0.4);
    color: var(--color-primary);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 10002;
}

.lightbox-info {
    background: rgba(10, 8, 6, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(212, 165, 116, 0.2);
    padding: 80px 40px 40px;
    text-align: left;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lightbox-info h3 {
    color: var(--color-primary);
    font-size: 2rem;
    margin-bottom: 0;
    font-weight: 700;
    line-height: 1.3;
}

.lightbox-info p {
    color: #cbd5e1;
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .lightbox-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
    
    .lightbox-info {
        border-left: none;
        border-top: 1px solid rgba(212, 165, 116, 0.2);
        padding: 30px 20px;
        max-height: 40vh;
    }
    
    .lightbox-image-container {
        padding: 100px 20px 20px;
    }
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(212, 165, 116, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(212, 165, 116, 0.4);
    color: var(--color-primary);
    font-size: 2.2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    z-index: 10001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-primary);
    color: #1a1714;
    border-color: var(--color-primary);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.4);
}

.lightbox-close {
    top: 30px;
    right: 30px;
    font-weight: 200;
}

.lightbox-close:hover {
    transform: scale(1.15) rotate(90deg);
}

.lightbox-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.15) translateX(-5px);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.15) translateX(5px);
}

/* Category Headers */
.category-header {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    animation: fadeInDown 0.6s ease;
    position: relative;
    padding-bottom: var(--spacing-xs);
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    #albumsGrid.gallery-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .album-card {
        max-width: 100%;
    }

    .lightbox-content {
        max-width: 95vw;
    }

    .lightbox-content img {
        max-height: 60vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* Skeleton Loader for images */
.gallery-item.loading {
    background: linear-gradient(
        90deg,
        rgba(26, 23, 20, 0.4) 0%,
        rgba(212, 165, 116, 0.1) 50%,
        rgba(26, 23, 20, 0.4) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item img.loaded {
    opacity: 1;
}
