/* artist.css — Vongstaad R5B "The Warmth"                          */
/* Dresses the Vantage skeleton with the institutional design system. */
/* ONLY CSS — never modify JS, IDs, or HTML structure.               */

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

/* ============================================================
   DESIGN TOKENS — R5B "The Warmth"
   ============================================================ */
:root {
  --bg:            #080705;
  --surface:       #0e0c09;
  --elevated:      #141108;
  --border:        #201c14;
  --border-mid:    #2a2418;

  --accent:        #c07828;
  --accent-soft:   #3a2808;
  --accent-hover:  #d4893a;

  --text-primary:  #eae4d8;
  --text-soft:     #8a8070;
  --text-muted:    #5a5040;
  --text-dim:      #302818;

  --status-on:     #3a9e5f;
  --status-warn:   #c07a20;
  --profit:        #2dcc6f;
  --loss:          #d44040;

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

  --radius-card:   2px;
  --radius-input:  22px;
  --radius-badge:  2px;
  --shadow:        0 2px 12px rgba(0,0,0,0.5);
  --transition:    140ms ease;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text-primary);
  padding: 16px 20px;
  min-height: 100vh;
}

/* ============================================================
   SCROLLBAR — 3px amber thumb on bg track
   ============================================================ */
::-webkit-scrollbar       { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--accent) var(--bg); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

h2 {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 14px 0 8px;
}

h3 {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

/* ============================================================
   AUTH SECTION
   ============================================================ */
#auth-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#auth-section input,
#auth-section select {
  background: var(--elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 7px 14px;
  min-width: 160px;
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

#auth-section select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235a5040'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  border-radius: 4px;
}

#auth-section input:focus,
#auth-section select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192, 120, 40, 0.15);
}

#auth-section input::placeholder {
  color: var(--text-dim);
}

/* ============================================================
   CONNECTION STATUS
   ============================================================ */
#connection-status {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: all var(--transition);
}

#connection-status.connected {
  color: var(--status-on);
  background: rgba(58, 158, 95, 0.1);
  border-color: rgba(58, 158, 95, 0.25);
}

#connection-status.disconnected {
  color: var(--loss);
  background: rgba(212, 64, 64, 0.1);
  border-color: rgba(212, 64, 64, 0.25);
}

/* "Test Connection" button — in auth row */
#auth-section button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 16px;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap;
}

#auth-section button:hover  { background: var(--accent-hover); }
#auth-section button:active { opacity: 0.8; }

/* ============================================================
   NAV TABS
   ============================================================ */
nav#tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

nav#tabs button {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 2px 2px 0 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 13px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}

nav#tabs button:hover {
  color: var(--text-soft);
  background: var(--elevated);
}

nav#tabs button.active {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--border) var(--border) var(--surface) var(--border);
  border-bottom-color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
main#content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  animation: fadeIn 180ms ease;
  margin-bottom: 14px;
}

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

/* ============================================================
   ENDPOINT CARDS
   ============================================================ */
.endpoint-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  margin-bottom: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition: border-color var(--transition);
}

.endpoint-card:hover {
  border-color: var(--border-mid);
}

.endpoint-card:last-child {
  margin-bottom: 0;
}

/* ============================================================
   METHOD BADGES
   ============================================================ */
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: var(--radius-badge);
  min-width: 44px;
  text-align: center;
  border: 1px solid transparent;
}

.method.GET {
  background: rgba(192, 120, 40, 0.12);
  color: var(--accent);
  border-color: rgba(192, 120, 40, 0.3);
}

.method.POST {
  background: rgba(58, 158, 95, 0.12);
  color: var(--status-on);
  border-color: rgba(58, 158, 95, 0.3);
}

.method.PUT {
  background: rgba(192, 122, 32, 0.12);
  color: var(--status-warn);
  border-color: rgba(192, 122, 32, 0.3);
}

.method.DELETE {
  background: rgba(212, 64, 64, 0.12);
  color: var(--loss);
  border-color: rgba(212, 64, 64, 0.3);
}

/* ============================================================
   PATH DISPLAY
   ============================================================ */
.path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-soft);
  word-break: break-all;
}

/* ============================================================
   PARAMS ROW
   ============================================================ */
.params-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.params-row input {
  background: var(--elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 12px;
  min-width: 110px;
  flex: 1;
  outline: none;
  transition: border-color var(--transition);
}

.params-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(192, 120, 40, 0.12);
}

.params-row input::placeholder {
  color: var(--text-dim);
}

/* ============================================================
   BUTTONS — general
   ============================================================ */
button {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: var(--radius-card);
  cursor: pointer;
  border: 1px solid var(--border-mid);
  background: var(--elevated);
  color: var(--text-soft);
  transition: all var(--transition);
  white-space: nowrap;
}

button:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

button:active  { opacity: 0.75; }
button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Primary — amber CTA */
button.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 10px rgba(192, 120, 40, 0.25);
}

/* Danger */
button.danger {
  background: rgba(212, 64, 64, 0.1);
  color: var(--loss);
  border-color: rgba(212, 64, 64, 0.3);
  font-weight: 700;
}

button.danger:hover {
  background: rgba(212, 64, 64, 0.2);
  box-shadow: 0 0 8px rgba(212, 64, 64, 0.2);
}

/* ============================================================
   FOOTER — RESPONSE PANEL
   ============================================================ */
footer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}

#global-response h3 {
  margin-bottom: 10px;
}

#response-body {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.65;
  color: var(--accent);
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  tab-size: 2;
}

#response-body:empty::after {
  content: "No response yet. Execute an endpoint to see results.";
  color: var(--text-dim);
  font-style: italic;
}

/* ============================================================
   RESPONSE META — State-dependent
   ============================================================ */
#response-meta {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  letter-spacing: 0.06em;
}

.status-200 { color: var(--profit);      font-weight: 600; }
.status-400 { color: var(--status-warn); font-weight: 600; }
.status-429 { color: #9b78d0;            font-weight: 600; }
.status-500 { color: var(--loss);        font-weight: 600; }

/* ============================================================
   OFFLINE BANNER (created dynamically by offline.js)
   Targets the inline-styled div offline.js injects
   ============================================================ */
div[style*="background:#a00"],
div[style*="background: #a00"] {
  background: rgba(212,64,64,0.92) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  padding: 9px !important;
  animation: slideDown 220ms ease !important;
  border-bottom: 1px solid rgba(212,64,64,0.5) !important;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background: rgba(192, 120, 40, 0.25);
  color: var(--text-primary);
}

/* ============================================================
   DASHBOARD (dashboard.html) — override inline styles
   These use specificity / cascade to beat the <style> tag
   ============================================================ */
body {
  font-family: var(--font-sans) !important;
  background: var(--bg) !important;
  color: var(--text-primary) !important;
  padding: 16px 20px !important;
}

h1 {
  color: var(--accent) !important;
  font-family: var(--font-mono) !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  padding: 14px 16px !important;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-mid) !important;
}

.card h2 {
  color: var(--accent) !important;
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

.metric {
  display: flex !important;
  justify-content: space-between !important;
  padding: 6px 0 !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--font-mono) !important;
  font-size: 10px !important;
  color: var(--text-soft) !important;
}

.metric:last-child { border-bottom: none !important; }

.value {
  font-weight: 600 !important;
  color: var(--text-primary) !important;
}

.value.ok   { color: var(--profit) !important; }
.value.warn { color: var(--status-warn) !important; }
.value.err  { color: var(--loss) !important; }

.bar {
  height: 3px !important;
  background: var(--border) !important;
  border-radius: 2px !important;
  margin-top: 6px !important;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent) !important;
  transition: width 800ms ease;
}

#last-update {
  color: var(--text-dim) !important;
  font-family: var(--font-mono) !important;
  font-size: 9px !important;
  letter-spacing: 0.06em !important;
  margin-top: 14px !important;
}

/* ============================================================
   MOBILE — matches skeleton.css 768px breakpoint
   ============================================================ */
@media (max-width: 768px) {
  body { padding: 10px !important; }

  h1 { font-size: 14px; }

  #auth-section {
    flex-direction: column;
  }

  #auth-section input,
  #auth-section select,
  #auth-section button {
    width: 100%;
    min-width: unset;
    font-size: 16px;
    padding: 10px 14px;
  }

  #auth-section select {
    border-radius: 4px;
  }

  nav#tabs {
    flex-direction: column;
    gap: 2px;
  }

  nav#tabs button {
    text-align: left;
    padding: 10px 14px;
    border-radius: 2px;
    font-size: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
  }

  nav#tabs button.active {
    border-left: 3px solid var(--accent);
    border-bottom-color: var(--border);
  }

  .endpoint-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .params-row {
    flex-direction: column;
  }

  .params-row input {
    width: 100%;
    border-radius: var(--radius-input);
    font-size: 16px;
    padding: 10px 14px;
  }

  button {
    min-height: 44px;
    font-size: 13px;
    padding: 10px 14px;
  }

  input, select, textarea {
    font-size: 16px !important;
  }

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