:root {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.95);
  --border-color: rgba(226, 232, 240, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-light: #fffbeb;
  --secondary: #6366f1;
  --secondary-light: #eef2ff;
  --accent: #0ea5e9;
  --accent-light: #f0f9ff;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 28px -6px rgba(245, 158, 11, 0.2);
  --transition: all 0.22s ease;
}

[data-theme="dark"] {
  --bg-main: #0c0f1d;
  --bg-surface: #13182c;
  --bg-card: rgba(19, 24, 44, 0.92);
  --border-color: rgba(49, 57, 92, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #fbbf24;
  --primary-hover: #fcd34d;
  --primary-light: rgba(251, 191, 36, 0.15);
  --secondary: #818cf8;
  --secondary-light: rgba(129, 140, 248, 0.15);
  --accent: #38bdf8;
  --accent-light: rgba(56, 189, 248, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 28px -6px rgba(0,0,0,0.6);
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}
.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  transition: var(--transition);
}
.btn-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(-2px);
}
.nav-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}
.nav-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: var(--transition);
}
.theme-btn:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

/* HERO */
.hero {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(99, 102, 241, 0.12) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem 2rem;
}
.hero-container {
  max-width: 1200px;
  margin: 0 auto;
}
.hero-pill {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 820px;
}

/* TABS */
.tabs-nav-wrapper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 57px;
  z-index: 40;
}
.tabs-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-main);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* MAIN */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}
.card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* SIMULATOR STYLES */
.sim-canvas-wrap {
  width: 100%;
  height: 320px;
  background: #020617;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
}

.video-container {
  max-width: 720px;
  margin: 1.25rem auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: #000;
}
.video-container video {
  width: 100%;
  display: block;
}

/* DOC PILL */
.doc-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.92rem;
  transition: var(--transition);
}
.doc-pill:hover {
  border-color: var(--primary);
  transform: translateX(3px);
}
.doc-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.badge-doc { background: #dbeafe; color: #1e40af; }
.badge-pdf { background: #fee2e2; color: #991b1b; }
.badge-ppt { background: #ffedd5; color: #c2410c; }
.badge-media { background: #ede9fe; color: #6d28d9; }

/* DOSSIER & DIDACTIC CONTENT */
.concept-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.concept-header {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
}
details.activity-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  overflow: hidden;
  transition: var(--transition);
}
details.activity-item summary {
  padding: 0.95rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  user-select: none;
}
details.activity-item summary::-webkit-details-marker {
  display: none;
}
details.activity-item summary::after {
  content: "➕";
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}
details.activity-item[open] summary::after {
  content: "➖";
}
details.activity-item[open] summary {
  border-bottom: 1px solid var(--border-color);
  background: var(--primary-light);
  color: var(--primary);
}
details.activity-item .activity-body {
  padding: 1.25rem;
  font-size: 0.94rem;
  line-height: 1.65;
}
.solution-box {
  background: rgba(99, 102, 241, 0.07);
  border: 1px dashed var(--secondary);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.safety-alert {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid #ef4444;
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.25rem;
  margin: 1rem 0;
}

footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}
