/* ==========================================================================
   WinCLI Simulator — Design System & Fluent Dark Acrylic Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-app: #090d16;
  --bg-surface: rgba(18, 24, 38, 0.85);
  --bg-card: rgba(26, 34, 52, 0.7);
  --bg-card-hover: rgba(35, 46, 70, 0.85);
  --bg-terminal: #0b0f19;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 210, 255, 0.35);
  --border-active: #00d2ff;

  --accent-cyan: #00d2ff;
  --accent-blue: #388bfd;
  --accent-green: #2ea043;
  --accent-green-bright: #3fb950;
  --accent-yellow: #d29922;
  --accent-red: #f85149;
  --accent-purple: #a371f7;

  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-terminal: #cccccc;
  --text-cmd-prompt: #f0f6fc;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-window: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 20px rgba(0, 210, 255, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-app);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 210, 255, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(163, 113, 247, 0.05) 0%, transparent 40%);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* --- BARRE D'EN-TÊTE DE L'APPLICATION --- */
.app-header {
  height: 52px;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #0078d4, #00d2ff);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
  padding-left: 8px;
  border-left: 1px solid var(--border-subtle);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-header {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-header:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

.btn-header.muted {
  opacity: 0.6;
}

.btn-header.danger:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* --- STRUCTURE PRINCIPALE TRIPLE COLONNES --- */
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 360px 1fr 340px;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 52px);
  overflow: hidden;
}

/* --- PANNEAU GAUCHE : MISSIONS & PALIERS --- */
.sidebar-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-window);
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Barre de progression globale */
.progress-section {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-subtle);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green-bright));
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Onglets Paliers */
.palier-tabs {
  display: flex;
  padding: 8px 12px;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-subtle);
}

.palier-tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.palier-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.palier-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  border-color: rgba(0, 210, 255, 0.3);
}

.missions-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.palier-header {
  margin-bottom: 14px;
}

.palier-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 210, 255, 0.12);
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.palier-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.palier-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Cartes d'étapes */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  transition: all 0.25s ease;
}

.step-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
}

.step-card.done {
  border-color: rgba(46, 160, 67, 0.35);
  background: rgba(46, 160, 67, 0.08);
}

.step-status {
  font-size: 14px;
  margin-top: 1px;
}

.step-content {
  flex: 1;
}

.step-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}

.step-card.done .step-name {
  color: var(--accent-green-bright);
}

.step-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.step-desc code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.step-hint {
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--accent-yellow);
  background: rgba(210, 153, 34, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

/* --- PANNEAU CENTRAL : FENÊTRE TERMINAL CMD --- */
.terminal-window {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-window);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Titre de la fenêtre Terminal Windows 11 */
.terminal-titlebar {
  height: 40px;
  background: #181d28;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.terminal-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.terminal-tab {
  background: var(--bg-terminal);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  padding: 6px 14px;
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.terminal-tab-icon {
  width: 14px;
  height: 14px;
  background: #000;
  border: 1px solid #333;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 6px;
}

.window-btn {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.window-btn.minimize { background: #febc2e; }
.window-btn.maximize { background: #28c840; }
.window-btn.close { background: #ff5f56; }
.window-btn:hover { opacity: 0.8; }

/* Écran du terminal */
.terminal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-terminal);
  cursor: text;
}

.terminal-screen {
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-line {
  margin-bottom: 2px;
}

.line-normal { color: #cccccc; }
.line-error { color: #ff6b6b; }
.line-success { color: #51cf66; font-weight: 600; }
.line-info { color: #339af0; }
.command-echo { color: #ffffff; font-weight: 600; }

/* Ligne d'invite active */
.terminal-prompt-line {
  display: flex;
  align-items: center;
  margin-top: 4px;
  gap: 8px;
}

.prompt-label {
  color: #ffffff;
  font-weight: 600;
  flex-shrink: 0;
}

.command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #00d2ff;
  font-weight: 600;
  caret-color: #00d2ff;
  padding: 0;
  margin: 0;
}

/* --- PANNEAU DROIT : INSPECTEUR VFS & ANTISÈCHE --- */
.inspect-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-window);
}

.nav-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.nav-tab-btn {
  flex: 1;
  padding: 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--text-main);
}

.nav-tab-btn.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.04);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.tab-panel {
  display: none;
  padding: 14px;
  height: 100%;
  overflow-y: auto;
}

.tab-panel.active {
  display: block;
}

/* Arborescence VFS */
.vfs-container {
  font-family: var(--font-mono);
  font-size: 12px;
}

.vfs-node {
  margin: 2px 0;
}

.vfs-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.vfs-label:hover {
  background: rgba(255, 255, 255, 0.05);
}

.vfs-label.is-cwd {
  background: rgba(0, 210, 255, 0.12);
  border-left: 2px solid var(--accent-cyan);
}

.vfs-children {
  padding-left: 18px;
  border-left: 1px dashed rgba(255, 255, 255, 0.1);
  margin-left: 8px;
}

.vfs-tag {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.tag-hidden { background: rgba(248, 81, 73, 0.2); color: var(--accent-red); }
.tag-cwd { background: rgba(0, 210, 255, 0.2); color: var(--accent-cyan); }

/* Antisèche */
.cheat-search-box {
  margin-bottom: 12px;
}

.cheat-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 12px;
  outline: none;
}

.cheat-input:focus {
  border-color: var(--accent-cyan);
}

.cheat-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cheat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.cheat-cmd {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

.cheat-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.cheat-example {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #adb5bd;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
