/* ============ DOCS PAGE STYLES ============ */
:root {
  --black: #000000;
  --surface: #0f0f0f;
  --surface-2: #151515;
  --surface-3: #1c1c1c;
  --white: #f5f5f5;
  --white-pure: #ffffff;
  --gray-100: #e8e8e8;
  --gray-200: #d1d1d1;
  --gray-300: #b0b0b0;
  --gray-400: #888888;
  --gray-500: #6b6b6b;
  --gray-600: #4a4a4a;
  --gray-700: #333333;
  --gray-800: #262626;
  --gray-900: #171717;
  --primary: #336aea;
  --primary-hover: #4a7df5;
  --primary-dim: rgba(51, 106, 234, 0.12);
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-thai: 'Kanit', 'Inter', sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --yellow: #eab308;
  --yellow-dim: rgba(234, 179, 8, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.thai { font-family: var(--font-thai); }
img { max-width: 100%; display: block; }

/* ============ LAYOUT ============ */
.docs-layout {
  display: flex;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.docs-sidebar {
  width: 280px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-header img {
  width: 28px; height: 28px;
  border-radius: 6px;
}
.sidebar-header .logo-text {
  font-size: 15px; font-weight: 700;
}
.sidebar-header .logo-text em {
  font-style: normal; color: var(--gray-400); font-weight: 400;
}
.sidebar-header .badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: var(--primary-dim); color: var(--primary);
  margin-left: auto;
}
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gray-500);
  padding: 16px 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--gray-400);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  font-family: var(--font-thai);
}
.nav-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--white);
  text-decoration: none;
}
.nav-link.active {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 500;
}
.nav-link svg {
  width: 16px; height: 16px; flex-shrink: 0;
  opacity: 0.6;
}
.nav-link.active svg { opacity: 1; }
.nav-link .ep-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  background: var(--primary-dim); color: var(--primary);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--gray-600);
}
.sidebar-footer a {
  color: var(--gray-500);
  text-decoration: underline;
}

/* ============ MAIN CONTENT ============ */
.docs-main {
  margin-left: 280px;
  flex: 1;
  min-width: 0;
}
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--gray-500);
}
.topbar-breadcrumb span { color: var(--gray-600); }
.topbar-breadcrumb .current { color: var(--white); font-weight: 500; }
.topbar-actions {
  display: flex; gap: 8px;
}
.topbar-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: none; color: var(--gray-400);
  font-size: 12px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--font-thai);
}
.topbar-btn:hover { border-color: var(--border-hover); color: var(--white); }
.topbar-btn svg { width: 14px; height: 14px; }

.docs-content {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px;
}

/* ============ CONTENT SECTIONS ============ */
.doc-section {
  margin-bottom: 64px;
  scroll-margin-top: 80px;
}
.doc-section h1 {
  font-size: 2rem; font-weight: 700;
  letter-spacing: -1px; margin-bottom: 8px;
  line-height: 1.2;
}
.doc-section .subtitle {
  font-size: 1rem; color: var(--gray-500);
  margin-bottom: 32px; line-height: 1.6;
}
.doc-section h2 {
  font-size: 1.3rem; font-weight: 600;
  letter-spacing: -0.5px;
  margin: 40px 0 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.doc-section h2:first-of-type { margin-top: 0; border-top: none; padding-top: 0; }
.doc-section h3 {
  font-size: 1rem; font-weight: 600;
  margin: 24px 0 10px;
}
.doc-section p {
  color: var(--gray-300);
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 16px;
}
.doc-section ul, .doc-section ol {
  color: var(--gray-300);
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 16px;
  padding-left: 24px;
}
.doc-section li { margin-bottom: 6px; }
.doc-section strong { color: var(--white); }
.doc-section code {
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--gray-200);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}
.step {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.step:hover { border-color: var(--border-hover); }
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary-dim);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.step-body h4 {
  font-size: 0.9rem; font-weight: 600;
  margin-bottom: 4px;
}
.step-body p {
  font-size: 0.82rem; color: var(--gray-500);
  margin-bottom: 0; line-height: 1.6;
}

/* Callout boxes */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 0.85rem;
  line-height: 1.7;
  display: flex;
  gap: 12px;
}
.callout svg {
  width: 18px; height: 18px;
  flex-shrink: 0; margin-top: 2px;
}
.callout.info {
  background: var(--primary-dim);
  border: 1px solid rgba(51, 106, 234, 0.2);
  color: var(--gray-200);
}
.callout.info svg { color: var(--primary); }
.callout.warning {
  background: var(--yellow-dim);
  border: 1px solid rgba(234, 179, 8, 0.2);
  color: var(--gray-200);
}
.callout.warning svg { color: var(--yellow); }
.callout.success {
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--gray-200);
}
.callout.success svg { color: var(--green); }
.callout.danger {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--gray-200);
}
.callout.danger svg { color: var(--red); }

/* ============ PREMIUM VIDEO EMBED ============ */
.video-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, border-color 0.4s ease;
}
.video-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(51,106,234,0.3), rgba(139,92,246,0.2), rgba(236,72,153,0.15), rgba(51,106,234,0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
  pointer-events: none;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px rgba(51,106,234,0.2), 0 8px 24px -8px rgba(0,0,0,0.5);
  border-color: rgba(51,106,234,0.25);
}
.video-card:hover::before {
  opacity: 1;
}
.video-card .video-embed-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  background: linear-gradient(135deg, #0a0a0a 0%, #111 50%, #0a0a0a 100%);
  overflow: hidden;
}
.video-card .video-embed-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-card-info {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, var(--surface), var(--surface-2));
  border-top: 1px solid rgba(255,255,255,0.04);
  position: relative;
  z-index: 2;
}
.video-card-info .ep {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(51,106,234,0.18), rgba(139,92,246,0.15));
  color: #7c9bf7;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.video-card-info .title {
  font-size: 0.88rem; font-weight: 600;
  margin-left: 12px;
  color: var(--gray-200);
}
.video-card-info .duration {
  font-size: 12px; color: var(--gray-500);
  font-weight: 500;
}

/* Placeholder for videos not yet available */
.video-placeholder {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray-500);
}
.video-placeholder svg {
  width: 48px; height: 48px;
  color: var(--gray-600);
}
.video-placeholder p {
  font-size: 0.85rem; color: var(--gray-500);
  margin: 0;
}
.video-card video {
  width: 100%;
  display: block;
  background: var(--black);
  border-radius: 0;
}

/* Table for feature comparison */
.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 20px 0;
  font-size: 0.85rem;
}
.doc-table th {
  background: var(--surface-2);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-300);
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table tr:hover td { background: var(--surface); }

/* Keyboard shortcut */
kbd {
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  color: var(--gray-200);
  font-family: inherit;
}

/* ============ MOBILE SIDEBAR ============ */
.mobile-menu-btn {
  display: none;
  padding: 8px;
  background: none; border: none;
  color: var(--white);
  cursor: pointer;
}
.mobile-menu-btn svg { width: 22px; height: 22px; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 45;
}

@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
    z-index: 55;
  }
  .docs-sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .docs-main { margin-left: 0; }
  .docs-topbar { padding: 0 20px; }
  .docs-content { padding: 28px 20px; }
  .mobile-menu-btn { display: flex; }
  .doc-section h1 { font-size: 1.6rem; }
}
