/* ==========================================
   Wander Movie Critic — API Dokumentácia
   Dark theme, 3-column layout
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0D0D0D;
  --surface: #1A1A1A;
  --surface-2: #222222;
  --code-bg: #141414;
  --border: #2A2A2A;
  --text: #E5E5E5;
  --text-muted: #888888;
  --text-dim: #666666;
  --accent: #EB002F;
  --accent-hover: #FF1744;
  --green: #4CAF50;
  --blue: #42A5F5;
  --orange: #FF9800;
  --yellow: #FDD835;
  --purple: #AB47BC;

  --sidebar-w: 260px;
  --code-panel-w: 420px;
  --font-sans: 'Montserrat', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* ==========================================
   Top Header
   ========================================== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 100;
  gap: 16px;
}

.top-header .logo {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  color: var(--text);
}

.top-header .logo span {
  color: var(--accent);
}

.top-header .badge {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.top-header .spacer { flex: 1; }

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - 56px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 90;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

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

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 24px;
  margin-bottom: 8px;
}

.nav-link {
  display: block;
  padding: 6px 24px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(235,0,47,0.05);
}

.nav-link .method {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  display: inline-block;
  width: 36px;
  margin-right: 6px;
}

.method-get { color: var(--green); }
.method-post { color: var(--blue); }
.method-put { color: var(--orange); }
.method-delete { color: var(--accent); }

/* ==========================================
   Main Layout (content + code panel)
   ========================================== */
.main {
  margin-left: var(--sidebar-w);
  margin-top: 56px;
  display: flex;
  min-height: calc(100vh - 56px);
}

.content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px;
  max-width: 720px;
}

.code-panel {
  width: var(--code-panel-w);
  background: var(--code-bg);
  border-left: 1px solid var(--border);
  padding: 40px 24px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.code-panel::-webkit-scrollbar { width: 4px; }
.code-panel::-webkit-scrollbar-track { background: transparent; }
.code-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ==========================================
   Content Typography
   ========================================== */
.section {
  margin-bottom: 64px;
  scroll-margin-top: 80px;
}

.section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.section h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

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

.section ul, .section ol {
  color: var(--text-muted);
  padding-left: 20px;
  margin-bottom: 16px;
}

.section li { margin-bottom: 6px; }

code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent);
}

/* ==========================================
   Endpoint Block
   ========================================== */
.endpoint {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.endpoint:last-child { border-bottom: none; }

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.endpoint-method {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}

.endpoint-method.get { background: rgba(76,175,80,0.15); color: var(--green); }
.endpoint-method.post { background: rgba(66,165,245,0.15); color: var(--blue); }
.endpoint-method.put { background: rgba(255,152,0,0.15); color: var(--orange); }
.endpoint-method.delete { background: rgba(235,0,47,0.15); color: var(--accent); }

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

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

/* ==========================================
   Params Table
   ========================================== */
.params-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}

.params-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.params-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.params-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.param-required {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}

.param-optional {
  font-size: 10px;
  color: var(--text-dim);
}

/* ==========================================
   Code Examples (right panel)
   ========================================== */
.code-example {
  margin-bottom: 32px;
}

.code-example-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.code-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}

.code-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 4px 4px 0 0;
}

.code-tab:hover { color: var(--text); }

.code-tab.active {
  background: var(--surface-2);
  color: var(--accent);
  border-color: var(--border);
}

.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 4px;
  padding: 16px;
  overflow-x: auto;
  position: relative;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 8px;
  background: var(--border);
  border: none;
  border-radius: 3px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.code-block .copy-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Response example */
.response-example {
  margin-top: 16px;
}

.response-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

.status-200 { background: rgba(76,175,80,0.15); color: var(--green); }
.status-400 { background: rgba(255,152,0,0.15); color: var(--orange); }
.status-401 { background: rgba(235,0,47,0.15); color: var(--accent); }
.status-404 { background: rgba(136,136,136,0.15); color: var(--text-muted); }
.status-429 { background: rgba(255,152,0,0.15); color: var(--orange); }

/* ==========================================
   Schema / Model
   ========================================== */
.schema-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.schema-field {
  display: flex;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.schema-field:last-child { border-bottom: none; }

.schema-field-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  min-width: 180px;
}

.schema-field-type {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--purple);
  min-width: 80px;
}

.schema-field-desc {
  color: var(--text-muted);
  font-size: 12px;
}

/* ==========================================
   Error codes table
   ========================================== */
.error-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.error-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}

.error-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.error-table td:first-child {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ==========================================
   Intro hero
   ========================================== */
.intro-hero {
  background: linear-gradient(135deg, rgba(235,0,47,0.08) 0%, transparent 60%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
  margin-bottom: 32px;
}

.intro-hero h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.intro-hero h1 span { color: var(--accent); }

.intro-hero p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
}

.base-url-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1200px) {
  .code-panel {
    display: none;
  }
  .content {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
  }
  .content {
    padding: 24px 20px;
  }
  .hamburger {
    display: block;
  }
  .code-panel {
    display: none;
  }
  .endpoint-header {
    flex-wrap: wrap;
  }
  .endpoint-path {
    font-size: 12px;
  }

  /* Inline code examples na mobile */
  .mobile-code {
    display: block;
    margin-top: 16px;
  }
}

@media (min-width: 769px) {
  .mobile-code {
    display: none;
  }
}
