/* Theme base - component styles that use CSS variables */
/* This file provides themed styling for common UI components */

html, body {
  background: var(--c-bg, #05060a);
  color: var(--c-text, #f5f5f6);
}

a {
  color: var(--c-link);
  text-decoration-color: color-mix(in oklab, var(--c-link) 35%, transparent);
}
a:hover {
  text-decoration-color: color-mix(in oklab, var(--c-link) 75%, transparent);
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--c-focus);
  border-radius: var(--r-2);
}

::selection {
  background: color-mix(in oklab, var(--c-secondary) 22%, transparent);
  color: var(--c-text);
}

/* Backgrounds */
.bg-app { background: var(--c-bg); color: var(--c-text); }
.bg-hero { background: var(--grad-hero); color: var(--c-text); }
.surface, .card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-1);
  color: var(--c-text);
}
.surface-2 {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-2);
  color: var(--c-text);
}
.surface-3 {
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2);
  color: var(--c-text);
}
.glass {
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-1);
  color: var(--c-text);
}

.divider, hr { border-color: var(--c-divider); }
.text-muted { color: var(--c-muted); }
.text-soft { color: color-mix(in oklab, var(--c-text) 70%, var(--c-muted)); }

.text-gradient {
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary), var(--c-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.glow-primary   { color: var(--c-primary);   text-shadow: var(--shadow-glow); }
.glow-secondary { color: var(--c-secondary); text-shadow: var(--shadow-glow); }
.glow-accent    { color: var(--c-accent);    text-shadow: var(--shadow-glow); }

/* Badges / chips */
.badge, .chip {
  background: var(--c-pill-bg);
  border: 1px solid var(--c-pill-border);
  border-radius: 999px;
  color: var(--c-text);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
}
.chip.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-on-primary);
}
.badge-primary { color: var(--c-primary); }
.badge-success { color: var(--c-success); }
.badge-warn    { color: var(--c-warn); }
.badge-danger  { color: var(--c-danger); }

/* Alerts / Flash messages */
.alert, .flash {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-border-strong);
  border-radius: var(--r-2);
  color: var(--c-text);
  padding: 12px 16px;
  margin: 12px 0;
}
.alert-success, .flash-success { border-left-color: var(--c-success); }
.alert-warn, .flash-warning    { border-left-color: var(--c-warn); }
.alert-danger, .flash-error    { border-left-color: var(--c-danger); }
.alert-info, .flash-info       { border-left-color: var(--c-secondary); }

/* Forms */
.input, input.input, textarea.input, select.input,
input[type="text"], input[type="email"], input[type="password"], 
input[type="search"], input[type="url"], textarea, select {
  background: var(--c-input-bg);
  color: var(--c-text);
  border: 1px solid var(--c-input-border);
  border-radius: var(--r-2);
  transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med);
}
.input::placeholder, input::placeholder, textarea::placeholder { 
  color: color-mix(in oklab, var(--c-muted) 75%, transparent); 
}
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--c-primary) 50%, var(--c-input-border));
  box-shadow: 0 0 0 4px var(--c-ring);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-2);
  overflow: hidden;
  color: var(--c-text);
}
.table th, .table td { border-bottom: 1px solid var(--c-divider); }
.table thead th {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.table tbody tr:hover { background: color-mix(in oklab, var(--c-surface-2) 70%, transparent); }

/* Modal/backdrop helpers */
.backdrop { background: var(--c-overlay); }
.tooltip {
  background: var(--c-tooltip);
  border: 1px solid color-mix(in oklab, var(--c-border) 55%, transparent);
  border-radius: 14px;
  color: var(--c-text);
  box-shadow: var(--shadow-2);
}

/* Scrollbar (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: color-mix(in oklab, var(--c-bg) 92%, black); }
::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--c-border) 55%, transparent);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in oklab, var(--c-primary) 35%, transparent); }

/* Section styling */
.section {
  padding: 24px;
  color: var(--c-text);
}
.section-head {
  margin-bottom: 16px;
}
.section-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--c-text);
}
.section-sub {
  color: var(--c-muted);
  margin-top: 4px;
}

/* Link styling */
.link {
  color: var(--c-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--c-link) 35%, transparent);
}
.link:hover {
  text-decoration-color: var(--c-link);
}
