/* ═══════════════════════════════════════════════
   RheumaScore Glass — Apple-inspired glassmorphism
   Injected override — does not replace base styles
   ═══════════════════════════════════════════════ */

/* Smoother background with animated gradient orbs */
body::before {
  background:
    radial-gradient(ellipse 600px 600px at 20% 10%, rgba(139,92,246,0.08), transparent),
    radial-gradient(ellipse 500px 500px at 80% 30%, rgba(99,102,241,0.06), transparent),
    radial-gradient(ellipse 700px 400px at 50% 80%, rgba(167,139,250,0.05), transparent) !important;
  animation: orbFloat 20s ease-in-out infinite alternate;
}
@keyframes orbFloat {
  0% { filter: blur(0px); }
  50% { filter: blur(1px); transform: scale(1.02); }
  100% { filter: blur(0px); }
}

/* Animated gradient orbs behind content */
body::after {
  content: '';
  position: fixed; top: -50%; left: -50%; right: -50%; bottom: -50%;
  background:
    radial-gradient(circle 300px at 30% 20%, rgba(139,92,246,0.04), transparent),
    radial-gradient(circle 250px at 70% 60%, rgba(59,130,246,0.03), transparent),
    radial-gradient(circle 200px at 50% 90%, rgba(236,72,153,0.02), transparent);
  animation: orbDrift 30s linear infinite;
  pointer-events: none; z-index: 0;
}
@keyframes orbDrift {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Glass Nav ── */
.nav-bar {
  background: rgba(5,8,16,0.6) !important;
  backdrop-filter: blur(40px) saturate(1.8) !important;
  -webkit-backdrop-filter: blur(40px) saturate(1.8) !important;
  border-bottom: 1px solid rgba(139,92,246,0.1) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.2) !important;
}
[data-theme='light'] .nav-bar {
  background: rgba(255,255,255,0.6) !important;
  border-bottom: 1px solid rgba(139,92,246,0.08) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.05) !important;
}

/* ── Glass Cards — Disease cards ── */
.disease-card {
  background: rgba(15,22,40,0.5) !important;
  backdrop-filter: blur(20px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.3) !important;
  border: 1px solid rgba(139,92,246,0.08) !important;
  border-radius: 16px !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.disease-card:hover {
  background: rgba(20,28,50,0.6) !important;
  border-color: rgba(139,92,246,0.25) !important;
  transform: translateY(-4px) scale(1.01) !important;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.3),
    0 0 30px rgba(139,92,246,0.08),
    inset 0 1px 0 rgba(255,255,255,0.05) !important;
}
[data-theme='light'] .disease-card {
  background: rgba(255,255,255,0.5) !important;
  border: 1px solid rgba(139,92,246,0.1) !important;
}
[data-theme='light'] .disease-card:hover {
  background: rgba(255,255,255,0.7) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 30px rgba(139,92,246,0.06) !important;
}

/* ── Glass Score Cards ── */
.score-card {
  background: rgba(15,22,40,0.45) !important;
  backdrop-filter: blur(16px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.2) !important;
  border: 1px solid rgba(139,92,246,0.06) !important;
  border-radius: 14px !important;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.score-card:hover {
  background: rgba(20,28,50,0.55) !important;
  border-color: rgba(139,92,246,0.2) !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.25),
    0 0 20px rgba(139,92,246,0.06),
    inset 0 1px 0 rgba(255,255,255,0.04) !important;
}
.score-card.active {
  background: rgba(139,92,246,0.1) !important;
  border-color: rgba(139,92,246,0.3) !important;
  box-shadow:
    0 0 30px rgba(139,92,246,0.15),
    0 8px 32px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.06) !important;
}

/* ── Glass Stats ── */
.stat {
  background: rgba(15,22,40,0.4) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(139,92,246,0.06) !important;
  border-radius: 16px !important;
  transition: all 0.3s ease !important;
}
.stat:hover {
  border-color: rgba(139,92,246,0.15) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
}
.stat .num {
  font-size: 1.8rem !important;
  font-weight: 800 !important;
}

/* ── Hero polish ── */
.hero h1 {
  font-size: 2.8rem !important;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 30%, #a78bfa 70%, #8b5cf6 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: heroShimmer 8s ease-in-out infinite;
  background-size: 200% 200% !important;
}
@keyframes heroShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
[data-theme='light'] .hero h1 {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #7c3aed 70%, #6d28d9 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* Hero badge glow */
.hero-badge {
  background: rgba(139,92,246,0.08) !important;
  border: 1px solid rgba(139,92,246,0.2) !important;
  box-shadow: 0 0 20px rgba(139,92,246,0.1) !important;
  animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139,92,246,0.1); }
  50% { box-shadow: 0 0 30px rgba(139,92,246,0.2); }
}

/* ── FHE Flow glass ── */
.fhe-step {
  background: rgba(15,22,40,0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(139,92,246,0.08) !important;
  border-radius: 12px !important;
  transition: all 0.3s ease !important;
}
.fhe-step:hover {
  border-color: rgba(139,92,246,0.2) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;
}

/* ── Trust badges glass ── */
.trust-badge {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: 20px !important;
  transition: all 0.25s ease !important;
}
.trust-badge:hover {
  transform: scale(1.05) !important;
}
.trust-badge.fhe {
  box-shadow: 0 0 16px rgba(167,139,250,0.12) !important;
}

/* ── Section labels — subtle glow ── */
.section-label::before {
  box-shadow: 0 0 8px currentColor !important;
}

/* ── Compute area glass ── */
.compute-area, .compute-container, [class*="compute"] {
  border-radius: 20px !important;
}

/* ── Smooth scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.35); }

/* ── Grid spacing improvements ── */
.disease-grid {
  gap: 14px !important;
}
.score-grid {
  gap: 12px !important;
}

/* ── Section headers glass ── */
.section-header {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  transition: all 0.3s ease !important;
}
.section-header:hover {
  background: rgba(139,92,246,0.04) !important;
}

/* ── Action links glass ── */
.action-link {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border-radius: 20px !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.action-link:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 4px 16px rgba(139,92,246,0.15) !important;
}

/* ── Tweet section glass ── */
.tweet-section {
  background: rgba(15,22,40,0.3) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(139,92,246,0.06) !important;
  border-radius: 20px !important;
  padding: 24px !important;
}

/* ── Mobile enhancements ── */
@media (max-width: 600px) {
  .hero h1 { font-size: 2rem !important; }
  .stats-bar { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .disease-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .score-grid { grid-template-columns: repeat(2, 1fr) !important; }
  
  /* Swipe hint for score grid */
  .score-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 8px !important;
  }
  .score-card {
    min-width: 160px !important;
    scroll-snap-align: start !important;
    flex-shrink: 0 !important;
  }
}

/* ── Entrance animations ── */
.disease-card, .score-card, .stat, .fhe-step {
  animation: glassIn 0.6s ease-out both;
}
.disease-card:nth-child(1) { animation-delay: 0.05s; }
.disease-card:nth-child(2) { animation-delay: 0.1s; }
.disease-card:nth-child(3) { animation-delay: 0.15s; }
.disease-card:nth-child(4) { animation-delay: 0.2s; }
.disease-card:nth-child(5) { animation-delay: 0.25s; }
.disease-card:nth-child(6) { animation-delay: 0.3s; }
.disease-card:nth-child(7) { animation-delay: 0.35s; }
.disease-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes glassIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ── Nav links glass ── */
.nav-links {
  background: rgba(15,22,40,0.85) !important;
  backdrop-filter: blur(40px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(40px) saturate(1.5) !important;
  border: 1px solid rgba(139,92,246,0.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}
[data-theme='light'] .nav-links {
  background: rgba(255,255,255,0.85) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1) !important;
}

/* ── Frosted glass for control buttons ── */
.control-button, .nav-menu-trigger {
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
.control-button:hover, .nav-menu-trigger:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(139,92,246,0.12) !important;
}
