/* AVI-OS — Premium glass upgrade (pink/cyan accents, deeper glass, motion) */

:root {
  --font-display: "Inter", ui-sans-serif, system-ui, -apple-system, "SF Pro Display", sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "SF Pro Text", sans-serif;
  --glass-bg: rgba(22, 24, 32, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(28px) saturate(200%);
  --glass-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --accent-glow: rgba(34, 211, 238, 0.35);
  --pink-glow: rgba(244, 114, 182, 0.4);
  --gradient-brand: linear-gradient(135deg, #22d3ee 0%, #a78bfa 45%, #ff4d8d 100%);
  --gradient-glass: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(244, 114, 182, 0.08));
}

html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 77, 141, 0.1), transparent 50%),
    radial-gradient(800px 400px at 50% 100%, rgba(167, 139, 250, 0.08), transparent 45%),
    var(--bg, #000);
  background-attachment: fixed;
}

/* Deeper glass cards */
.card,
.card--glass,
.kpi,
.modal__panel,
.top,
.sidebar {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  border-color: rgba(34, 211, 238, 0.28);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(34, 211, 238, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card--glass {
  background: var(--gradient-glass), var(--glass-bg);
}

/* Premium buttons */
.btn {
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn--primary {
  background: var(--gradient-brand);
  border: 0;
  color: #041018;
  font-weight: 700;
  box-shadow: 0 4px 20px var(--accent-glow), 0 2px 8px var(--pink-glow);
}

.btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 8px 28px var(--accent-glow), 0 4px 14px var(--pink-glow);
}

.btn--secondary,
.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.btn--secondary:hover,
.btn--ghost:hover {
  border-color: rgba(34, 211, 238, 0.4);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.12);
}

/* Top bar / shell */
.top {
  background: rgba(8, 10, 16, 0.65) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.sidebar {
  background: rgba(8, 10, 16, 0.55) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar a:hover,
.nav-item:hover,
.nav__link:hover {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(255, 77, 141, 0.06));
  box-shadow: inset 3px 0 0 var(--accent, #22d3ee);
}

/* KPI glow */
.kpi__val,
.kpi__value {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Badges */
.badge--accent,
.avi-emp-badge,
#avi-employee-badge {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(255, 77, 141, 0.16));
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #e0f7fa;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

#avi-employee-badge[data-badge="Expert"] {
  border-color: rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.25);
}

#avi-employee-badge[data-badge="In training"] {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

/* Inputs */
.input,
.select,
textarea.input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
.select:focus,
textarea.input:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15), 0 0 20px rgba(255, 77, 141, 0.08);
  outline: none;
}

/* Journey / training accents */
.journey-step:hover {
  transform: translateY(-2px);
}

/* Toast premium */
.toast {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* Page titles */
.page-header h1,
.section-head h2 {
  letter-spacing: -0.02em;
}

.section-head h2 {
  background: linear-gradient(90deg, #f5f5f7 0%, #67e8f9 60%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Smooth interactive tables */
.tbl tbody tr {
  transition: background 0.15s ease;
}

.tbl tbody tr:hover {
  background: rgba(34, 211, 238, 0.06);
}

/* Scrollbar subtle */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.35);
}

/* ── Light theme contrast fixes (WCAG AA+) ───────────────────────────── */
[data-theme="light"] {
  --glass-bg: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-shadow: 0 8px 28px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --accent: #0891b2;
  --accent-text: #0e7490;
  --accent-2: #db2777;
  --accent-soft: rgba(8, 145, 178, 0.12);
  --gradient-brand: linear-gradient(135deg, #0891b2 0%, #7c3aed 50%, #db2777 100%);
  --text: #0f172a;
  --text-soft: #1e293b;
  --text-muted: #334155;
  --text-faint: #475569;
}

[data-theme="light"] body {
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(8, 145, 178, 0.08), transparent 55%),
    radial-gradient(800px 400px at 100% 0%, rgba(219, 39, 119, 0.06), transparent 50%),
    #f8fafc;
}

[data-theme="light"] .card,
[data-theme="light"] .card--glass,
[data-theme="light"] .kpi {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .btn--primary {
  color: #ffffff;
  background: linear-gradient(135deg, #0e7490 0%, #7c3aed 55%, #be185d 100%);
}

[data-theme="light"] .btn--secondary,
[data-theme="light"] .btn--ghost {
  color: #0f172a;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .section-head h2,
[data-theme="light"] .kpi__val,
[data-theme="light"] .kpi__value {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: #0f172a;
}

[data-theme="light"] .side__link,
[data-theme="light"] .u-muted,
[data-theme="light"] .badge {
  color: inherit;
}

[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] textarea.input {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.2);
}

[data-theme="light"] .top,
[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .avi-legal-footer {
  color: #334155;
  border-top-color: rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.95);
}

/* Legal footer (all themes) */
.avi-legal-footer {
  margin-top: 28px;
  padding: 14px 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}
.avi-legal-footer strong { color: var(--text-soft); }
.avi-legal-footer a { color: var(--accent-text); }
