/* Reset CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS pour le thème clair */
:root {
    --bg-primary: #EFF6FF;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --border-color: #dee2e6;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-tertiary: #343a40;
    --accent-color: #0066cc;
    --accent-secondary: #0052a3;
    --accent-text: #ffffff;
    --hover-bg: #f1f3f5;
    --modal-bg: rgba(255, 255, 255, 0.98);
    --shadow-color: rgba(0, 102, 204, 0.15);
    --shadow-glow: rgba(0, 102, 204, 0.25);
    --gradient-primary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --gradient-accent: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.9) 100%);
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

/* Header horizontal */
.top-header {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 30px;
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

/* Bouton menu mobile (caché par défaut) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 35px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Overlay pour le menu mobile */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.site-title {
    display: flex;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
}

.site-title h1 {
    font-size: 1.8em;
    color: var(--accent-color);
    margin: 0;
    font-weight: 700;
}

.site-title .subtitle {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0;
}

.about-btn-header {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    position: absolute;
    right: 30px;
}

.about-btn-header:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.about-btn-header.active {
    background: var(--gradient-accent);
    color: var(--accent-text);
    border-color: var(--accent-color);
}

/* Navigation horizontale avec tabs */
.horizontal-nav {
    display: flex;
    gap: 0;
    padding: 0 30px;
    max-width: 1600px;
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: thin;
    justify-content: center;
}

.horizontal-nav::-webkit-scrollbar {
    height: 4px;
}

.horizontal-nav::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.horizontal-nav::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
}

.nav-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 15px 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}

.nav-tab:hover:not(.disabled) {
    color: var(--accent-color);
    background: var(--hover-bg);
}

.nav-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    font-weight: 600;
}

.nav-tab.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-tab .flag {
    margin-right: 8px;
    font-size: 1.2em;
}


/* Conteneur principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 100px;
}

.content-header {
    padding: 20px 0;
    margin-bottom: 20px;
}

.content-header h2 {
    font-size: 1.8em;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 1em;
}

/* Grille de vignettes */
.thumbnails-grid {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    flex: 1;
}

.thumbnail-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.thumbnail-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px var(--shadow-color);
}

.thumbnail-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.thumbnail-card:hover img {
    transform: scale(1.02);
}

.thumbnail-card .title {
    font-size: 1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.thumbnail-card .description {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    z-index: 1001;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.modal-title {
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 600;
    text-align: center;
    margin: 0;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.modal-content iframe {
    width: 1300px;
    height: 750px;
    max-width: 90vw;
    max-height: 85vh;
    border: none;
    border-radius: 12px;
    display: block;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.modal-content img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Boutons de navigation */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.nav-arrow:hover {
    transform: translateY(-50%) scale(1.1);
    background: var(--accent-color);
    color: var(--accent-text);
    box-shadow: 0 6px 20px var(--shadow-glow);
}

.nav-arrow:disabled {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.nav-arrow.prev {
    left: 20px;
}

.nav-arrow.next {
    right: 20px;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: center;
    padding: 25px 20px;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Page À propos */
.about-section {
    display: none;
    padding: 40px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.about-section.active {
    display: block;
}

.about-section h2 {
    color: var(--text-primary);
    font-size: 2.2em;
    margin-bottom: 25px;
    font-weight: 600;
}

.about-section h3 {
    color: var(--accent-color);
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 600;
}

.about-section p {
    color: var(--text-tertiary);
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 15px;
}

.about-section ul {
    color: var(--text-tertiary);
    font-size: 1.05em;
    line-height: 1.7;
    margin-left: 30px;
    margin-bottom: 15px;
}

.about-section li {
    margin-bottom: 8px;
}

.about-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.about-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-color);
    border-color: var(--accent-color);
}

.contact-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.contact-link {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.contact-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-link:hover {
    background: var(--accent-color);
    color: var(--accent-text);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.graphs-section {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.graphs-section.hidden {
    display: none;
}

/* Responsive */

/* Tablettes */
@media (max-width: 1024px) {
    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .nav-arrow {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
}

/* Mobile et petites tablettes */
@media (max-width: 900px) {
    /* Afficher le bouton hamburger */
    .mobile-menu-btn {
        display: flex;
        position: absolute;
        left: 15px;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px 20px;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .site-title {
        text-align: left;
        flex-direction: column;
        gap: 5px;
        flex: 1;
        min-width: 0;
        padding-left: 10px;
    }

    .site-title h1 {
        font-size: 1.3em;
    }

    .site-title .subtitle {
        font-size: 0.75em;
    }

    .about-btn-header {
        position: relative;
        right: auto;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
        order: 3;
    }

    .mobile-menu-btn {
        order: 1;
        position: relative;
        left: 0;
        flex-shrink: 0;
    }

    .site-title {
        order: 2;
    }

    /* Transformer la nav en menu vertical mobile */
    .horizontal-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 80px 20px 20px;
        box-shadow: 4px 0 15px var(--shadow-color);
        overflow-y: auto;
        transition: left 0.3s ease;
        z-index: 99;
        justify-content: flex-start;
        gap: 10px;
    }

    .horizontal-nav.active {
        left: 0;
    }

    .nav-tab {
        padding: 15px 20px;
        font-size: 1em;
        border: none;
        border-left: 3px solid transparent;
        border-radius: 0;
        text-align: left;
        width: 100%;
    }

    .nav-tab.active {
        border-left-color: var(--accent-color);
        border-bottom: none;
        background: var(--bg-tertiary);
    }

    .nav-tab:hover:not(.disabled) {
        background: var(--bg-tertiary);
    }

    .main-content {
        padding: 15px;
    }

    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .content-header h2 {
        font-size: 1.5em;
    }

    .nav-arrow {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .nav-arrow.prev {
        left: 10px;
    }

    .nav-arrow.next {
        right: 10px;
    }

    .about-section {
        padding: 30px 15px;
    }

    .about-section h2 {
        font-size: 1.8em;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .site-title h1 {
        font-size: 1.3em;
    }

    .thumbnails-grid {
        grid-template-columns: 1fr;
    }

    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .nav-arrow.prev {
        left: 5px;
    }

    .nav-arrow.next {
        right: 5px;
    }

    .about-section h2 {
        font-size: 1.6em;
    }

    .about-section h3 {
        font-size: 1.3em;
    }
}
