/* AI Outbound OS — Documentation & Helpdesk Portal Theme */
:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #161f30;
  --bg-hover: #1f2d45;
  --border-color: #243248;
  --border-subtle: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --info: #0ea5e9;
  --info-bg: rgba(14, 165, 233, 0.1);
  --code-bg: #0d121f;
  --sidebar-width: 290px;
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.version-pill {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-weight: 600;
}

.header-search {
  position: relative;
  width: 380px;
  max-width: 100%;
}

.header-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.header-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

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

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background: var(--bg-hover);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* Layout */
.layout-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  position: fixed;
  top: var(--header-height);
  left: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 20px 14px 40px;
  z-index: 40;
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 10px 8px;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  color: #fff;
  background: var(--bg-hover);
}

.sidebar-link.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.15);
  border-left: 3px solid var(--accent-primary);
}

.sidebar-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.sidebar-link.active svg {
  color: var(--accent-primary);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 40px 48px 80px;
  max-width: 1080px;
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  padding: 32px 36px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.hero-banner h1 {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.hero-banner p {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 800px;
  margin-bottom: 20px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Sections */
.doc-section {
  margin-bottom: 60px;
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.section-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  color: #f1f5f9;
  margin: 28px 0 12px;
}

h4 {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  margin: 18px 0 8px;
}

p {
  margin-bottom: 16px;
  color: #cbd5e1;
}

ul, ol {
  margin: 0 0 18px 24px;
  color: #cbd5e1;
}

li {
  margin-bottom: 6px;
}

/* Code Blocks */
.code-container {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 16px 0 24px;
  position: relative;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #090d16;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.copy-btn:hover {
  color: #fff;
  background: var(--bg-hover);
  border-color: #475569;
}

pre {
  padding: 14px 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #93c5fd;
}

pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Callouts / Alerts */
.callout {
  padding: 16px 18px;
  border-radius: 8px;
  margin: 18px 0 22px;
  border-left: 4px solid;
  font-size: 14px;
}

.callout-info {
  background: var(--info-bg);
  border-color: var(--info);
  color: #bae6fd;
}

.callout-success {
  background: var(--success-bg);
  border-color: var(--success);
  color: #a7f3d0;
}

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning);
  color: #fde68a;
}

.callout-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #fecaca;
}

.callout strong {
  color: #fff;
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

/* Cards & Grid */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin: 20px 0 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}

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

.card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 18px 0 26px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

th {
  background: var(--bg-secondary);
  color: #e2e8f0;
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #f1f5f9;
}

/* Accordion / FAQ */
.faq-item {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-icon {
  transition: transform 0.2s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  color: var(--text-secondary);
  font-size: 14px;
}

.faq-item.open .faq-answer {
  padding: 0 20px 20px;
  max-height: 2000px;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
}

.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-indigo { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

/* Responsive Mobile */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
}

@media (max-width: 900px) {
  .mobile-toggle {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 24px 20px;
  }
  .header-search {
    display: none;
  }
}

