/* ==========================================================
   Demand Radar // Apple-Inspired Minimalist Design System
   Low information density, generous whitespace, calm typography
   ========================================================== */

:root {
  --bg-body: #000000;
  --bg-card: #121214;
  --bg-card-hover: #18181c;
  --bg-card-elevated: #1c1c20;
  --bg-pill: #1c1c1e;
  --bg-pill-active: #2c2c30;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(255, 255, 255, 0.28);

  --text-primary: #f5f5f7;
  --text-secondary: #86868b;
  --text-tertiary: #525256;

  --accent-blue: #2997ff;
  --accent-green: #30d158;
  --accent-amber: #f5a623;
  --accent-red: #ff453a;
  --accent-purple: #bf5af2;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, monospace;

  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 9999px;

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Atmospheric Ambient Background */
.bg-ambient-light {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 500px;
  background: radial-gradient(ellipse at top, rgba(41, 151, 255, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ================= Navigation ================= */
.apple-nav {
  position: sticky;
  top: 0;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background-color: rgba(0, 0, 0, 0.72);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.nav-logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, #2997ff, #5e5ce6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
}

.nav-brand-text {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.nav-admin-link {
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.nav-admin-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* ================= Hero Section (Spacious Apple Style) ================= */
.hero-section {
  padding: 88px 0 56px 0;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-blue);
  margin-bottom: 16px;
}

.hero-title {
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 20px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 19px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 620px;
  margin: 0 auto 36px auto;
}

/* ================= Calm Metrics Bar ================= */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background-color: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 56px;
}

.metric-cell {
  background-color: var(--bg-card);
  padding: 24px;
  text-align: center;
}

.metric-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ================= Filter Controls (Segmented Control) ================= */
.controls-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.segmented-control {
  display: inline-flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background-color: var(--bg-pill-active);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.source-filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.source-pill {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.source-pill:hover {
  color: var(--text-primary);
}

.source-pill.active {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

/* ================= Opportunity Cards (Apple Style) ================= */
.cards-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 80px;
}

.opportunity-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px 38px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.opportunity-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.card-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
}

.card-score-badge.high {
  background-color: rgba(48, 209, 88, 0.14);
  color: var(--accent-green);
}

.card-score-badge.moderate {
  background-color: rgba(245, 166, 35, 0.14);
  color: var(--accent-amber);
}

.card-score-badge.killed {
  background-color: rgba(255, 69, 58, 0.14);
  color: var(--accent-red);
}

.card-headline {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.card-friction-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-meta-item strong {
  color: var(--text-primary);
  font-weight: 500;
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-pill {
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-pill:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--border-focus);
}

.btn-pill.primary {
  background-color: #ffffff;
  color: #000000;
  border-color: transparent;
}

.btn-pill.primary:hover {
  background-color: #e5e5ea;
}

.btn-pill.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-pill.ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ================= Modal (Apple Glass Sheet) ================= */
.apple-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.apple-modal-backdrop.open {
  display: flex;
}

.apple-modal-sheet {
  background-color: #161618;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 36px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ================= Footer ================= */
.apple-footer {
  padding: 48px 0 64px 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.apple-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.apple-footer a:hover {
  color: var(--text-primary);
}

/* ================= Responsive ================= */
@media (max-width: 768px) {
  .hero-title {
    font-size: 36px;
  }
  .hero-subtitle {
    font-size: 16px;
  }
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .opportunity-card {
    padding: 24px;
  }
  .card-actions-row {
    flex-direction: column;
    align-items: stretch;
  }
  .apple-modal-sheet {
    padding: 24px;
  }
}
