/* ITYLOS FORGE V10 - FINAL SYSTEM */

:root {
    --f-cyan: #22d3ee;
    --f-cyan-glow: rgba(34, 211, 238, 0.5);
    --f-amber: #f59e0b;
    --f-amber-glow: rgba(245, 158, 11, 0.5);
    --f-purple: #c084fc;
    --f-green: #4ade80;
    --f-red: #f87171;
    
    --bg-dark: #020617;
    --f-glass: rgba(15, 23, 42, 0.85);
    --f-border: rgba(255, 255, 255, 0.1);
}

main { opacity: 0; animation: fadeIn 0.6s ease-out forwards; }

/* NAVIGATION */
.forge-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; background: rgba(2, 6, 23, 0.6); padding: 5px; border-radius: 16px; border: 1px solid var(--f-border); margin-bottom: 2rem; overflow-x: auto; }
.nav-item { padding: 1rem 0.5rem; background: transparent; border: none; border-radius: 12px; color: #64748b; font-weight: 800; font-size: 0.65rem; letter-spacing: 0.05em; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }

.nav-item.active-std { background: rgba(34, 211, 238, 0.15); color: var(--f-cyan); box-shadow: 0 0 15px rgba(34,211,238,0.1); }
.nav-item.active-phrase { background: rgba(245, 158, 11, 0.15); color: var(--f-amber); box-shadow: 0 0 15px rgba(245,158,11,0.1); }
.nav-item.active-hyb { background: rgba(192, 132, 252, 0.15); color: var(--f-purple); box-shadow: 0 0 15px rgba(192,132,252,0.1); }
.nav-item.active-api { background: rgba(74, 222, 128, 0.15); color: var(--f-green); box-shadow: 0 0 15px rgba(74,222,128,0.1); }
.nav-item.active-mem { background: rgba(248, 113, 113, 0.15); color: var(--f-red); box-shadow: 0 0 15px rgba(248,113,113,0.1); }

/* DISPLAY */
.display-box { background: var(--bg-dark); border: 1px solid var(--f-border); border-radius: 24px; padding: 3rem 2rem; text-align: center; margin-bottom: 2rem; position: relative; transition: border-color 0.4s; box-shadow: inset 0 0 80px rgba(0,0,0,0.6); }
.mode-std .display-box { border-color: rgba(34, 211, 238, 0.4); }
.mode-phrase .display-box { border-color: rgba(245, 158, 11, 0.4); }
.mode-hyb .display-box { border-color: rgba(192, 132, 252, 0.4); }
.mode-api .display-box { border-color: rgba(74, 222, 128, 0.4); }
.mode-mem .display-box { border-color: rgba(248, 113, 113, 0.4); }

#final-pass { width: 100%; background: transparent; border: none; text-align: center; font-family: 'Courier New', monospace; font-weight: 700; font-size: 2rem; color: #fff; outline: none; resize: none; margin: 1rem 0 2rem 0; text-shadow: 0 5px 20px rgba(0,0,0,0.9); height: auto; }
.mode-std #final-pass { color: var(--f-cyan); text-shadow: 0 0 20px rgba(34,211,238,0.4); }
.mode-phrase #final-pass { color: var(--f-amber); text-shadow: 0 0 20px rgba(245,158,11,0.4); }
.mode-hyb #final-pass { color: var(--f-purple); text-shadow: 0 0 20px rgba(192,132,252,0.4); }
.mode-api #final-pass { color: var(--f-green); text-shadow: 0 0 20px rgba(74,222,128,0.4); }
.mode-mem #final-pass { color: var(--f-red); text-shadow: 0 0 20px rgba(248,113,113,0.4); }

/* TOOLS */
.tools-bar { display: flex; justify-content: center; gap: 1rem; position: relative; z-index: 10; }
.tool-btn { width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #94a3b8; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.tool-btn:hover { background: #fff; color: var(--bg-dark); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(255,255,255,0.1); }

/* CONTROLS */
.panel { background: var(--f-glass); border: 1px solid var(--f-border); border-radius: 24px; padding: 2.5rem; margin-top: 2rem; backdrop-filter: blur(15px); }
.range-wrap { margin-bottom: 2rem; }
.range-header { display: flex; justify-content: space-between; margin-bottom: 1rem; color: #cbd5e1; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 24px; width: 24px; border-radius: 50%; margin-top: -10px; background: #fff; box-shadow: 0 0 15px rgba(255,255,255,0.5); }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; width: 100%; background: #334155; }

.opts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.opt-card { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); padding: 1rem; border-radius: 12px; cursor: pointer; transition: 0.2s; }
.opt-card:hover { border-color: #fff; background: rgba(255,255,255,0.05); }
.opt-card span { font-size: 0.7rem; font-weight: 700; color: #cbd5e1; letter-spacing: 0.05em; }
input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* SEPARATORS */
.sep-grid { display: flex; gap: 0.5rem; margin-bottom: 2rem; }
.sep-btn { flex: 1; padding: 0.8rem; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.05); color: #64748b; font-family: monospace; font-size: 1.1rem; border-radius: 10px; cursor: pointer; transition: 0.2s; }
.sep-btn:hover { border-color: #fff; color: #fff; }
.sep-btn.active { background: rgba(255,255,255,0.1); border-color: #fff; color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.1); }

/* MAIN BUTTON (+ CLICK EFFECT) */
.btn-generate { width: 100%; padding: 1.5rem; border: none; border-radius: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.25em; cursor: pointer; transition: 0.1s cubic-bezier(0.4, 0, 0.2, 1); color: #020617; font-size: 0.9rem; }
.btn-generate:active { transform: scale(0.96); filter: brightness(1.2); } /* EFFET CLICK */

.mode-std .btn-generate { background: var(--f-cyan); box-shadow: 0 0 30px rgba(34,211,238,0.2); }
.mode-phrase .btn-generate { background: var(--f-amber); box-shadow: 0 0 30px rgba(245,158,11,0.2); }
.mode-hyb .btn-generate { background: var(--f-purple); box-shadow: 0 0 30px rgba(192,132,252,0.2); }
.mode-api .btn-generate { background: var(--f-green); box-shadow: 0 0 30px rgba(74,222,128,0.2); }
.mode-mem .btn-generate { background: var(--f-red); box-shadow: 0 0 30px rgba(248,113,113,0.2); }

/* --- CONFIGURATION DES MODALS --- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
}
.modal-box { 
    background: #0f172a; border: 1px solid #334155; padding: 2.5rem; 
    border-radius: 24px; position: relative; max-width: 90%; 
    box-shadow: 0 25px 80px rgba(0,0,0,0.9); 
}
.modal-close-x { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; color: #64748b; font-size: 1.5rem; cursor: pointer; }
.modal-close-x:hover { color: #fff; }
.modal-textarea { 
    width: 100%; height: 300px; background: #020617; border: 1px solid #334155; 
    color: #cbd5e1; font-family: monospace; font-size: 0.75rem; padding: 1rem; 
    border-radius: 12px; resize: none; margin-bottom: 1.5rem; 
}

/* --- SYSTÈME MÉMOIRE (BRAIN) --- */
.mem-input-group { margin-bottom: 1.5rem; text-align: left; }
.mem-label { display: block; font-size: 0.7rem; color: #fb7185; font-weight: 800; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.mem-field { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); padding: 1rem; border-radius: 12px; color: #fff; transition: 0.2s; }
.mem-field:focus { border-color: #fb7185; outline: none; box-shadow: 0 0 15px rgba(251,113,133,0.1); }

/* --- BARRE D'ENTROPIE & ANALYSE --- */
.edu-box { margin-top: 3rem; background: rgba(15, 23, 42, 0.6); border-radius: 16px; padding: 1.5rem; border-left: 4px solid #fff; transition: all 0.5s; }
.edu-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.15em; font-weight: 900; margin-bottom: 0.5rem; display: block; color: #cbd5e1; }
.edu-text { font-size: 0.9rem; line-height: 1.6; color: #94a3b8; }
.entropy-meter { height: 6px; background: #1e293b; border-radius: 10px; overflow: hidden; margin: 1rem 0 0.5rem 0; }
.entropy-fill { height: 100%; width: 0%; background: #ef4444; transition: width 0.5s, background 0.5s; }
.crack-info { display: flex; justify-content: space-between; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: #64748b; }
.crack-val { color: #fff; font-weight: 800; }

.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- ONBOARDING & LISIBILITÉ --- */
.panel p.italic {
    color: #f1f5f9 !important;
    font-style: normal !important;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 1 !important;
}
.panel .border-l-2 {
    border-left-width: 3px !important;
    padding-left: 1.25rem;
}

/* Couleurs par mode (Sidebar & Glow) */
#panel-std p { border-color: #22d3ee !important; }
#panel-phrase p { border-color: #f59e0b !important; }
#panel-hyb p { border-color: #c084fc !important; }
#panel-api p { border-color: #4ade80 !important; }
#panel-mem p { border-color: #fb7185 !important; }

/* Intro sous titre */
.text-cyan-400\/60 {
    color: rgba(34, 211, 238, 0.95) !important;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- LEARN CARDS (MICRO-COURS) --- */
.learn-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem !important;
    margin-top: 2rem !important;
    margin-bottom: 3rem !important; /* Espace augmenté pour décoller du bouton */
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}

.learn-card:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.learn-card h4 {
    font-size: 0.85rem !important;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 0.75rem !important;
    text-transform: uppercase;
    text-shadow: 0 0 10px currentColor; /* Effet Glow sur le titre */
}

.learn-card p {
    color: #cbd5e1 !important;
    font-size: 0.85rem !important; /* Taille optimisée */
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* Bordures colorées dynamiques avec Glow */
#panel-std .learn-card { border-left: 4px solid #22d3ee; box-shadow: 0 0 20px rgba(34, 211, 238, 0.05); }
#panel-phrase .learn-card { border-left: 4px solid #f59e0b; box-shadow: 0 0 20px rgba(245, 158, 11, 0.05); }
#panel-hyb .learn-card { border-left: 4px solid #c084fc; box-shadow: 0 0 20px rgba(192, 132, 252, 0.05); }
#panel-api .learn-card { border-left: 4px solid #4ade80; box-shadow: 0 0 20px rgba(74, 222, 128, 0.05); }
#panel-mem .learn-card { border-left: 4px solid #fb7185; box-shadow: 0 0 20px rgba(251, 113, 133, 0.05); }

/* --- BOUTON DE GÉNÉRATION --- */
.btn-generate {
    margin-top: 2.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.6);
    filter: brightness(1.1);
}

.btn-generate:active {
    transform: translateY(-1px);
}

@keyframes pulse-glow {
    0% { text-shadow: 0 0 5px currentColor; }
    50% { text-shadow: 0 0 15px currentColor; }
    100% { text-shadow: 0 0 5px currentColor; }
}

/* Appliqué via JS quand le score est max */
.souverain-active {
    animation: pulse-glow 2s infinite;
}

