/* static/css/base.css */

/* ------------------------------
   Auric Base Design System
   - Bootstrap-friendly (no .btn/.card overrides)
   - Light default, dark via html[data-theme="dark"]
-------------------------------- */

/* Theme tokens: Light (default) */
:root {
  /* Brand */
  --auric-ink: #0b1220;
  --auric-gold-1: #f6d365; /* warm gold */
  --auric-gold-2: #fda085; /* warm peach */
  --auric-gold-gradient: linear-gradient(135deg, var(--auric-gold-1), var(--auric-gold-2));

  /* Light theme surfaces */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;

  /* Text */
  --text: #111827;
  --muted: #6b7280;

  /* Borders / shadows */
  --border: rgba(17, 24, 39, 0.12);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 10px 30px rgba(17, 24, 39, 0.08);

  /* Actions */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;

  /* Links */
  --link: #2563eb;
  --link-hover: #1d4ed8;

  /* Focus */
  --focus-ring: 0 0 0 0.25rem rgba(37, 99, 235, 0.20);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  /* Layout */
  --navbar-bg: var(--auric-ink);
  --navbar-border: rgba(255, 255, 255, 0.08);
  --navbar-height: 64px;
}

/* Theme tokens: Dark */
html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #0f172a;

  --text: #e5e7eb;
  --muted: #9ca3af;

  --border: rgba(255, 255, 255, 0.10);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.40);

  --link: #8fb3ff;
  --link-hover: #b7ceff;

  --navbar-bg: #0b1220;
  --navbar-border: rgba(255, 255, 255, 0.10);

  --focus-ring: 0 0 0 0.25rem rgba(143, 179, 255, 0.22);
}

/* Global base */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);

  /* fixed-top navbar spacing */
  padding-top: var(--navbar-height);
}

/* If you want zero padding on login pages, set body_class="login-page" in the template */
body.login-page {
  padding-top: 0;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

/* Main container spacing */
.app-main {
  padding-top: 24px;
  padding-bottom: 48px;
}

/* Navbar */
.app-navbar {
  background: var(--navbar-bg) !important;
  border-bottom: 1px solid var(--navbar-border);
  min-height: var(--navbar-height);
}

.app-navbar-logo {
  height: 30px;
  width: auto;
}

.app-navbar .nav-link {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  border-radius: 10px;
  padding: 8px 12px;
  margin-left: 6px;
}
.app-navbar .nav-link:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.06);
}

/* Cards: compose with Bootstrap card: class="card app-card" */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

html[data-theme="dark"] .app-card {
  box-shadow: none; /* borders read better than shadows on dark */
}

/* Card header helpers */
.app-card-title {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 8px 0;
}
.app-card-subtitle {
  color: var(--muted);
  margin: 0;
}

/* Buttons: use alongside Bootstrap buttons */
.btn-app-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
}
.btn-app-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-app-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
}
.btn-app-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Auric gold accent button (use sparingly) */
.btn-app-gold {
  background: var(--auric-gold-gradient);
  border: 0;
  color: #1a1a1a;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.btn-app-gold:hover {
  filter: brightness(0.98);
}

/* Forms (Bootstrap-friendly) */
.form-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-control,
.form-select {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background: var(--surface);
  color: var(--text);
}

.form-control:focus,
.form-select:focus,
.btn:focus {
  box-shadow: var(--focus-ring) !important;
  border-color: rgba(37, 99, 235, 0.55);
}

/* Tables (help admin lists look modern) */
.table {
  color: var(--text);
}
.table thead th {
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  border-top: 1px solid var(--border);
}
html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
}

/* Lists (ul/li consistency in cards) */
.app-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--text);
}
.app-list li {
  margin: 0.25rem 0;
  color: var(--text);
}
.app-muted {
  color: var(--muted);
}

/* Theme toggle (bottom-left) */
.theme-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1050;

  width: 46px;
  height: 46px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);

  cursor: pointer;
  user-select: none;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:active {
  transform: translateY(0px);
}

.theme-toggle-icon {
  font-size: 18px;
  line-height: 1;
}

/* Utility: subtle divider */
.app-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
