/* --- VARIABLES --- */
:root {
    --sega-blue: #00a3ff;   /* Mégadrive (Défaut) */
    --neon-color: #bc13fe;
    --sidebar-bg: #ffffff;
    --content-bg: #f4f4f4;
    
    /* Nouvelles couleurs */
    --mca-orange: #ff8c00;  /* MakeCode Arcade */
    --fab-dark: #004488;    /* Fabrication : Bleu Foncé pour les textes/boutons */
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: var(--content-bg);
}

/* --- HEADER COMPACT --- */
.header-mini {
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    height: 65px; 
    display: flex; 
    align-items: center; 
    padding: 0 20px;
    
    /* Par défaut (Megadrive) : Bordure bleu clair */
    border-bottom: 3px solid var(--sega-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.logo-mini { height: 40px; margin-right: 15px; }

.header-titles { font-weight: bold; font-size: 1.1rem; }

/* Le style du texte "SEGA" par défaut */
.sega-blue {
    color: var(--sega-blue);
    font-family: 'Arial Black', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.neon-text {
    color: #fff;
    text-shadow: 0 0 5px var(--neon-color), 0 0 10px var(--neon-color);
    animation: breathe 3s ease-in-out infinite alternate;
}

@keyframes breathe {
    from { opacity: 0.7; }
    to { opacity: 1; text-shadow: 0 0 10px var(--neon-color), 0 0 20px var(--neon-color); }
}

/* --- LAYOUT SIDEBAR + CONTENU --- */
.page-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    padding: 20px;
    border-right: 1px solid #ccc;
}

.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 15px; }

.sidebar a { 
    text-decoration: none; 
    color: #555; 
    font-weight: bold; 
    display: block; 
    padding: 10px; 
    border-radius: 5px; 
    transition: all 0.2s;
}

/* Comportement par défaut (Megadrive) */
.sidebar a:hover { background: #f0f0f0; color: var(--sega-blue); }
.sidebar a.active { 
    color: white; 
    background: var(--sega-blue); 
}

.content-area {
    flex-grow: 1;
    padding: 20px;
}

/* --- LES CARDS --- */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lesson-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    border-left: 5px solid #ccc;
}

/* Par défaut (Megadrive) */
.lesson-card.new { border-left-color: var(--sega-blue); }

.badge {
    background: var(--sega-blue);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 10px;
    position: absolute;
    top: 10px; right: 10px;
}

.btn-read {
    display: inline-block;
    margin-top: 10px;
    color: var(--sega-blue); /* Couleur par défaut */
    text-decoration: none;
    font-weight: bold;
}

/* --- Outils & Logos --- */
.tools-container {
    display: flex;
    gap: 50px;
    margin-top: 5px;
    margin-bottom: 25px;
    justify-content: flex-start;
    flex-wrap: wrap;
}
.tool-logo-link {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tool-logo-only {
    width: 240px;
    height: 240px;
    object-fit: contain;
    filter: drop-shadow(5px 5px 10px rgba(0,0,0,0.4));
    transition: filter 0.3s ease;
}
.tool-logo-link:hover { transform: scale(1.1); }
.tool-logo-link:hover .tool-logo-only {
    filter: drop-shadow(0 0 25px var(--sega-blue));
}


/* =========================================
   GERSION DES THÈMES
   ========================================= */

/* --- THÈME 1 : FABRICATION (Bleu Foncé & Liseré) --- */

/* A. Le Titre "SEGA" dans le bandeau -> Blanc + Liseré Bleu Foncé */
.theme-fabrication .header-mini .sega-blue {
    color: white !important;
    text-shadow: 
        -2px -2px 0 var(--fab-dark),  
         2px -2px 0 var(--fab-dark),
        -2px  2px 0 var(--fab-dark),
         2px  2px 0 var(--fab-dark);
}

/* B. Tout le reste (Boutons, liens, bordures) -> Bleu Foncé SANS liseré */
.theme-fabrication .btn-read,
.theme-fabrication .back-link,
.theme-fabrication .sidebar a:hover {
    color: var(--fab-dark) !important;
    text-shadow: none; /* On s'assure qu'il n'y a pas de liseré ici */
}

.theme-fabrication .sidebar a.active,
.theme-fabrication .badge {
    background: var(--fab-dark) !important;
}

.theme-fabrication .lesson-card.new,
.theme-fabrication .header-mini {
    border-color: var(--fab-dark) !important;
}


/* --- THÈME 2 : MAKECODE ARCADE (Tout Orange) --- */

/* A. Le Titre "SEGA" -> Orange */
.theme-makecode .sega-blue {
    color: var(--mca-orange) !important;
    text-shadow: none;
}

/* B. Tout le reste -> Orange */
.theme-makecode .btn-read,
.theme-makecode .back-link,
.theme-makecode .sidebar a:hover {
    color: var(--mca-orange) !important;
}

.theme-makecode .sidebar a.active,
.theme-makecode .badge {
    background: var(--mca-orange) !important;
}

.theme-makecode .lesson-card.new,
.theme-makecode .header-mini {
    border-color: var(--mca-orange) !important;
}

/* C. Le logo au survol -> Lueur Orange */
.theme-makecode .tool-logo-link:hover .tool-logo-only {
    filter: drop-shadow(0 0 25px var(--mca-orange));
}

/* Pour MakeCode : Si c'est actif ET survolé -> Texte Blanc */
.theme-makecode .sidebar a.active:hover {
    color: white !important;
    background: var(--mca-orange) !important; /* On garde le fond orange */
    cursor: default; /* Optionnel : Montre que cliquer ne sert à rien car on y est déjà */
}

/* Pour Fabrication (ça va sûrement arriver aussi) : Texte Blanc */
.theme-fabrication .sidebar a.active:hover {
    color: white !important;
    background: var(--fab-dark) !important;
}

/* --- MOBILE --- */
@media (max-width: 800px) {
    .page-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
        box-sizing: border-box;
    }
    .content-area { padding: 15px; }
    .tool-logo-only { width: 150px; height: 150px; }
    .tools-container { justify-content: center; gap: 20px; }
}