/* ═══════════════════════════════════════════════════════════════
   Content Bot — Design System v2
   Dark-first Glassmorphism inspired by Launch OS
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-nav: rgba(12, 12, 18, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(139, 92, 246, 0.3);
  --text-primary: #f1f1f4;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --brand-500: #8b5cf6;
  --brand-400: #a78bfa;
  --brand-600: #7c3aed;
  --glow-brand: rgba(139, 92, 246, 0.15);
  --glow-brand-strong: rgba(139, 92, 246, 0.3);
}

/* ── Animations ── */
.fade-in { animation: fadeIn 0.35s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── HTMX transitions ── */
.htmx-swapping {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

/* ── Line clamp utilities ── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Select styling ── */
select {
  border: 1px solid var(--border-color);
  appearance: auto;
  background: var(--bg-card);
  color: var(--text-primary);
}
select:focus {
  border-color: var(--brand-500);
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* ── Input styling ── */
input[type="text"], input[type="email"], input[type="url"], input[type="number"],
input[type="password"], input[type="search"], textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus {
  border-color: var(--brand-500);
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════
   GLASSMORPHISM SYSTEM — Dark Theme
   ═══════════════════════════════════════════════════════════════ */

/* Light glass — for cards on dark background */
.glass {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Dark glass — login page */
.glass-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

/* Navigation sidebar */
.glass-nav {
  background: var(--bg-nav);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 1px 0 20px rgba(0, 0, 0, 0.3);
}

/* Glass card — primary content container */
.glass-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
}
.glass-card:hover {
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.1), 0 2px 8px rgba(0, 0, 0, 0.2);
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

/* Glass card with accent left border */
.glass-card-accent {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--brand-500);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s;
}
.glass-card-accent:hover {
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.12);
  transform: translateY(-1px);
}
.glass-card-accent-emerald { border-left-color: #10b981; }
.glass-card-accent-amber   { border-left-color: #f59e0b; }
.glass-card-accent-rose     { border-left-color: #f43f5e; }
.glass-card-accent-violet   { border-left-color: #8b5cf6; }
.glass-card-accent-sky      { border-left-color: #0ea5e9; }


/* ═══════════════════════════════════════════════════════════════
   INTERACTIVE CARDS
   ═══════════════════════════════════════════════════════════════ */

.card-interactive {
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}


/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.625rem;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  transition: all 0.25s;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s;
  cursor: pointer;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


/* ═══════════════════════════════════════════════════════════════
   BADGES & STATUS INDICATORS
   ═══════════════════════════════════════════════════════════════ */

.badge-pulse {
  animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.badge-warning-pulse {
  animation: warning-pulse 2s ease-in-out infinite;
}
@keyframes warning-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(234, 179, 8, 0); }
}


/* ═══════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

.nav-item {
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.nav-item:hover {
  background: rgba(139, 92, 246, 0.08);
  border-left-color: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
}

.nav-item-active {
  background: linear-gradient(to right, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.04));
  color: var(--brand-400);
  border-left: 3px solid var(--brand-500);
  font-weight: 600;
}

.nav-logo-glow {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Nav section headers */
.nav-section-header {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.25rem;
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE NAVIGATION
   ═══════════════════════════════════════════════════════════════ */

#mobile-nav {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#mobile-nav.open {
  transform: translateX(0);
}

#mobile-backdrop {
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
#mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}


/* ═══════════════════════════════════════════════════════════════
   LOADING & SKELETON
   ═══════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 0.375rem;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ═══════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  text-align: center;
}
.empty-state svg {
  width: 3rem;
  height: 3rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.empty-state .empty-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.empty-state .empty-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════════════════
   GRADIENT UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.gradient-text {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, #8b5cf6, #c084fc);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Stat card icon circles */
.stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(167, 139, 250, 0.1));
  color: #a78bfa;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.1);
}

/* Ambient glow effects */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.2;
  pointer-events: none;
}

/* Floating ambient orbs */
.ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite;
}
.ambient-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}
.ambient-orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), transparent 70%);
  bottom: -50px;
  left: -100px;
  animation-delay: -7s;
}
.ambient-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent 70%);
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(10px, 10px) scale(1.02); }
}


/* ═══════════════════════════════════════════════════════════════
   TABLE ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

.table-glass thead th {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.table-glass tbody tr {
  transition: background-color 0.2s;
}
.table-glass tbody tr:hover {
  background-color: rgba(139, 92, 246, 0.04);
}


/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }


/* ═══════════════════════════════════════════════════════════════
   STAT ICON COLOR VARIANTS
   ═══════════════════════════════════════════════════════════════ */

.stat-icon-emerald, .stat-icon-amber, .stat-icon-violet, .stat-icon-rose, .stat-icon-sky {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.1);
}
.stat-icon-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.1);
}
.stat-icon-violet {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.1));
  color: #a78bfa;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.1);
}
.stat-icon-rose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(225, 29, 72, 0.1));
  color: #fb7185;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.1);
}
.stat-icon-sky {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.1));
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.1);
}


/* ═══════════════════════════════════════════════════════════════
   MOCK DATA BADGE
   ═══════════════════════════════════════════════════════════════ */

.badge-mock {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  background: rgba(139, 92, 246, 0.1);
  color: var(--brand-400);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-mock::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--brand-500);
  animation: pulse-glow-brand 2s ease-in-out infinite;
}
@keyframes pulse-glow-brand {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0); }
}


/* ═══════════════════════════════════════════════════════════════
   STAGGER ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

.stagger-in > * {
  opacity: 0;
  transform: translateY(12px);
  animation: staggerFade 0.4s ease forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes staggerFade {
  to { opacity: 1; transform: translateY(0); }
}

/* Score indicators */
.score-high { color: #34d399; }
.score-mid  { color: #fbbf24; }
.score-low  { color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════
   DARK THEME OVERRIDES FOR TAILWIND CLASSES
   These ensure all tailwind color classes look right on dark bg
   ═══════════════════════════════════════════════════════════════ */

/* Body & typography */
body {
  color: var(--text-primary) !important;
}

/* Override gray/slate text colors used in templates */
.text-gray-900, .text-slate-800, .text-slate-900 { color: var(--text-primary) !important; }
.text-gray-800, .text-gray-700, .text-slate-700 { color: #d4d4d8 !important; }
.text-gray-500, .text-slate-500 { color: var(--text-secondary) !important; }
.text-gray-400, .text-slate-400 { color: var(--text-muted) !important; }
.text-gray-600, .text-slate-600 { color: #a1a1aa !important; }

/* Background overrides */
.bg-white { background-color: rgba(255, 255, 255, 0.03) !important; }
.bg-gray-50, .bg-slate-50 { background-color: rgba(255, 255, 255, 0.02) !important; }
.bg-gray-100, .bg-slate-100 { background-color: rgba(255, 255, 255, 0.04) !important; }
.bg-gray-200, .bg-slate-200 { background-color: rgba(255, 255, 255, 0.06) !important; }
.bg-surface-50\/50 { background-color: rgba(255, 255, 255, 0.03) !important; }

/* Status badges on dark */
.bg-green-100 { background-color: rgba(34, 197, 94, 0.15) !important; }
.text-green-700 { color: #4ade80 !important; }
.bg-yellow-100 { background-color: rgba(234, 179, 8, 0.15) !important; }
.text-yellow-700 { color: #facc15 !important; }
.bg-red-100 { background-color: rgba(239, 68, 68, 0.15) !important; }
.text-red-700 { color: #f87171 !important; }
.bg-blue-100 { background-color: rgba(59, 130, 246, 0.15) !important; }
.text-blue-700 { color: #60a5fa !important; }
.bg-indigo-100, .bg-brand-100 { background-color: rgba(139, 92, 246, 0.15) !important; }
.text-indigo-700, .text-brand-700 { color: #a78bfa !important; }

/* Border overrides */
.border-slate-200\/60, .border-slate-200, .border-gray-200 {
  border-color: rgba(255, 255, 255, 0.06) !important;
}
.border-slate-100, .border-gray-100 {
  border-color: rgba(255, 255, 255, 0.04) !important;
}

/* Hover overrides */
.hover\:bg-slate-100:hover, .hover\:bg-gray-100:hover {
  background-color: rgba(255, 255, 255, 0.06) !important;
}
.hover\:border-brand-300:hover {
  border-color: rgba(139, 92, 246, 0.3) !important;
}

/* Ring/focus */
.ring-1.ring-black\/5 {
  --tw-ring-color: rgba(255, 255, 255, 0.06) !important;
}


/* ═══════════════════════════════════════════════════════════════
   AMBIENT BORDER ANIMATION (from Launch OS)
   ═══════════════════════════════════════════════════════════════ */

@property --border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glass-card-glow {
  position: relative;
}
.glass-card-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--border-angle),
    rgba(139, 92, 246, 0.3),
    rgba(59, 130, 246, 0.1),
    rgba(236, 72, 153, 0.15),
    rgba(139, 92, 246, 0.3)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: borderSpin 8s linear infinite;
}

@keyframes borderSpin {
  to { --border-angle: 360deg; }
}

/* Glass shimmer sweep */
.glass-shimmer {
  position: relative;
  overflow: hidden;
}
.glass-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.06) 46%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 54%,
    transparent 70%
  );
  transform: skewX(-18deg);
  animation: shimmerSweep 6s ease-in-out 2s infinite;
  pointer-events: none;
}

@keyframes shimmerSweep {
  0%, 70% { left: -150%; }
  100% { left: 200%; }
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE TOP BAR (dark)
   ═══════════════════════════════════════════════════════════════ */

header.glass-nav {
  background: rgba(12, 12, 18, 0.9) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}


/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: rgba(24, 24, 27, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: #e4e4e7;
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}
.toast.toast-out {
  animation: toastOut 0.25s ease-in forwards;
}
.toast-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.toast-body {
  flex: 1;
  line-height: 1.4;
}
.toast-close {
  flex-shrink: 0;
  cursor: pointer;
  color: #71717a;
  transition: color 0.15s;
  background: none;
  border: none;
  padding: 0.25rem;
}
.toast-close:hover { color: #d4d4d8; }

/* Toast variants */
.toast-success { border-left: 3px solid #34d399; }
.toast-success .toast-icon { color: #34d399; }
.toast-error { border-left: 3px solid #f87171; }
.toast-error .toast-icon { color: #f87171; }
.toast-warning { border-left: 3px solid #fbbf24; }
.toast-warning .toast-icon { color: #fbbf24; }
.toast-info { border-left: 3px solid #60a5fa; }
.toast-info .toast-icon { color: #60a5fa; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(0.96); }
}


/* ═══════════════════════════════════════════════════════════════
   COUNTUP ANIMATION
   ═══════════════════════════════════════════════════════════════ */

[data-countup] {
  display: inline-block;
}


/* ═══════════════════════════════════════════════════════════════
   ENHANCED HOVER & PRESS EFFECTS
   ═══════════════════════════════════════════════════════════════ */

/* iOS-like press effect on buttons and interactive cards */
.btn-primary:active, .btn-secondary:active,
.card-interactive:active, a.glass-card:active {
  transform: scale(0.97) !important;
  transition-duration: 0.1s;
}

/* Enhanced card hover with subtle scale */
a.glass-card, button.glass-card, .glass-card[onclick] {
  cursor: pointer;
}
a.glass-card:hover, button.glass-card:hover, .glass-card[onclick]:hover {
  transform: translateY(-2px) scale(1.01);
}


/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADING (HTMX-aware)
   ═══════════════════════════════════════════════════════════════ */

/* Skeleton text lines */
.skeleton-text {
  height: 0.875rem;
  border-radius: 0.25rem;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-text-sm { height: 0.625rem; }
.skeleton-text-lg { height: 1.25rem; }

/* Skeleton circle (avatars) */
.skeleton-circle {
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Skeleton card */
.skeleton-card {
  border-radius: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 1.25rem;
}

/* HTMX loading indicator */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.htmx-request.htmx-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Spinner */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(139, 92, 246, 0.2);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 0.75rem; height: 0.75rem; border-width: 1.5px; }
.spinner-lg { width: 1.5rem; height: 1.5rem; border-width: 2.5px; }
@keyframes spin {
  to { transform: rotate(360deg); }
}


/* ═══════════════════════════════════════════════════════════════
   ANIMATED TAB UNDERLINE
   ═══════════════════════════════════════════════════════════════ */

.tab-bar {
  position: relative;
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.tab-bar .tab-btn {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #71717a;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-bar .tab-btn:hover { color: #d4d4d8; }
.tab-bar .tab-btn.active {
  color: #a78bfa;
  border-bottom-color: #8b5cf6;
}

/* Sliding indicator (JS-powered) */
.tab-indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 1px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}


/* ═══════════════════════════════════════════════════════════════
   GRADIENT TOP BORDER ON CARDS
   ═══════════════════════════════════════════════════════════════ */

.glass-card-gradient-top {
  position: relative;
  overflow: hidden;
}
.glass-card-gradient-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), rgba(59, 130, 246, 0.2), transparent);
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════
   STICKY COMPACT HEADER
   ═══════════════════════════════════════════════════════════════ */

.page-header {
  transition: all 0.3s ease;
}
.page-header-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
.page-header-sticky .page-title {
  font-size: 1rem;
}
.page-header-sticky .page-subtitle {
  display: none;
}


/* ═══════════════════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════════════════ */

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: #71717a;
  margin-bottom: 1rem;
}
.breadcrumbs a {
  color: #71717a;
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumbs a:hover { color: #a78bfa; }
.breadcrumbs .bc-sep {
  color: #3f3f46;
  font-size: 0.625rem;
}
.breadcrumbs .bc-current {
  color: #a1a1aa;
  font-weight: 500;
}


/* ═══════════════════════════════════════════════════════════════
   COMMAND PALETTE (Cmd+K)
   ═══════════════════════════════════════════════════════════════ */

.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9990;
  animation: fadeInFast 0.15s ease;
}
.cmd-palette {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 520px;
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 9991;
  overflow: hidden;
  animation: cmdIn 0.2s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.cmd-input-wrap svg { color: #71717a; flex-shrink: 0; }
.cmd-input {
  flex: 1;
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #e4e4e7 !important;
  font-size: 0.9375rem;
  padding: 0 !important;
}
.cmd-input::placeholder { color: #52525b !important; }
.cmd-results {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.5rem;
}
.cmd-group-title {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #52525b;
  padding: 0.5rem 0.5rem 0.25rem;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #a1a1aa;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.1s;
  text-decoration: none;
}
.cmd-item:hover, .cmd-item.active {
  background: rgba(139, 92, 246, 0.1);
  color: #e4e4e7;
}
.cmd-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: #52525b;
}
.cmd-item:hover svg, .cmd-item.active svg { color: #a78bfa; }
.cmd-kbd {
  margin-left: auto;
  font-size: 0.625rem;
  color: #3f3f46;
  padding: 0.125rem 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.25rem;
  font-family: monospace;
}
.cmd-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #52525b;
  font-size: 0.875rem;
}

@keyframes cmdIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}
@keyframes fadeInFast {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════════
   CONFETTI (canvas-based, triggered via JS)
   ═══════════════════════════════════════════════════════════════ */

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════
   METRIC TOOLTIPS
   ═══════════════════════════════════════════════════════════════ */

.metric-tip {
  position: relative;
  cursor: help;
}
.metric-tip .tip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  padding: 0.5rem 0.75rem;
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: #a1a1aa;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 50;
}
.metric-tip .tip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(24, 24, 27, 0.95);
}
.metric-tip:hover .tip-content {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Info pulse ring on metric help icons */
.info-pulse {
  position: relative;
}
.info-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(139, 92, 246, 0.3);
  animation: infoPulseRing 2s ease-out 3;
}
@keyframes infoPulseRing {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}


/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ambient-orb { opacity: 0.06; }
}
