/* 
 * TimeVox - Styles pour la page galerie
 * assets/css/galerie.css
 */

/* Hero galerie */
.hero-galerie {
    background: linear-gradient(135deg, var(--vintage-cream) 0%, #e8e2d5 100%);
    padding: 150px 0 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-galerie::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="%23000" opacity="0.03"/><circle cx="80" cy="80" r="2" fill="%23ff6b35" opacity="0.05"/></svg>');
    pointer-events: none;
}

.hero-galerie-content {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.galerie-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-orange);
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--dark-grey);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filtres compacts */
.section-compact {
    padding: 1rem 0;
}

.filters-compact {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-grey);
    margin-right: 0.5rem;
}

.filter-btn-small {
    padding: 0.3rem 0.8rem;
    background: var(--light-grey);
    color: var(--dark-grey);
    border: 1px solid transparent;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn-small:hover {
    background: var(--vintage-cream);
    color: var(--accent-orange);
    border-color: var(--accent-orange);
}

.filter-btn-small.active {
    background: var(--accent-orange);
    color: white;
    border-color: var(--accent-orange);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-count {
    font-size: 0.85rem;
    color: var(--dark-grey);
    font-weight: 500;
}

.clear-filters {
    background: var(--dark-grey);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.clear-filters:hover {
    background: var(--accent-orange);
}

/* Grid des médias */
.medias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.media-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    aspect-ratio: 4/3;
}

.media-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-medium);
}

.media-card:hover .media-overlay {
    opacity: 1;
}

.media-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.media-card:hover .media-img {
    transform: scale(1.1);
}

/* Overlay vidéo */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: var(--transition);
}

.play-icon {
    color: white;
    font-size: 1.5rem;
    margin-left: 4px;
}

.media-card:hover .play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 107, 53, 0.9);
}

/* Overlay d'informations */
.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 40%,
        rgba(0, 0, 0, 0.8) 100%
    );
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
}

.media-badges {
    display: flex;
    gap: 0.5rem;
    align-self: flex-start;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-type {
    background: var(--accent-orange);
}

.badge-photo {
    background: #4CAF50;
}

.badge-video {
    background: #2196F3;
}

.badge-schema {
    background: #9C27B0;
}

.badge-category {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.media-info {
    text-align: left;
}

.media-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.media-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.8;
}

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

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

.lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    display: flex;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-container {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--accent-orange);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--accent-orange);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-content {
    display: flex;
    width: 100%;
    height: 80vh;
}

.lightbox-media {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    position: relative;
    overflow: hidden;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    /* Empêcher les transitions sur les images */
    transition: none !important;
    transform: none !important;
    animation: none !important;
}

/* Styles spécifiques pour isoler de vos autres CSS */
.lightbox-image {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    width: auto !important;
    height: auto !important;
    transition: none !important;
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
}

.lightbox-video {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    transition: none !important;
    transform: none !important;
    animation: none !important;
}

.lightbox-info {
    flex: 1;
    padding: 2rem;
    background: white;
    overflow-y: auto;
    min-width: 350px;
}

.lightbox-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 1rem;
    font-family: 'Orbitron', monospace;
}

.lightbox-description {
    color: var(--dark-grey);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.lightbox-meta {
    background: var(--light-grey);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.lightbox-meta .meta-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.lightbox-meta .meta-item:last-child {
    margin-bottom: 0;
}

.lightbox-meta .meta-label {
    font-weight: 600;
    color: var(--primary-black);
}

.lightbox-meta .meta-value {
    color: var(--dark-grey);
}

/* État vide */
.no-medias {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.no-medias-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-medias h2 {
    color: var(--primary-black);
    margin-bottom: 1rem;
}

.no-medias p {
    color: var(--dark-grey);
    margin-bottom: 2rem;
}

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

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */

/* Tablettes */
@media (max-width: 1024px) {
    .galerie-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .medias-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .lightbox-container {
        flex-direction: column;
        max-width: 95%;
        max-height: 95%;
    }
    
    .lightbox-content {
        flex-direction: column;
        height: auto;
        max-height: 80vh;
    }
    
    .lightbox-media {
        height: 60vh;
        min-height: 300px;
    }
    
    .lightbox-info {
        min-width: auto;
        height: 40vh;
        overflow-y: auto;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero-galerie {
        padding: 120px 0 3rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .galerie-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .filters-compact {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filter-group-inline {
        width: 100%;
    }
    
    .filter-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-label {
        font-size: 0.85rem;
    }
    
    .filter-btn-small {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .medias-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 0.8rem;
    }
    
    .media-overlay {
        opacity: 1;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.6) 60%,
            rgba(0, 0, 0, 0.9) 100%
        );
    }
    
    .media-title {
        font-size: 1rem;
    }
    
    .media-description {
        font-size: 0.8rem;
    }
    
    .lightbox-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
    }
    
    .lightbox-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    .lightbox-info {
        padding: 1.5rem;
    }
    
    .lightbox-title {
        font-size: 1.3rem;
    }
}

/* Très petit mobile */
@media (max-width: 480px) {
    .medias-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .media-card {
        aspect-ratio: 1;
    }
    
    .filters-container {
        padding: 1rem;
    }
    
    .filter-group {
        margin-bottom: 1rem;
    }
    
    .galerie-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Mode sombre (optionnel pour plus tard) */
@media (prefers-color-scheme: dark) {
    .filters-container {
        background: var(--primary-black);
        color: white;
    }
    
    .filter-group h3 {
        color: white;
    }
    
    .filter-btn {
        background: var(--dark-grey);
        color: white;
    }
    
    .filter-btn:hover {
        background: var(--accent-orange);
    }
    
    .media-card {
        background: var(--primary-black);
    }
    
    .lightbox-info {
        background: var(--primary-black);
        color: white;
    }
    
    .lightbox-title {
        color: white;
    }
}