/* ===== e-Boost Realm Documentation - Pioneer eMobility Branding ===== */
/* Inspired by Twilio Docs layout */

:root {
  --primary-dark: #011A2E;
  --primary-dark-hover: #01263F;
  --accent-red: #C1273B;
  --accent-red-hover: #A82132;
  --light-bg: #F1F6F6;
  --white: #FFFFFF;
  --text-dark: #011D26;
  --text-secondary: #41565C;
  --text-muted: #7D8BA1;
  --blue-link: #0B4776;
  --border-color: #E1E3EA;
  --sidebar-width: 280px;
  --header-height: 60px;
  --code-bg: #F4F5F7;
  --success-green: #2E7D32;
  --warning-amber: #F57F17;
  --info-blue: #1565C0;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  border-bottom: 2px solid var(--accent-red);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  flex-shrink: 0;
}

.header-logo img {
  height: 28px;
  width: auto;
}

.header-logo .logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

.header-logo .logo-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.3);
  margin: 0 8px;
}

.header-logo .logo-docs {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.95rem;
  opacity: 0.8;
}

.header-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 20px;
}

.header-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--white);
}

.header-nav .app-link {
  background: var(--accent-red);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 4px;
  font-weight: 600;
  transition: background 0.2s;
}

.header-nav .app-link:hover {
  background: var(--accent-red-hover);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

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

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 24px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--text-dark);
  background: var(--light-bg);
}

.sidebar-link.active {
  color: var(--accent-red);
  background: rgba(193, 39, 59, 0.06);
  border-left-color: var(--accent-red);
  font-weight: 600;
}

.sidebar-link .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-link .nav-label {
  flex: 1;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--blue-link);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .sep {
  color: var(--border-color);
}

/* ===== Page Title ===== */
.page-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ===== Typography ===== */
h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 32px;
  margin-bottom: 12px;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 24px;
  margin-bottom: 8px;
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--blue-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Tables ===== */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.875rem;
}

.doc-table thead {
  background: var(--primary-dark);
  color: var(--white);
}

.doc-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doc-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: top;
}

.doc-table tbody tr:hover {
  background: var(--light-bg);
}

.doc-table code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8125rem;
  color: var(--accent-red);
}

/* ===== Code Blocks ===== */
code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.875em;
  color: var(--accent-red);
}

pre {
  background: var(--primary-dark);
  color: #E0E0E0;
  padding: 20px 24px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0 24px;
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ===== Screenshots ===== */
.screenshot-container {
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.screenshot-container img {
  width: 100%;
  display: block;
}

.screenshot-caption {
  background: var(--light-bg);
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* ===== Info Boxes / Callouts ===== */
.callout {
  padding: 16px 20px;
  border-radius: 6px;
  margin: 20px 0;
  font-size: 0.875rem;
  border-left: 4px solid;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout.info {
  background: #E3F2FD;
  border-color: var(--info-blue);
  color: #0D47A1;
}

.callout.warning {
  background: #FFF8E1;
  border-color: var(--warning-amber);
  color: #E65100;
}

.callout.success {
  background: #E8F5E9;
  border-color: var(--success-green);
  color: #1B5E20;
}

.callout.tip {
  background: rgba(193, 39, 59, 0.06);
  border-color: var(--accent-red);
  color: var(--text-dark);
}

/* ===== Cards Grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.doc-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.doc-card:hover {
  border-color: var(--accent-red);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-decoration: none;
  transform: translateY(-2px);
}

.doc-card .card-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.doc-card .card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.doc-card .card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Status Badges ===== */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: #E8F5E9; color: #2E7D32; }
.badge-red { background: #FFEBEE; color: #C62828; }
.badge-blue { background: #E3F2FD; color: #1565C0; }
.badge-gray { background: #F4F5F7; color: #666; }

/* ===== Footer ===== */
.site-footer {
  margin-left: var(--sidebar-width);
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 32px 48px;
  font-size: 0.8125rem;
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-updated {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

.footer-content a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}

.footer-content a:hover {
  color: var(--white);
}

/* ===== Page Navigation (Prev/Next) ===== */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  gap: 16px;
}

.page-nav a {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
  min-width: 180px;
}

.page-nav a:hover {
  border-color: var(--accent-red);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.page-nav .nav-direction {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.page-nav .nav-title {
  font-weight: 600;
  color: var(--primary-dark);
}

.page-nav .next {
  text-align: right;
  margin-left: auto;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .content-wrapper {
    padding: 32px 32px 64px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

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

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  }

  .main-content {
    margin-left: 0;
  }

  .site-footer {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 24px 20px 64px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .page-nav {
    flex-direction: column;
  }

  .page-nav .next {
    text-align: left;
  }

  .header-nav .nav-links {
    display: none;
  }
}

/* ===== Sidebar overlay for mobile ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 850;
}

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

/* ===== URL Pattern Box ===== */
.url-pattern {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0 20px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.url-pattern .param {
  color: var(--accent-red);
  font-weight: 600;
}
