/* =============================================================================
   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: Force light-mode text on form elements ===
   Admin panel uses hardcoded Tailwind classes and does NOT support
   dark theme. This prevents inherited body color from making form
   text invisible if data-theme is ever changed externally.
   Specificity: (0, 3, 1) — intentionally higher than Tailwind utilities (0, 1, 0).
   This is safe because admin forms do NOT use text color classes on inputs
   (all text-red-* in admin are on error containers <ul>/<h3>/<span>, not inputs). */
[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: #111827; /* gray-900 */
  background-color: #ffffff;
}
