/* === Diallog Wiki — Design System === */

:root {
  --bg-deep: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: #161622;
  --bg-hover: #1e1e2e;
  --border: #2a2a3a;
  --border-light: #3a3a4f;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --cyan: #0ea5e9;
  --cyan-dark: #0284c7;
  --cyan-glow: rgba(14,165,233,0.15);
  --red: #ef4444;
  --green: #22c55e;
  --orange: #f59e0b;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
a:hover { color: #38bdf8; }

/* === Layout === */

.app {
  display: block;
  min-height: 100vh;
}

/* Desktop */
.main {
  margin-left: 260px;
  padding: 40px 48px;
  max-width: 1200px;
}

/* Tablette */
@media (min-width: 769px) and (max-width: 1024px) {
  .main { margin-left: 72px; padding: 32px 28px; }
  .sidebar { width: 72px; padding: 16px 8px; }
  .sidebar-header { justify-content: center; padding-bottom: 12px; }
  .sidebar-title, .sidebar-sub, .nav-label { display: none; }
  .nav-link { justify-content: center; padding: 10px; }
  .nav-link span, .nav-link svg + * { display: none; }
  .nav-icon { width: 22px; height: 22px; opacity: 0.8; }
  .mobile-toggle { display: none !important; }
  .overlay { display: none !important; }
}

/* Mobile */
@media (max-width: 768px) {
  .main { margin-left: 0; padding: 72px 20px 40px; max-width: none; }
  .mobile-toggle { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    width: 260px;
    padding: 24px 16px;
  }
  .sidebar.open { transform: translateX(0); }
  .overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
  }
  .overlay.open { display: block; }
  .sidebar-title, .sidebar-sub, .nav-label, .nav-link span { display: inline; }
  .nav-icon { width: 18px; height: 18px; }
}

/* === Sidebar === */

.mobile-toggle {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  cursor: pointer;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--cyan);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.sidebar-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 8px;
}

.nav-list { list-style: none; }

.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--cyan-glow);
  color: var(--cyan);
  font-weight: 500;
}

.nav-icon {
  width: 18px; height: 18px;
  opacity: 0.6;
  flex-shrink: 0;
}

.nav-link.active .nav-icon { opacity: 1; color: var(--cyan); }

/* === Typography === */

h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.3px;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

p {
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}

p strong, li strong {
  color: var(--text-primary);
  font-weight: 600;
}

ul, ol {
  margin-bottom: 16px;
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14.5px;
}

/* === Components === */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

@media (min-width: 769px) and (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.card-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--cyan-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan);
  font-size: 14px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-mono);
}

.badge-cyan { background: var(--cyan-glow); color: var(--cyan); }
.badge-green { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-orange { background: rgba(245,158,11,0.12); color: var(--orange); }
.badge-red { background: rgba(239,68,68,0.12); color: var(--red); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

.info-box {
  background: var(--bg-card);
  border-left: 3px solid var(--cyan);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.info-box.warn {
  border-left-color: var(--orange);
}

.info-box.danger {
  border-left-color: var(--red);
}

.info-box.success {
  border-left-color: var(--green);
}

.info-box-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-box p {
  font-size: 13.5px;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  p { font-size: 15.5px; }
  li { font-size: 14.5px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.25rem; }
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .table-wrap { -webkit-overflow-scrolling: touch; }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  border-radius: 10px;
  overflow: hidden;
}

thead {
  background: var(--bg-surface);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }

tr:hover td { background: var(--bg-hover); }

.code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--cyan);
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  margin: 16px 0;
  color: var(--text-secondary);
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.hero-section {
  margin-bottom: 36px;
}

.hero-section h1 {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
}

.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
}

.toc-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.toc-list { list-style: none; padding-left: 0; }

.toc-list li { margin-bottom: 4px; }

.toc-list a {
  font-size: 13.5px;
  color: var(--text-secondary);
  display: block;
  padding: 3px 0;
}

.toc-list a:hover { color: var(--cyan); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
