/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   EveryHR API Documentation - Stylesheet
   Based on blueprint: EveryHR-API-Docs.html
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --iris-blue: #003087;
  --iris-mid: #0050C8;
  --iris-light: #E8F0FF;
  --accent: #00A3E0;
  --accent-green: #00875A;
  --accent-orange: #FF8B00;
  --accent-red: #DE350B;
  --accent-purple: #6554C0;
  --text-primary: #172B4D;
  --text-secondary: #5E6C84;
  --text-muted: #8993A4;
  --bg-main: #F4F5F7;
  --bg-card: #FFFFFF;
  --bg-code: #1E2A3A;
  --border: #DFE1E6;
  --border-light: #EBECF0;
  --sidebar-width: 280px;
  --header-height: 56px;
  --get-color: #0052CC;
  --post-color: #00875A;
  --put-color: #FF8B00;
  --delete-color: #DE350B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ── TOP HEADER ── */
.header {
  height: var(--header-height);
  background: var(--iris-blue);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 3px solid var(--accent);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.header-logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white;
}

.header-logo-text {
  color: white; font-weight: 700; font-size: 16px; letter-spacing: -0.3px;
}

.header-logo-text span { color: var(--accent); font-weight: 300; }

.header-nav {
  display: flex; align-items: center; gap: 6px; margin-left: 40px;
}

.header-nav a {
  color: rgba(255,255,255,0.75); text-decoration: none;
  font-size: 13px; padding: 5px 12px; border-radius: 4px;
  transition: all .15s; cursor: pointer;
}

.header-nav a:hover { color: white; background: rgba(255,255,255,0.1); }
.header-nav a.active { color: white; background: rgba(255,255,255,0.15); }

.header-search {
  margin-left: auto; margin-right: 16px;
}

.header-search input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  color: white;
  font-size: 13px;
  padding: 6px 14px;
  width: 220px;
  outline: none;
  transition: all .2s;
  font-family: inherit;
}

.header-search input::placeholder { color: rgba(255,255,255,0.4); }
.header-search input:focus {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent);
  width: 280px;
}

.header-version {
  color: rgba(255,255,255,0.5); font-size: 12px;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 12px;
  padding: 2px 10px;
}

/* ── LAYOUT ── */
.layout {
  display: flex;
  padding-top: var(--header-height);
  height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--header-height);
  bottom: 0;
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-section { padding: 0; }

.sidebar-section-header {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 16px 16px 6px;
}

.sidebar-group { margin-bottom: 2px; }

.sidebar-group-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 16px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; user-select: none;
  border-radius: 4px; margin: 0 4px;
  transition: all .12s;
}

.sidebar-group-title:hover { background: var(--bg-main); color: var(--text-primary); }
.sidebar-group-title.active-group { color: var(--iris-mid); }

.sidebar-group-title .chevron {
  font-size: 10px; transition: transform .2s; color: var(--text-muted);
}

.sidebar-group-title.collapsed .chevron { transform: rotate(-90deg); }

.sidebar-group-items { padding: 0 4px 4px; }

.sidebar-group-items.hidden { display: none; }

.sidebar-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; border-radius: 4px;
  transition: all .12s; text-decoration: none;
}

.sidebar-item:hover { background: var(--iris-light); color: var(--iris-mid); }

.sidebar-item.active {
  background: var(--iris-light); color: var(--iris-mid); font-weight: 500;
  border-left: 3px solid var(--iris-mid); margin-left: -1px;
}

.method-badge {
  font-size: 10px; font-weight: 700; padding: 1px 5px;
  border-radius: 3px; font-family: 'JetBrains Mono', monospace;
  min-width: 36px; text-align: center; flex-shrink: 0;
}

.badge-get { background: #E6F0FF; color: var(--get-color); }
.badge-post { background: #E3FCEF; color: var(--post-color); }
.badge-put { background: #FFF0D9; color: var(--put-color); }
.badge-delete { background: #FFEBE6; color: var(--delete-color); }

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
}

/* ── LOADING STATE ── */
.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px;
  color: var(--text-muted);
}

.page-loading.hidden { display: none; }

.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--iris-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── GUIDE PAGE ── */
.guide-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 48px;
}

.guide-page h1 {
  font-size: 28px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.5px; margin-bottom: 8px;
}

.guide-page .guide-subtitle {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 32px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}

.guide-page h2 {
  font-size: 18px; font-weight: 700; margin: 32px 0 12px;
  color: var(--text-primary);
}

.guide-page h3 {
  font-size: 15px; font-weight: 600; margin: 24px 0 8px; color: var(--text-primary);
}

.guide-page p { color: var(--text-secondary); margin-bottom: 12px; line-height: 1.7; }

.guide-page ul, .guide-page ol {
  color: var(--text-secondary); padding-left: 20px; margin-bottom: 12px;
}

.guide-page li { margin-bottom: 6px; line-height: 1.6; }
.guide-page a { color: var(--iris-mid); text-decoration: none; cursor: pointer; }
.guide-page a:hover { text-decoration: underline; }

.guide-page code {
  background: var(--bg-code); color: #7EC8E3;
  padding: 2px 6px; border-radius: 3px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}

/* ── CALLOUT ── */
.callout {
  background: var(--iris-light); border-left: 4px solid var(--iris-mid);
  padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 20px 0;
}

.callout p { margin: 0; color: var(--iris-mid); }
.callout strong { color: var(--iris-blue); }

/* ── INFO GRID ── */
.info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0;
}

.info-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px;
}

.info-card h4 {
  font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px;
}

.info-card p { font-size: 13px; color: var(--text-secondary); margin: 0; }

/* ── STEP LIST ── */
.step-list { list-style: none; padding: 0; }

.step-list li {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 16px;
}

.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--iris-blue); color: white;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}

.step-content { flex: 1; }
.step-content strong { font-size: 14px; color: var(--text-primary); display: block; margin-bottom: 4px; }
.step-content span { font-size: 13px; color: var(--text-secondary); }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--iris-blue) 0%, #0041A8 100%);
  padding: 48px; color: white; border-radius: 0;
}

.hero h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.7px; margin-bottom: 12px;
}

.hero p { opacity: 0.8; font-size: 15px; max-width: 520px; line-height: 1.7; }

.hero-tags { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.hero-tag {
  background: rgba(255,255,255,0.15); color: white;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 4px 12px; border-radius: 20px; font-size: 12px;
}

/* ── OPERATION PAGE ── */
.op-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 48px;
}

.op-breadcrumb {
  font-size: 12px; color: var(--text-muted); margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}

.op-breadcrumb a { color: var(--iris-mid); text-decoration: none; cursor: pointer; }

.op-title-row {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}

.op-title { font-size: 26px; font-weight: 700; letter-spacing: -0.4px; }

.op-description {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 28px;
  max-width: 620px; line-height: 1.7;
}

/* ── ENDPOINT BAR ── */
.endpoint-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-code); border-radius: 8px;
  overflow: hidden; margin-bottom: 32px; font-family: 'JetBrains Mono', monospace;
}

.endpoint-method {
  font-size: 13px; font-weight: 700; padding: 12px 18px;
  color: white; flex-shrink: 0;
}

.method-get { background: var(--get-color); }
.method-post { background: var(--post-color); }
.method-put { background: var(--put-color); }
.method-delete { background: var(--delete-color); }

.endpoint-url {
  font-size: 13px; color: #A8D8EA; padding: 12px 18px; flex: 1;
}

.endpoint-url .path-param { color: #FFD580; }

/* ── SECTION TITLE ── */
.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-muted); margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}

/* ── PARAMS TABLE ── */
.params-table {
  width: 100%; border-collapse: collapse; margin-bottom: 32px;
  font-size: 13px;
}

.params-table th {
  text-align: left; padding: 8px 12px;
  background: var(--bg-main); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary); border-bottom: 2px solid var(--border);
}

.params-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.params-table tr:last-child td { border-bottom: none; }

.param-name {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--text-primary); font-weight: 500;
}

.param-required {
  font-size: 10px; color: var(--accent-red); font-weight: 700;
  margin-left: 4px;
}

.param-type {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--accent-purple); background: #F0EDFF;
  padding: 1px 6px; border-radius: 3px;
}

.param-desc { color: var(--text-secondary); }

/* ── CODE BLOCK ── */
.code-block {
  background: var(--bg-code); border-radius: 8px;
  overflow: hidden; margin-bottom: 32px;
  border: 1px solid #2D3F52;
}

.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: #162433;
  border-bottom: 1px solid #2D3F52;
}

.code-label {
  font-size: 11px; font-weight: 600; color: #637D93;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.code-copy {
  font-size: 11px; color: #637D93; cursor: pointer; padding: 3px 8px;
  border-radius: 3px; border: 1px solid #2D3F52;
  background: transparent; transition: all .12s; font-family: inherit;
}

.code-copy:hover { background: #2D3F52; color: #A8D8EA; }

.code-body {
  padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 12px;
  line-height: 1.7; overflow-x: auto; white-space: pre;
  color: #CDD5E0;
}

.json-key { color: #7EC8E3; }
.json-str { color: #A8E6A3; }
.json-num { color: #FFD580; }
.json-bool { color: #FF8B80; }
.json-null { color: #8993A4; }

/* ── RESPONSE CODES ── */
.response-list { margin-bottom: 32px; }

.response-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 6px; margin-bottom: 6px;
  border: 1px solid transparent;
}

.response-item.r200 { background: #E3FCEF; border-color: #ABF5D1; }
.response-item.r201 { background: #E3FCEF; border-color: #ABF5D1; }
.response-item.r400 { background: #FFEBE6; border-color: #FFBDAD; }
.response-item.r401 { background: #FFF0D9; border-color: #FFE380; }
.response-item.r403 { background: #FFF0D9; border-color: #FFE380; }
.response-item.r404 { background: #F4F5F7; border-color: var(--border); }
.response-item.r422 { background: #FFEBE6; border-color: #FFBDAD; }
.response-item.r503 { background: #FFEBE6; border-color: #FFBDAD; }

.response-code {
  font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700;
  min-width: 40px;
}

.r200 .response-code, .r201 .response-code { color: var(--post-color); }
.r400 .response-code, .r422 .response-code { color: #DE350B; }
.r401 .response-code, .r403 .response-code { color: var(--accent-orange); }
.r404 .response-code { color: var(--text-secondary); }
.r503 .response-code { color: #DE350B; }

.response-desc { font-size: 13px; color: var(--text-secondary); padding-top: 1px; }

/* ── MODEL PAGE ── */
.model-page {
  max-width: 1100px; margin: 0 auto; padding: 40px 48px;
}

.model-field-row {
  display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) 50px 2fr 1fr;
  gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border-light); align-items: start;
  font-size: 13px;
}

.model-field-row:first-child {
  background: var(--bg-main); font-weight: 600;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.model-field-name {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500;
  color: var(--text-primary); word-break: break-word;
}

.model-field-type { color: var(--accent-purple); font-size: 12px; }
.model-field-req { font-size: 11px; font-weight: 700; color: var(--accent-red); }
.model-field-desc { color: var(--text-secondary); line-height: 1.5; }
.model-field-values { line-height: 1.6; }

.enum-val {
  display: inline-block; background: #F4F5F7; border: 1px solid var(--border);
  border-radius: 3px; padding: 1px 6px; margin: 2px 2px 2px 0;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary);
  white-space: nowrap;
}

.enum-val.default {
  background: #E3FCEF; border-color: #ABF5D1;
  color: var(--post-color); font-weight: 600;
}

.val-note {
  font-size: 11px; color: var(--text-muted);
  font-style: italic; display: block; margin-top: 3px;
}

/* ── TAG CHIPS ── */
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 12px;
  font-weight: 500; margin-right: 4px;
}

.tag-auth { background: #E3FCEF; color: var(--post-color); }
.tag-bearer { background: #E6F0FF; color: var(--iris-mid); }

.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── SEARCH RESULTS ── */
.search-results {
  max-width: 780px; margin: 0 auto; padding: 40px 48px;
}

.search-results h1 { font-size: 24px; margin-bottom: 24px; }

.search-result-item {
  padding: 16px; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 12px; cursor: pointer; transition: all .12s;
  background: var(--bg-card);
}

.search-result-item:hover {
  border-color: var(--iris-mid); box-shadow: 0 2px 8px rgba(0,80,200,0.08);
}

.search-result-title {
  font-weight: 600; color: var(--iris-mid); margin-bottom: 4px;
}

.search-result-path {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--text-muted); margin-bottom: 4px;
}

.search-result-desc { font-size: 13px; color: var(--text-secondary); }

/* ── 404 PAGE ── */
.not-found {
  text-align: center; padding: 80px 48px; color: var(--text-muted);
}

.not-found h1 { font-size: 48px; margin-bottom: 12px; }
.not-found p { font-size: 16px; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .header-search { display: none; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TRY IT PANEL (Step 11)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.try-it-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px; margin-bottom: 32px;
}

.try-it-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}

.try-it-row label {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  min-width: 90px; flex-shrink: 0;
}

.try-it-row input, .try-it-row textarea {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; font-family: 'JetBrains Mono', monospace;
  outline: none; transition: border-color .15s;
}

.try-it-row input:focus, .try-it-row textarea:focus {
  border-color: var(--iris-mid);
}

.try-it-row textarea {
  resize: vertical; min-height: 100px; line-height: 1.6;
}

.try-it-actions {
  display: flex; gap: 8px; margin-top: 16px;
}

.try-btn {
  padding: 8px 20px; border-radius: 6px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all .15s; font-family: inherit;
}

.try-btn:not(.try-btn-secondary) {
  background: var(--iris-mid); color: white;
}

.try-btn:not(.try-btn-secondary):hover {
  background: var(--iris-blue);
}

.try-btn-secondary {
  background: var(--bg-main); color: var(--text-secondary);
  border: 1px solid var(--border);
}

.try-btn-secondary:hover {
  background: var(--border); color: var(--text-primary);
}

.try-response { margin-top: 16px; }
.try-response.hidden { display: none; }

.try-status {
  font-size: 13px; font-weight: 600; padding: 10px 14px;
  border-radius: 6px; margin-bottom: 12px;
}

.try-ok { background: #E3FCEF; color: var(--accent-green); }
.try-err { background: #FFEBE6; color: var(--accent-red); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AUTH PAGE (Step 6)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.auth-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px; margin: 24px 0;
}

.auth-input-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}

.auth-input-row label {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  min-width: 120px;
}

.auth-input-row input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px; font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.auth-input-row input:focus { border-color: var(--iris-mid); }

.auth-actions { display: flex; gap: 8px; }

.auth-result { margin-top: 16px; }

.auth-badge {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  margin-left: 8px;
}

.auth-ok { background: var(--accent-green); }
.auth-none { background: var(--text-muted); opacity: 0.4; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SEARCH HIGHLIGHT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
mark {
  background: #FFF3BF; color: var(--text-primary);
  padding: 1px 2px; border-radius: 2px;
}
