/* ============================================================
   CAROLIA — Global Styles
   Aesthetic: Dark Luxury Terminal
   Fonts: Syne (display) + DM Mono (code) + Outfit (body)
   ============================================================ */

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

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0a0f;
  --bg2:      #111118;
  --bg3:      #16161f;
  --bg4:      #1c1c28;
  --border:   rgba(255,255,255,.07);
  --border2:  rgba(255,255,255,.12);

  --text:     #e8e8f0;
  --text2:    #9898b0;
  --text3:    #5c5c78;

  --accent:   #7c6fff;
  --accent2:  #a78fff;
  --accent-glow: rgba(124,111,255,.25);

  --green:    #4ade80;
  --red:      #f87171;
  --amber:    #fbbf24;
  --teal:     #2dd4bf;

  --radius:   12px;
  --radius-lg:18px;
  --shadow:   0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:0 12px 48px rgba(0,0,0,.6);

  --font:     'Outfit', sans-serif;
  --font-head:'Syne', sans-serif;
  --font-mono:'DM Mono', monospace;

  --sidebar-w: 268px;
  --topbar-h:  58px;
}

html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── UTILITY ── */
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; border: none;
  transition: all .2s ease; white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent2);
  box-shadow: 0 0 32px rgba(124,111,255,.4);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }
.btn-danger {
  background: rgba(248,113,113,.15); color: var(--red); border: 1px solid rgba(248,113,113,.2);
}
.btn-danger:hover { background: rgba(248,113,113,.25); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── FORM ELEMENTS ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text2); letter-spacing: .03em; text-transform: uppercase; }
.field input,
.field select,
.field textarea {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  transition: border-color .2s;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field input::placeholder { color: var(--text3); }
.field textarea { resize: vertical; min-height: 80px; }
.field select option { background: var(--bg3); }

/* ── CARDS ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
}
.badge-purple { background: rgba(124,111,255,.15); color: var(--accent2); }
.badge-green  { background: rgba(74,222,128,.12);  color: var(--green); }
.badge-red    { background: rgba(248,113,113,.12);  color: var(--red); }
.badge-amber  { background: rgba(251,191,36,.12);   color: var(--amber); }
.badge-teal   { background: rgba(45,212,191,.12);   color: var(--teal); }

/* ── ALERT ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.alert-error   { background: rgba(248,113,113,.1); color: var(--red);   border: 1px solid rgba(248,113,113,.2); }
.alert-success { background: rgba(74,222,128,.1);  color: var(--green); border: 1px solid rgba(74,222,128,.2); }
.alert-info    { background: rgba(124,111,255,.1); color: var(--accent2); border: 1px solid rgba(124,111,255,.2); }

/* ── TABLE ── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text3); border-bottom: 1px solid var(--border);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── CODE BLOCKS (Markdown rendered) ── */
pre {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0;
}
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--accent2);
}
pre code { background: none; padding: 0; color: var(--text2); }

/* ── ANIMATIONS ── */
@keyframes fadeIn   { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:.4; } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes shimmer  { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.anim-fade { animation: fadeIn .3s ease both; }
.anim-up   { animation: fadeUp .4s ease both; }

/* ── LOADER ── */
.loader {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.divider-text {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--text3); margin: 20px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .hide-mobile { display: none !important; }
}
