/* --- RESET & VARIABLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
:root {
    --bg-dark: #1e1e1e;       
    --header-bg: #2d2d2d;     
    --tab-inactive: #2d2d2d;  
    --tab-active: #1e1e1e;    
    --text-muted: #858585;    
    --accent-green: #4ec9b0;  
    --accent-blue: #569cd6;
}

body {
    background-color: var(--bg-dark);
    font-family: 'Courier New', Courier, monospace; 
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- HEADER STYLE TERMINAL --- */
header {
    background-color: var(--header-bg);
    display: flex;
    align-items: center;
    padding-left: 15px;
    border-bottom: 1px solid #3c3c3c;
    user-select: none;
}


#logo {
    display: flex;
    gap: 8px;
    margin-right: 25px;
    padding: 5px;
    color: var(--accent-green);
}

/* Conteneur des onglets */
.tabs-container {
    display: flex;
    height: 45px;
    align-items: flex-end;
}

/* Style des onglets */
.tab {
    background-color: var(--tab-inactive);
    color: var(--text-muted);
    height: 38px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-right: 1px solid #252526;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.tab:hover {
    background-color: #333333;
    color: #cccccc;
}

.tab.active {
    background-color: var(--tab-active);
    color: var(--accent-green);
    border-top: 2px solid var(--accent-green);
    height: 40px; 
}

.viewport {
    flex-grow: 1;
    position: relative;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 40px;
    color: #d4d4d4;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
}

.button {
  align-items: center;
  background-color: var(--accent-green);
  border: 2px solid #111;
  border-radius: 8px;
  box-sizing: border-box;
  color: #111;
  cursor: pointer;
  display: flex;
  font-family: Inter,sans-serif;
  font-size: 16px;
  height: 48px;
  justify-content: center;
  line-height: 24px;
  max-width: 100%;
  padding: 0 25px;
  position: relative;
  text-align: center;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button:after {
  background-color: var(--text-muted);
  border-radius: 8px;
  content: "";
  display: block;
  height: 48px;
  left: 0;
  width: 100%;
  position: absolute;
  top: -2px;
  transform: translate(8px, 8px);
  transition: transform .2s ease-out;
  z-index: -1;
}

.button:hover:after {
  transform: translate(0, 0);
}

.button:active {
  background-color: var(--accent-green);
  outline: 0;
}

.button:hover {
  outline: 0;
}

.button.entrainement {
    background-color: var(--accent-blue) !important; /* Force l'utilisation du bleu VS Code */
    color: #ffffff;
}

.button.entrainement:hover {
    background-color: #4080b8 !important; /* Une nuance un peu plus sombre au survol */
}

/* --- COMPLEMENTS POUR LE STYLE QUIZ / TERMINAL --- */

/* Appliqué uniquement sur la page de quiz pour pouvoir la centrer */
.quiz-body {
    background-color: var(--bg-dark);
    font-family: 'Courier New', Courier, monospace;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Boîte du terminal centrée */
.terminal-container {
    width: 100%;
    max-width: 650px;
    background-color: #151515; /* Un peu plus sombre que le fond général pour faire ressortir */
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Barre de titre du terminal */
.terminal-bar {
    background-color: var(--header-bg);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2d2d2d;
    user-select: none;
}

.terminal-title {
    color: var(--accent-green);
    font-size: 13px;
}

.terminal-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #333;
    display: inline-block;
}

/* Zone de contenu interne */
.terminal-content {
    padding: 30px;
}

/* Style de la question */
.quiz-question {
    margin-bottom: 30px;
    line-height: 1.6;
}

.quiz-question .question-text {
    color: #ce9178; /* Couleur orange/brun pour les chaînes de caractères */
    font-size: 1.1rem;
}

.quiz-question .keyword {
    color: #569cd6; /* Bleu mot-clé */
}

/* Formulaire & Saisie */
.quiz-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 12px 15px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent-green);
}

.prompt {
    color: var(--accent-green);
    font-weight: bold;
    margin-right: 12px;
    user-select: none;
}

.input-wrapper input {
    background: none;
    border: none;
    outline: none;
    color: #e1e1e1;
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    width: 100%;
}

.input-wrapper input::placeholder {
    color: #555;
}

/* Alignement du bouton de validation */
.btn-submit {
    align-self: flex-start;
    border-radius: 6px;
}
.btn-submit:after {
    border-radius: 6px;
}

/* --- COMPLEMENTS ET AMELIORATIONS DU STYLE QUIZ --- */

/* Bouton de retour en forme de flèche */
.back-arrow {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    transition: color 0.2s;
}

.back-arrow:hover {
    color: var(--accent-green);
}

/* Zone de statistiques dans la barre du terminal */
.terminal-stats {
    display: flex;
    gap: 10px;
}

.stat-badge {
    background-color: #252526;
    color: #cccccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #333;
}

.score-badge {
    color: var(--accent-green);
    border-color: var(--accent-green);
}

/* Boîtes de résultats (Correct / Incorrect) */
.result-box {
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.result-box.correct {
    background-color: rgba(78, 201, 176, 0.1);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.result-box.incorrect {
    background-color: rgba(206, 145, 120, 0.1);
    border: 1px solid #ce9178;
    color: #ce9178;
}

.result-box h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.feedback-text {
    font-size: 15px;
    color: #e1e1e1;
    margin-bottom: 8px;
}

.user-wrong {
    color: #f44336;
    text-decoration: line-through;
    font-weight: bold;
}

.system-correct {
    color: var(--accent-green);
    font-weight: bold;
}

.navigation-area {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;
}

/* Page de fin de quiz */
.text-center {
    text-align: center;
}

.final-title {
    color: var(--accent-green);
    font-size: 28px;
    margin-bottom: 10px;
}

.final-subtitle {
    color: #858585;
    margin-bottom: 30px;
}

.score-display {
    background-color: #0d0d0d;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #333;
    display: inline-block;
    margin-bottom: 40px;
}

.score-label {
    display: block;
    font-size: 14px;
    color: #858585;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.score-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-green);
}

.btn-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px; 
    margin-top: 25px;
    padding-bottom: 20px;
}

.training-helper-box {
    background-color: rgba(86, 156, 214, 0.1);
    border-left: 4px solid var(--accent-blue);
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.training-helper-title {
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 0.85em;
    display: block;
    margin-bottom: 5px;
}

.training-helper-code {
    color: #dcdcdc;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
}

/* Alignement des boutons du formulaire */
.quiz-form .navigation-area {
    gap: 15px;
    margin-top: 10px;
}

/* Variante bleue pour le bouton S'abstenir */
.button.btn-abstain {
    background-color: var(--accent-blue);
}

@media (min-width: 768px) {
  .button {
    padding: 0 40px;
  }
}