/**
 * PROJET       : Cortexia
 * FICHIER      : css/app.css
 * DESCRIPTION  : CSS commun à toutes les pages authentifiées.
 *                Design system : Syne (titres) + DM Sans (corps)
 *                Fond #060E1E, glassmorphism, grille décorative.
 * AUTEUR       : Claude Code / Mathieu
 * DERNIÈRE MAJ : 2026-04-08
 *
 * INDEX
 * -----
 * 1. Variables
 * 2. Reset + base
 * 3. Fond décoratif (bg-grid)
 * 4. Layout .page
 * 5. Header + nav
 * 6. Footer
 * 7. Utilitaires (section-label, section-title, cards, badges)
 * 8. Responsive
 */

/* ============================================================
   1. Variables
   ============================================================ */
:root {
    --cyan:   #00D2FF;
    --green:  #10B981;
    --purple: #8B5CF6;
    --amber:  #F59E0B;
    --red:    #EF4444;

    --dark:   #060E1E;
    --card:   rgba(255,255,255,0.04);
    --border: rgba(0,210,255,0.12);
}

/* ============================================================
   2. Reset + base
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--dark);
    color: #E2E8F0;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   3. Fond décoratif
   ============================================================ */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0,210,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,210,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 50% at 15% 5%,  rgba(0,210,255,0.07)   0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 85% 95%, rgba(139,92,246,0.06) 0%, transparent 55%);
}

/* ============================================================
   4. Layout
   ============================================================ */
.page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

main.main-narrow  { max-width: 800px; }
main.main-medium  { max-width: 960px; }
main.main-wide    { max-width: 1100px; }

/* ============================================================
   5. Header + nav
   ============================================================ */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    border-bottom: 1px solid rgba(0,210,255,0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6,14,30,0.75);
}

.logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    animation: blink 2.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

nav a {
    font-size: 14px;
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}

nav a:hover,
nav a.active { color: #E2E8F0; }

.nav-logout {
    font-size: 13px;
    color: #475569;
    border: 1px solid rgba(255,255,255,0.07);
    padding: 7px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-logout:hover {
    color: #E2E8F0;
    border-color: rgba(255,255,255,0.15);
}

/* ============================================================
   6. Footer
   ============================================================ */
footer {
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 24px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #1E293B;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 12px;
    color: #1E293B;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: #475569; }

/* ============================================================
   7. Utilitaires
   ============================================================ */

/* Titres de section */
.section-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 6px;
}

.section-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #fff;
    margin-bottom: 24px;
}

/* Card générique */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}

/* Barre de progression */
.progress-track {
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--purple), var(--cyan));
    transition: width 1s ease;
}

/* Badge pill */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
}

.pill-green  { background: rgba(16,185,129,0.1);  border: 1px solid rgba(16,185,129,0.25);  color: #10B981; }
.pill-cyan   { background: rgba(0,210,255,0.1);   border: 1px solid rgba(0,210,255,0.25);   color: #00D2FF; }
.pill-purple { background: rgba(139,92,246,0.15); border: 1px solid rgba(139,92,246,0.3);   color: #A78BFA; }
.pill-amber  { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.25);  color: #F59E0B; }
.pill-red    { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.25);   color: #EF4444; }

/* Bouton principal */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--cyan);
    color: #000;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 15px;
    padding: 13px 28px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,210,255,0.3);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.06);
    color: #CBD5E1;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 22px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* State boxes (vide / erreur / chargement) */
.state-box {
    text-align: center;
    padding: 60px 20px;
    color: #475569;
}

.state-box .state-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.state-box h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #94A3B8;
    margin-bottom: 8px;
}

.state-box p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ============================================================
   8. Responsive
   ============================================================ */
@media (max-width: 900px) {
    header { padding: 16px 20px; }
    footer  { flex-direction: column; gap: 12px; text-align: center; padding: 20px; }
    /* Sur tablette, on cache Résultats + Points faibles pour ne pas déborder */
    nav a:not(.nav-logout):not(.active):nth-child(n+3):nth-child(-n+4) { display: none; }
}

@media (max-width: 600px) {
    main { padding: 24px 16px 60px; }
    /* Sur mobile, on ne garde que la page active + Déconnexion */
    nav a:not(.nav-logout):not(.active) { display: none; }
    nav { gap: 14px; }
}
