:root {
  --bg-dark: #09090b;
  --bg-panel: rgba(24, 24, 27, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --post-color: #10b981;
  --warning-color: #f59e0b;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-width: 280px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.overflow-hidden {
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: rgba(9, 9, 11, 0.98);
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  padding: 2rem 1.2rem;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.logo h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-group {
  margin-bottom: 2rem;
}

.nav-group h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

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

.nav-menu li {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.05);
}

.group-header {
  margin-bottom: 0.5rem;
}

.category-badge {
  font-size: 0.6rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(16, 185, 129, 0.1);
  color: var(--post-color);
}

.category-badge.soon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-color);
}

.nav-group.disabled {
  opacity: 0.6;
}

.nav-link.muted {
  cursor: default;
}

.nav-icon {
  font-style: normal;
  font-size: 1rem;
}

.badge.post.disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.badge.post {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--post-color);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.discord-btn-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #5865F2;
  color: #fff;
  text-decoration: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.2);
}

.discord-btn-sidebar:hover {
  background-color: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(88, 101, 242, 0.3);
}

/* Main Content */
.content-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 3rem 4rem;
  max-width: 1600px; /* เพิ่มจาก 1200px เป็น 1600px */
  width: 100%;
}

.doc-section {
  margin-bottom: 5rem;
  scroll-margin-top: 3rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

p {
  margin-bottom: 1.25rem;
  color: #cbd5e1;
}

/* Tables */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.param-table th, .param-table td {
  text-align: left;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.param-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.param-table td:first-child {
  width: 120px;
}

.param-table td:nth-child(2) {
  width: 80px;
}

.param-table td code {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: monospace;
  color: #a5b4fc;
  font-weight: 600;
}

.auth-requirement {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: 6px 14px;
  border-radius: 30px;
  font-weight: 500;
  margin-top: 1rem;
}

.auth-requirement strong {
  color: #fff;
  background: rgba(245, 158, 11, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 2px;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(16px);
}

.info-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent-blue);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin-top: 1.5rem;
  color: #eff6ff;
  font-family: monospace;
  font-size: 0.95rem;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 3rem 0;
}

.action-box {
  background: rgba(88, 101, 242, 0.05);
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.action-box p {
  margin-bottom: 0;
  font-weight: 500;
}

.discord-btn-main {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #5865F2;
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.3);
}

.discord-btn-main:hover {
  background-color: #4752c4;
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(88, 101, 242, 0.4);
}

/* Endpoints */
.endpoint-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1.5rem;
}

.endpoint-header h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.badge.post-large {
  background-color: var(--post-color);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
}

/* Grids */
.grid-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  margin-top: 2.5rem;
  align-items: start;
}

/* Code Windows */
.code-window {
  background: #1e2227;
  border-radius: 8px;
  border: 1px solid #333;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.window-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #333;
}

.window-title {
  color: #888;
  font-size: 0.75rem;
  margin-left: 8px;
  font-family: monospace;
}

.code-window pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
}

.code-window code {
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Tabs */
.request-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 900;
  padding: 0 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-icon.small {
  width: 28px; height: 28px;
}

.menu-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Responsiveness */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .mobile-nav {
    display: flex;
  }
  
  .content-area {
    margin-left: 0;
    padding: 6rem 1.5rem 2rem;
    width: 100%;
  }
  
  .grid-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .section-header { text-align: center; }
  .endpoint-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  
  .code-window { border-radius: 0; margin-left: -1.5rem; margin-right: -1.5rem; border-left: none; border-right: none; }
  
  .doc-footer { flex-direction: column; gap: 1rem; text-align: center; }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
