@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #00897B;
  --primary-dark: #00695C;
  --primary-light: #E0F2F1;
  --secondary: #0D2137;
  --secondary-light: #1A3A5C;
  --accent: #FF6D3A;
  --accent-light: #FFF3E0;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-alt: #F8F9FA;
  --text: #1A1A2E;
  --text-secondary: #5F6368;
  --text-muted: #9AA0A6;
  --border: #DADCE0;
  --border-light: #E8EAED;
  --success: #1E8E3E;
  --warning: #F9AB00;
  --error: #D93025;
  --info: #1A73E8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 300px;
  --topbar-height: 52px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

/* ===== TOP BAR ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--topbar-height);
  background: var(--secondary);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-logo .symbol {
  color: var(--primary);
  font-size: 1.2rem;
}

.topbar-logo .subtitle {
  font-weight: 400;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* ===== LEFT SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--surface-alt);
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  z-index: 100;
  padding: 16px 0;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.sidebar-section-title:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}

.sidebar-section-title.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
  font-weight: 700;
}

.sidebar-section-title .num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-section-title.active .num {
  background: var(--primary);
  color: #fff;
}

/* Sub-items for current page sections */
.sidebar-subs {
  padding: 2px 0 8px;
}

.sidebar-sub {
  display: block;
  padding: 5px 20px 5px 52px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  line-height: 1.5;
}

.sidebar-sub:hover {
  color: var(--primary);
  background: rgba(0, 137, 123, 0.04);
}

.sidebar-sub.active {
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: 12px 20px;
}

/* ===== MAIN CONTENT ===== */
.main {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
}

.content {
  max-width: 100%;
  padding: 40px 56px 80px;
}

/* ===== DOC HEADER ===== */
.doc-header {
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--primary);
}

.doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.doc-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.15;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.doc-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.doc-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.doc-meta span+span::before {
  content: ' · ';
}

/* ===== HEADINGS ===== */
h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 44px 0 16px;
  line-height: 1.25;
  scroll-margin-top: 70px;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 32px 0 14px;
  line-height: 1.3;
  scroll-margin-top: 70px;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
  scroll-margin-top: 70px;
}

h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== TEXT ===== */
p {
  margin-bottom: 14px;
  color: var(--text);
  font-size: 0.95rem;
}

strong {
  font-weight: 600;
}

.lead {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--primary-dark);
  font-size: 1.02rem;
  font-weight: 500;
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.875rem;
}

thead th {
  background: var(--secondary);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

thead th:first-child {
  border-radius: var(--radius) 0 0 0;
}

thead th:last-child {
  border-radius: 0 var(--radius) 0 0;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

tbody tr:hover {
  background: #F8F9FA;
}

tbody tr:last-child td {
  border-bottom: none;
}

td.center,
th.center {
  text-align: center;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}

.card-accent {
  border-left: 4px solid var(--primary);
}

.card-success {
  border-left: 4px solid var(--success);
}

.card-warning {
  border-left: 4px solid var(--warning);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.card-grid .card {
  margin: 0;
}

.card h3 {
  margin-top: 0;
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
}

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== FEATURE LIST ===== */
.feature-list {
  list-style: none;
  margin: 16px 0;
}

.feature-list li {
  padding: 10px 0 10px 32px;
  position: relative;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 10px;
  color: var(--success);
  font-weight: 700;
  font-size: 1rem;
}

.feature-list li:last-child {
  border-bottom: none;
}

/* ===== STEPS ===== */
.steps {
  margin: 20px 0;
}

.step {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.step-num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step-content h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.step-content p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ===== FLOW BLOCKS ===== */
.flow-block {
  background: var(--secondary);
  color: #E0E0E0;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.8;
  overflow-x: auto;
  margin: 16px 0;
  white-space: pre;
}

.flow-block .highlight {
  color: var(--accent);
  font-weight: 600;
}

.flow-block .success {
  color: #4CAF50;
}

.flow-block .info {
  color: #64B5F6;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.badge-accent {
  background: var(--accent-light);
  color: #E65100;
}

.badge-success {
  background: #E8F5E9;
  color: var(--success);
}

.badge-warning {
  background: #FFF8E1;
  color: #F57F17;
}

.badge-error {
  background: #FFEBEE;
  color: var(--error);
}

.badge-info {
  background: #E3F2FD;
  color: var(--info);
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  margin: 24px 0;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.timeline-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== COMPARISON TABLE ===== */
.comparison-table td:first-child {
  font-weight: 600;
}

.check {
  color: var(--success);
  font-weight: 700;
}

.cross {
  color: var(--text-muted);
}

.check-full {
  color: var(--primary);
  font-weight: 700;
}

/* ===== COLOR SWATCHES ===== */
.color-palette {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.swatch {
  width: 80px;
  text-align: center;
}

.swatch-color {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 6px;
  border: 2px solid rgba(0, 0, 0, 0.08);
}

.swatch-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.swatch-hex {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ===== LAUNCH BANNER ===== */
.launch-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 24px 0;
}

.launch-banner h3 {
  color: #fff;
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.launch-banner p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  font-size: 0.88rem;
}

/* ===== PHASE BAR ===== */
.phase-bar {
  display: flex;
  gap: 2px;
  margin: 24px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.phase-seg {
  padding: 10px 8px;
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  text-align: center;
  flex: 1;
}

/* ===== DIVIDER ===== */
hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ===== PAGE NAV ===== */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  transition: all 0.15s;
}

.page-nav a:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== FOOTER ===== */
.doc-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* ===== PRINT ===== */
@media print {

  .topbar,
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    margin-top: 0;
  }

  .content {
    padding: 24px;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .content {
    padding: 24px 20px 48px;
  }
}