/* =============================================================================
   UTILITIES - Glassmorphism, body styles, and common patterns
   ============================================================================= */

/* === Base Body Styles === */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === Glassmorphism === */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-medium);
  transition: background 0.4s ease, border-color 0.4s ease;
}

:root[data-theme="dark"] .glass-card {
  background: rgba(43, 37, 33, 0.98);
}

/* === Text Utilities === */
.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-display {
  font-family: var(--font-display);
}

.text-body {
  font-family: var(--font-body);
}

.text-mono {
  font-family: var(--font-mono);
}

/* === Interactive Elements === */
.interactive {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.interactive:active {
  transform: translateY(0);
}

/* === Focus Ring (accessible) === */
.focus-ring:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.focus-ring:focus:not(:focus-visible) {
  outline: none;
}

.focus-ring:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Scrollbar Styling === */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-secondary);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* === Card Patterns === */
.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.card-primary {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 16px;
}

/* === Gradient Backgrounds === */
.bg-page-gradient {
  background: var(--bg-gradient);
}

/* === Dividers === */
.divider {
  height: 1px;
  background: var(--border-default);
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: var(--border-default);
}

/* === Admin Panel: token-based form element colours ===
   Admin panel is now design-token-based and theme-aware (layouts/admin/* +
   theme_init). These form-control colours follow the active theme so inputs
   are readable in BOTH light and dark (previously hardcoded #fff/#111827,
   which rendered a glaring white box in dark mode).
   Specificity: (0, 3, 1) — intentionally higher than stray Tailwind utilities. */
[data-theme] body.admin-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
[data-theme] body.admin-panel select,
[data-theme] body.admin-panel textarea {
  color: var(--color-fg);
  background-color: var(--color-bg-elevated);
}
