/* QuizVerse Documentation Portal Stylesheet - Envato Marketplace Guide */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;

  /* High contrast indigo / blue palette for maximum legibility */
  --primary: #3730a3;
  --primary-hover: #1e1b4b;
  --primary-light: #e0e7ff;
  --primary-border: #a5b4fc;

  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-code: #0f172a;
  --bg-code-header: #1e293b;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --text-code: #f8fafc;

  --border-color: #cbd5e1;
  --border-dark: #94a3b8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --header-height: 64px;
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  font-size: 15px;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

/* Links */
a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

a:hover {
  color: #1e40af;
  text-decoration: underline;
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-main);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  color: #312e81;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-tag {
  font-size: 11px;
  font-weight: 700;
  background: #e0e7ff;
  color: #312e81;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #a5b4fc;
}

.search-container {
  position: relative;
  width: 320px;
}

.search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-main);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  color: #0f172a;
}

.search-input:focus {
  border-color: #4338ca;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15);
}

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

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

.header-link {
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: color 0.2s ease;
}

.header-link:hover {
  color: #312e81;
  text-decoration: none;
}

.btn-primary {
  background: #4338ca;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-primary:hover {
  background: #312e81;
  color: #ffffff;
  text-decoration: none;
}

/* Layout Container */
.layout-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding: 24px 16px;
  z-index: 40;
  transition: transform 0.3s ease;
}

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

.nav-group-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  margin-bottom: 10px;
  padding-left: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.nav-bullet {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64748b;
  margin-right: 4px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.nav-item:hover {
  background: #e0e7ff;
  color: #1e1b4b;
  text-decoration: none;
}

.nav-item:hover .nav-bullet,
.nav-item.active .nav-bullet {
  background: #4338ca;
}

.nav-item.active {
  background: #e0e7ff;
  color: #1e1b4b;
  font-weight: 700;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: 1100px;
  min-width: 0;
  box-sizing: border-box;
  padding: 40px 48px 80px;
  overflow-x: hidden;
}

/* Hero Section */
.hero-banner {
  background: #eef2ff;
  color: #0f172a;
  border: 2px solid #c7d2fe;
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  box-sizing: border-box;
}

.hero-banner h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
  color: #1e1b4b;
}

.hero-banner p {
  font-size: 16px;
  color: #334155;
  font-weight: 500;
  max-width: 680px;
}

.quick-stats {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.stat-chip {
  background: #ffffff;
  border: 1px solid #c7d2fe;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 700;
  color: #3730a3;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Section Styling */
.doc-section {
  margin-bottom: 60px;
  scroll-margin-top: 80px;
}

.doc-section h2 {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e1b4b;
  margin: 28px 0 12px;
}

.doc-section p {
  color: #334155;
  margin-bottom: 16px;
}

.doc-section ul, .doc-section ol {
  color: #334155;
  margin-bottom: 16px;
  padding-left: 24px;
}

.doc-section li {
  margin-bottom: 8px;
}

/* Step Cards & Screenshots */
.step-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.step-image-container {
  margin-top: 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  background: #f8fafc;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: block;
}

.doc-screenshot {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-sizing: border-box;
}

.step-number {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: #4338ca;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.step-body {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.step-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

/* HIGH-CONTRAST CALLOUT BOXES */
.callout {
  padding: 18px 22px;
  border-radius: 12px;
  margin: 22px 0;
  border-left: 5px solid;
  font-size: 14.5px;
  line-height: 1.6;
}

.callout-title {
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

/* Blue / Sky Callout - 100% WCAG AAA Legibility */
.callout-note {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0c4a6e;
}
.callout-note .callout-title {
  color: #0369a1;
}

.callout-tip {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #14532d;
}
.callout-tip .callout-title {
  color: #15803d;
}

.callout-warning {
  background: #fffbeb;
  border-color: #d97706;
  color: #78350f;
}
.callout-warning .callout-title {
  color: #b45309;
}

.callout-important {
  background: #fef2f2;
  border-color: #dc2626;
  color: #7f1d1d;
}
.callout-important .callout-title {
  color: #b91c1c;
}

/* Code Blocks */
.code-block-container {
  background: var(--bg-code);
  border-radius: 12px;
  overflow: hidden;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid #1e293b;
}

.code-header {
  background: var(--bg-code-header);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.copy-btn.copied {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

pre {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-code);
}

/* HIGH-CONTRAST INLINE CODE TAGS */
:not(pre) > code {
  background: #e2e8f0;
  color: #1e1b4b;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid #cbd5e1;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  text-align: left;
  font-size: 14px;
}

th, td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #f1f5f9;
  font-weight: 800;
  color: #0f172a;
}

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

/* Accordion FAQ */
.accordion-item {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-header {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  user-select: none;
}

.accordion-header:hover {
  background: #f8fafc;
}

.accordion-content {
  padding: 0 20px 16px;
  display: none;
  color: #334155;
  font-size: 14px;
}

.accordion-item.open .accordion-content {
  display: block;
}

.accordion-icon {
  transition: transform 0.2s ease;
  color: #475569;
}

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

/* Overlay for Mobile Drawer */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 35;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex;
  }

  .search-container {
    width: 200px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .drawer-backdrop.active {
    display: block;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 24px 16px 60px !important;
    box-sizing: border-box !important;
  }

  .hero-banner {
    padding: 28px 20px;
  }

  .hero-banner h1 {
    font-size: 26px;
  }
}

@media (max-width: 640px) {
  .header-links {
    display: none;
  }
  .search-container {
    width: 150px;
  }
  .step-card {
    flex-direction: column;
    gap: 12px;
  }
}
