@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================================
   Apple-inspired design tokens
   ============================================================ */

:root {
  --bg: #000000;
  --bg-elevated: #0a0a0c;
  --bg-card: rgba(28, 28, 30, 0.72);
  --bg-card-hover: rgba(38, 38, 40, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;
}

html.light {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-hover: rgba(255, 255, 255, 0.92);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.14);
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
}

html, body, #root {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(ellipse at top, rgba(10, 132, 255, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(88, 86, 214, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Frosted glass surface */
.surface {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.surface-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.surface-hover:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Hero gradient text (Apple-style) */
.text-gradient {
  background: linear-gradient(135deg, #f5f5f7 0%, #a1a1a6 50%, #0a84ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Subtle inner glow on focusable elements */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

html.light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
html.light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* Number/stats typography */
.stat-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  letter-spacing: -0.04em;
  font-weight: 600;
}

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Nav active state */
.nav-link {
  position: relative;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

/* Loading shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}
