/* SPHAERO — Styles principaux */
:root {
    --bleu-sphaero: #2c5aa0;
    --bleu-clair: #4a90d9;
    --or-sphaero: #f0a500;
    --blanc: #ffffff;
    --gris-clair: #f5f5f5;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: var(--gris-clair);
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.navbar-logo img {
    height: 80px;
    width: auto;
    object-fit: contain;
}
.navbar-logo {
    text-decoration: none;
}

.navbar-logo span {
    color: #1a1a1a;
    font-size: 1.5em;
    font-weight: bold;
    margin-left: 10px;
}

.carousel {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 400px;
    background: var(--bleu-sphaero);
    color: #1a1a1a;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.carousel-slide.active {
    display: flex;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.carousel-caption {
    position: relative;
    z-index: 2;
    background: transparent;
    padding: 20px 40px;
    border-radius: 10px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}

.carousel-caption h2 {
    font-size: 2em;
    margin: 0 0 10px;
    color: white !important;
}
.carousel-caption p {
    color: white !important;
    font-size: 1.1em;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    z-index: 3;
}

.dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
}

.dot.active {
    background: white;
}

.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ── Statistiques bande ── */
.stats-band {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    background: #1a3a6b;
    padding: 20px 40px;
    flex-wrap: nowrap;
}
.stat-item {
    text-align: center;
    flex: 1;
    padding: 15px 20px;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.stat-item:last-child {
    border-right: none;
}
.stat-item .chiffre {
    font-size: 2.2em;
    font-weight: 800;
    color: #C8860A;
    line-height: 1;
}
.stat-item .label {
    font-size: 0.82em;
    color: rgba(255,255,255,0.8);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Menu burger ── */
.menu-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.4em;
    color: #333;
    font-weight: 900;
    letter-spacing: -2px;
    border-radius: 50%;
    transition: background 0.2s;
    user-select: none;
}
.menu-burger:hover {
    background: #f0f0f0;
}
.menu-burger span {
    display: none;
}
.menu-dropdown {
    display: none;
    position: absolute;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 200px;
    overflow: hidden;
}
.menu-dropdown.actif {
    display: block;
}
.menu-dropdown a {
    display: block;
    padding: 13px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.92em;
    font-weight: 500;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}
.menu-dropdown a:last-child { border-bottom: none; }
.menu-dropdown a:hover { background: #fff8e1; color: #C8860A; }

/* ── Stats carrousel ── */
.carousel-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    right: 40px;
    bottom: 40px;
    z-index: 10;
}
.carousel-stat-item {
    text-align: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    padding: 8px 16px;
    min-width: 90px;
}
.carousel-stat-item .label {
    font-size: 0.72em;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.carousel-stat-item .chiffre {
    font-size: 1.5em;
    font-weight: 800;
    color: #C8860A;
    margin-top: 2px;
}

/* ── Recherche + Stats ── */
.search-stats-row {
    display: flex;
    align-items: center;
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}
.search-bar {
    flex: 1;
}
.stats-inline {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}
.stat-inline-item {
    text-align: center;
    min-width: 70px;
}
.stat-inline-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.stat-inline-chiffre {
    font-size: 1.3em;
    font-weight: 800;
    color: #1a1a1a;
    white-space: nowrap;
}

/* ── Bouton retour ── */
.btn-retour {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: white;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    color: #555;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin: 15px 0 0 20px;
    transition: all 0.2s;
}
.btn-retour:hover {
    border-color: #C8860A;
    color: #C8860A;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN — SPHAERO
   Breakpoints:
   - Desktop  : > 1024px (défaut)
   - Laptop   : 768px - 1024px
   - Tablette : 576px - 768px
   - Mobile   : < 576px
══════════════════════════════════════════════════════════ */

/* ── Laptop (768px - 1024px) ── */
@media (max-width: 1024px) {
    .navbar { padding: 8px 20px; }
    .main-content { padding: 0 15px; }
    .stats-band { padding: 15px 20px; gap: 0; }
    .stat-item .chiffre { font-size: 1.8em; }
    .carousel { height: 320px; }
    .carousel-slide { height: 320px; }
    .carousel-stats { right: 20px; bottom: 20px; }
    .search-stats-row { gap: 15px; }
    .stats-inline { gap: 12px; }
}

/* ── Tablette (576px - 768px) ── */
@media (max-width: 768px) {
    .navbar {
        padding: 8px 15px;
        height: auto;
        min-height: 65px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .navbar-logo img { height: 55px; }
    .navbar-logo span { font-size: 1.2em; }
    .navbar-liens {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
    .navbar form { max-width: 200px; }
    .carousel { height: 260px; }
    .carousel-slide { height: 260px; }
    .carousel-caption h2 { font-size: 1.4em; }
    .carousel-caption p { font-size: 0.9em; }
    .carousel-stats { display: none; }
    .stats-band {
        flex-wrap: wrap;
        padding: 12px 15px;
        gap: 0;
    }
    .stat-item {
        flex: 0 0 50%;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding: 10px;
    }
    .stat-item:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.2); }
    .stat-item:last-child { border-bottom: none; }
    .stat-item .chiffre { font-size: 1.6em; }
    .main-content { margin: 20px auto; padding: 0 12px; }
    .search-stats-row { flex-direction: column; gap: 12px; }
    .stats-inline { justify-content: center; }
    .menu-dropdown { top: 65px; right: 10px; min-width: 180px; }

    /* Grilles générales */
    [style*="grid-template-columns: repeat(auto-fill, minmax(320px"] { 
        grid-template-columns: 1fr 1fr !important; 
    }
    [style*="grid-template-columns: repeat(auto-fill, minmax(240px"] { 
        grid-template-columns: 1fr 1fr !important; 
    }
    /* Layout 2 colonnes -> 1 colonne */
    [style*="grid-template-columns: 2fr 1fr"] { 
        grid-template-columns: 1fr !important; 
    }
    [style*="grid-template-columns: 1fr 1fr"] { 
        grid-template-columns: 1fr !important; 
    }
}

/* ── Mobile (< 576px) ── */
@media (max-width: 576px) {
    .navbar {
        padding: 6px 12px;
        min-height: 60px;
    }
    .navbar-logo img { height: 45px; }
    .navbar-logo span { font-size: 1.1em; }
    .navbar form { display: none; }

    .carousel { height: 200px; }
    .carousel-slide { height: 200px; }
    .carousel-caption { padding: 12px 20px; }
    .carousel-caption h2 { font-size: 1.1em; }
    .carousel-caption p { font-size: 0.82em; }

    .stats-band { padding: 10px; }
    .stat-item { flex: 0 0 50%; padding: 8px; }
    .stat-item .chiffre { font-size: 1.4em; }
    .stat-item .label { font-size: 0.72em; }

    .main-content { margin: 15px auto; padding: 0 10px; }

    /* Toutes les grilles en 1 colonne sur mobile */
    [style*="grid-template-columns"] { 
        grid-template-columns: 1fr !important; 
    }
    /* Tableaux scrollables */
    table { display: block; overflow-x: auto; white-space: nowrap; }

    /* Boutons pleine largeur */
    .btn-retour { font-size: 0.78em; padding: 6px 12px; }

    /* Menu dropdown */
    .menu-dropdown {
        top: 60px;
        right: 0;
        left: 0;
        border-radius: 0 0 12px 12px;
        min-width: 100%;
    }

    /* Sidebar layouts -> full width */
    .inst-layout,
    .ep-layout,
    .bo-layout {
        grid-template-columns: 1fr !important;
    }
    .inst-sidebar,
    .ep-sidebar,
    .bo-sidebar {
        display: none;
    }

    /* Cards padding réduit */
    .section-card,
    .card { padding: 14px !important; }

    /* KPI grille 2 colonnes sur mobile */
    .kpi-grid { grid-template-columns: 1fr 1fr !important; }

    /* Pub grid 1 colonne */
    .pub-grid,
    .inst-grid,
    .collections-vedette {
        grid-template-columns: 1fr !important;
    }

    /* Auth cards */
    .auth-card { padding: 24px 18px !important; }
    .type-choice { grid-template-columns: 1fr !important; }
    .form-grid { grid-template-columns: 1fr !important; }

    /* Lecteur streaming */
    .reader-topbar { padding: 6px 10px; gap: 6px; }
    .reader-titre { display: none; }

    /* Footer */
    footer { font-size: 0.75em; padding: 12px; }
}

/* ── Navbar liens : masquer texte sur petit écran ── */
@media (max-width: 480px) {
    .navbar-liens a:not(.btn-connexion):not([style*="background"]) {
        display: none;
    }
}

/* ── Touch devices : améliorer les zones cliquables ── */
@media (hover: none) and (pointer: coarse) {
    .nav-btn,
    .filtre-btn,
    .btn-inst,
    .btn-collection,
    .star-btn {
        min-height: 44px;
        min-width: 44px;
    }
    .social-btn { padding: 14px; }
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* évite le zoom auto sur iOS */
    }
}

/* ── Impression ── */
@media print {
    .navbar, .menu-dropdown, .inst-sidebar, .ep-sidebar,
    .bo-sidebar, .btn-retour, footer { display: none !important; }
    body { background: white; }
    .main-content { margin: 0; padding: 0; max-width: 100%; }
}

/* ── Navbar fixe au scroll ── */
.navbar {
/* ══════════════════════════════════════
   SPHAERO — RESPONSIVE FINAL
══════════════════════════════════════ */

/* Navbar sticky */
.navbar {
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    body { overflow-x: hidden; }

    /* Navbar */
    .navbar {
        padding: 8px 12px;
        height: 62px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    .navbar-logo img { height: 42px; }
    .navbar-logo span { font-size: 1em; letter-spacing: 1px; }
    .navbar form { display: none; }
    .navbar-liens { gap: 6px; flex-shrink: 0; }
    .navbar-liens > a {
        padding: 5px 10px;
        font-size: 0.78em;
        white-space: nowrap;
    }
    .navbar-liens > form { display: none; }

    /* Menu dropdown */
    .menu-dropdown {
        top: 62px;
        right: 0;
        left: 0;
        min-width: 100%;
        border-radius: 0 0 12px 12px;
    }

    /* Carousel */
    .carousel, .carousel-slide { height: 220px; }
    .carousel-caption { padding: 15px 20px; }
    .carousel-caption h2 { font-size: 1.15em; }
    .carousel-caption p { font-size: 0.85em; }
    .carousel-stats { display: none; }

    /* Stats band : grille 5 colonnes compacte */
    .stats-band {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 10px 8px;
        gap: 0;
        -webkit-overflow-scrolling: touch;
    }
    .stat-item {
        flex: 0 0 20%;
        min-width: 60px;
        padding: 8px 4px;
        text-align: center;
        border-right: 1px solid rgba(255,255,255,0.2);
        border-bottom: none;
    }
    .stat-item:last-child { border-right: none; }
    .stat-item .chiffre { font-size: 1.2em; }
    .stat-item .label { font-size: 0.6em; letter-spacing: 0; }

    /* Contenu */
    .main-content { margin: 15px auto; padding: 0 12px; }

    /* Sidebar layouts */
    .ep-layout, .bo-layout, .inst-layout { grid-template-columns: 1fr; }
    .ep-sidebar, .bo-sidebar, .inst-sidebar { display: none; }

    /* Tableaux */
    table { display: block; overflow-x: auto; }

    /* Grilles inline */
    [style*="grid-template-columns: 2fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat"] {
        grid-template-columns: 1fr;
    }
}

/* Petit mobile (< 480px) */
@media (max-width: 480px) {
    .navbar-logo span { display: none; }
    .navbar-logo img { height: 38px; }
    .stat-item .chiffre { font-size: 1em; }
    .stat-item .label { font-size: 0.55em; }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .form-group input,
    .form-group select,
    .form-group textarea { font-size: 16px; }
    .menu-dropdown a { padding: 14px 20px; }
}
/* Nom SPHAERO toujours visible */
@media (max-width: 480px) {
    .navbar-logo span {
        display: inline !important;
        font-size: 1em;
        letter-spacing: 1px;
    }
}
/* NAVBAR STICKY — toujours visible au scroll */
.navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.97) !important;
}
/* NAVBAR FIXED — figée en haut sur tous les écrans */
.navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
}

/* Compenser la hauteur de la navbar (80px desktop, 62px mobile) */
body {
    padding-top: 80px !important;
}

@media (max-width: 768px) {
    body {
        padding-top: 110px !important;
    }
}
/* Stats : label au-dessus, chiffre en dessous */
.stat-item {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
}
/* Stats : label au-dessus, chiffre en dessous */
.stat-item {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
}
