/* ============================================================
   Twittner API Docs — "Eclipse" Theme
   ============================================================ */

/* --- Tokens --- */
:root {
  --bg-deep: #06060b;
  --bg-body: #09090f;
  --bg-sidebar: #0b0b12;
  --bg-surface: #101018;
  --bg-surface-alt: #13131d;
  --bg-code: #07070e;
  --bg-input: #0e0e17;

  --accent: #8b5cf6;
  --accent-dim: rgba(139,92,246,.12);
  --accent-glow: rgba(139,92,246,.25);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34,211,238,.10);
  --rose: #f43f5e;
  --rose-dim: rgba(244,63,94,.10);
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36,.10);
  --emerald: #34d399;
  --emerald-dim: rgba(52,211,153,.10);

  --text-primary: #f0f2f5;
  --text-body: #b4bcd0;
  --text-secondary: #717d96;
  --text-muted: #3d4659;
  --text-link: #a78bfa;

  --border: rgba(255,255,255,.06);
  --border-active: rgba(139,92,246,.22);

  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 13px;
  --radius-xl: 18px;

  --sidebar-w: 284px;
  --header-h: 0px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Source Code Pro', 'Fira Code', 'Consolas', monospace;

  --ease: cubic-bezier(.4,0,.2,1);
}

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

::selection { background: rgba(139,92,246,.3); color: #fff; }
::-moz-selection { background: rgba(139,92,246,.3); color: #fff; }

html { font-size: 15px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-body);
  line-height: 1.65;
  overflow-x: hidden;
}

/* subtle radial mesh — depth, not noise */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 30%, rgba(139,92,246,.025) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 85% 75%, rgba(34,211,238,.018) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--text-link); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent); }

img { max-width: 100%; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============================================================
   LAYOUT
   ============================================================ */

.docs-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .35s var(--ease);
}

.sidebar-head {
  padding: 26px 22px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  margin-bottom: 20px;
}

.sidebar-brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: contain;
}

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.3px;
}

.sidebar-brand-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 2px;
}

/* Search */
.sidebar-search {
  position: relative;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 9px 12px 9px 34px;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}

.sidebar-search input::placeholder { color: var(--text-muted); }

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

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

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0 24px;
}

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

.nav-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 22px;
  cursor: pointer;
  user-select: none;
  transition: background .15s var(--ease);
}

.nav-group-head:hover { background: rgba(255,255,255,.02); }

.nav-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex: 1;
}

.nav-group-chevron {
  color: var(--text-muted);
  transition: transform .25s var(--ease);
  flex-shrink: 0;
}

.nav-group.collapsed .nav-group-chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-items { display: none; }

.nav-group-items {
  padding: 2px 0 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 7px 22px 7px 38px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all .15s var(--ease);
  position: relative;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-sans);
}

.nav-item:hover {
  color: var(--text-body);
  background: rgba(255,255,255,.025);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(139,92,246,.06);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2.5px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--cyan));
}

.nav-item-label { flex: 1; text-align: left; }

.nav-item-method {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.method-post { color: var(--accent); background: var(--accent-dim); }
.method-get { color: var(--cyan); background: var(--cyan-dim); }
.method-delete { color: var(--rose); background: var(--rose-dim); }
.method-put { color: var(--amber); background: var(--amber-dim); }

/* Sidebar footer */
.sidebar-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-foot a {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color .2s var(--ease);
}

.sidebar-foot a:hover { color: var(--text-secondary); }

/* --- Main content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
}

.content-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9,9,15,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-trail span { color: var(--text-secondary); }
.breadcrumb-sep { opacity: .35; }

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 8px;
  cursor: pointer;
  transition: all .15s var(--ease);
}

.mobile-toggle:hover { border-color: var(--border-active); color: var(--text-primary); }

.content-body {
  max-width: 880px;
  padding: 40px 48px 80px;
}

/* ============================================================
   ENDPOINT CONTENT RESTYLING
   (targets existing endpoint .phtml markup)
   ============================================================ */

.content__inner {
  color: var(--text-body);
}

.content__inner h1,
.content__inner h2 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.content__inner h1 { font-size: 28px; margin-bottom: 16px; }
.content__inner h2 { font-size: 22px; margin-top: 36px; }

.content__inner h4.table-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 32px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.content__inner p {
  margin-bottom: 14px;
  color: var(--text-body);
  line-height: 1.7;
}

.content__inner p strong {
  color: var(--text-primary);
  font-weight: 600;
}

.content__inner br { display: block; margin: 6px 0; }

/* --- Tables (Parameter docs) --- */
.content__inner .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 13.5px;
}

.content__inner .table thead th {
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.content__inner .table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  vertical-align: top;
}

.content__inner .table tbody tr:last-child td { border-bottom: none; }

.content__inner .table tbody tr:hover {
  background: rgba(255,255,255,.015);
}

.content__inner .table tbody td:first-child {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* Remove default bootstrap border */
.content__inner .table-bordered,
.content__inner .table-bordered th,
.content__inner .table-bordered td {
  border: none !important;
}

.content__inner .table-bordered {
  border: 1px solid var(--border) !important;
}

.content__inner .table-bordered thead th { border-bottom: 1px solid var(--border) !important; }
.content__inner .table-bordered tbody td { border-bottom: 1px solid var(--border) !important; }
.content__inner .table-bordered tbody tr:last-child td { border-bottom: none !important; }

/* --- Code blocks --- */
.content__inner .code-holder {
  margin-bottom: 8px;
}

.content__inner .code-holder-inner {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* accent line atop code block */
.content__inner .code-holder-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  z-index: 1;
}

.content__inner pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-body);
  background: transparent;
  border: none;
  border-radius: 0;
}

.content__inner pre code {
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  padding: 0;
  border: none;
}

/* Copy button (injected by JS) */
.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  z-index: 2;
  transition: all .2s var(--ease);
}

.code-copy-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--text-secondary);
  border-color: var(--border-active);
}

.code-copy-btn.copied {
  color: var(--emerald);
  border-color: rgba(52,211,153,.3);
}

/* --- Highlight.js custom tokens --- */
.hljs { background: transparent; color: var(--text-body); }
.hljs-attr { color: #e2e8f0; font-weight: 500; }
.hljs-string { color: var(--cyan); }
.hljs-number { color: var(--amber); }
.hljs-literal { color: var(--accent); }
.hljs-keyword { color: var(--rose); }
.hljs-built_in { color: var(--emerald); }
.hljs-comment { color: var(--text-muted); font-style: italic; }

/* --- Bootstrap tab override --- */
.tab-navigation,
nav.tab-navigation { margin-bottom: 0; }

.nav-tabs {
  border-bottom: 1px solid var(--border) !important;
  display: flex;
  gap: 0;
  padding: 0 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-x: auto;
}

.nav-tabs .nav-item.nav-link,
.nav-tabs .nav-link {
  background: none !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: .2px;
  padding: 13px 18px !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  transition: all .15s var(--ease);
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: -1px;
}

.nav-tabs .nav-item.nav-link:hover,
.nav-tabs .nav-link:hover {
  color: var(--text-body) !important;
  background: rgba(255,255,255,.02) !important;
}

.nav-tabs .nav-item.nav-link.active,
.nav-tabs .nav-link.active {
  color: var(--text-primary) !important;
  border-bottom-color: var(--accent) !important;
  background: none !important;
}

.tab-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 28px 26px;
  margin-bottom: 8px;
}

.tab-content .tab-pane { color: var(--text-body); }

/* ============================================================
   GET STARTED / HERO
   ============================================================ */

.hero-section {
  margin-bottom: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}

.hero-section h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.8px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  line-height: 1.2;
}

.hero-section .hero-sub {
  font-size: 16.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color .25s var(--ease);
}

.info-card:hover { border-color: var(--border-active); }

.info-card-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.info-card-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  word-break: break-all;
}

.info-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
}

/* Quick example */
.quick-example {
  margin-top: 32px;
}

.quick-example h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.example-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  overflow: hidden;
}

.example-tab {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
  transition: all .15s var(--ease);
}

.example-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,.02); }
.example-tab.active { color: var(--text-primary); background: rgba(139,92,246,.08); }

.example-code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-body);
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
}

/* ============================================================
   OVERLAY (mobile)
   ============================================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 90;
  opacity: 0;
  transition: opacity .3s var(--ease);
}

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

/* ============================================================
   NO RESULTS
   ============================================================ */

.search-empty {
  padding: 20px 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .content-body { padding: 32px 28px 60px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

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

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

  .mobile-toggle { display: flex; }

  .content-header { padding: 0 20px; }

  .content-body {
    padding: 24px 20px 60px;
    max-width: 100%;
  }

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

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

  .content__inner .table { font-size: 12.5px; }
  .content__inner .table thead th { padding: 9px 12px; }
  .content__inner .table tbody td { padding: 10px 12px; }
}

/* ============================================================
   LINK STYLES INSIDE CONTENT
   ============================================================ */

.content__inner a {
  color: var(--text-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(167,139,250,.2);
  transition: all .15s var(--ease);
}

.content__inner a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Status badges for responses */
.status-200 { color: var(--emerald); }
.status-400, .status-402, .status-403 { color: var(--rose); }

/* ============================================================
   ANIMATION
   ============================================================ */

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

.content-body { animation: fadeIn .35s var(--ease); }

/* Nav items filter transition */
.nav-group-items .nav-item {
  transition: opacity .15s, height .15s, padding .15s;
}

.nav-item.hidden-by-search {
  opacity: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.nav-group.hidden-by-search { display: none; }
