/**
 * ============================================================
 * STYLE.CSS — "Midnight Manor" Theme for Vitals
 * ============================================================
 * All visual styling for the application.
 *
 * SECTIONS:
 *   1. CSS Variables (Design Tokens)
 *   2. Reset & Base Styles
 *   3. Typography
 *   4. Layout (Hero, Upload, Loading, Results, Footer)
 *   5. Component Classes (Glass Cards, Buttons, Glows)
 *   6. Utility Classes
 *   7. Animations
 * ============================================================
 */

/* ─── 1. CSS VARIABLES (Design Tokens) ─────────────────────── */
:root {
  /* Main background and text colors */
  --bg-primary:       #05070A;          /* Matte black body */
  --bg-card:          rgba(255,255,255,0.03); /* Glass card fill */
  --text-primary:     #C8BFA6;          /* Champagne Slate (main text) */
  --text-muted:       #6B7280;          /* Subdued text */
  --text-muted-light: rgba(107,114,128,0.5);

  /* Gold palette (Burnished Gold accent) */
  --gold:             #997B41;
  --gold-light:       #C9A84C;
  --gold-border:      rgba(153,123,65,0.25);
  --gold-border-strong: rgba(153,123,65,0.35);
  --gold-glow:        rgba(153,123,65,0.2);
  --gold-subtle:      rgba(197,160,89,0.12);

  /* Status colors for lab results */
  --color-success:    #6B9A7D;          /* Peak (normal) — muted green */
  --color-warning:    #997B41;          /* Surplus (high) — gold */
  --color-danger:     #C45A5A;          /* Deficit (low) — muted red */

  /* Font families */
  --font-heading:     'Playfair Display', Georgia, serif;
  --font-body:        'Inter', system-ui, sans-serif;

  /* Border radius */
  --radius:           2.5rem;
}


/* ─── 2. RESET & BASE STYLES ──────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ─── 3. TYPOGRAPHY ───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.1;
}


/* ─── 4. LAYOUT ───────────────────────────────────────────── */

/* -- App Container -- */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* -- Hero Section -- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  animation: fadeInUp 1s ease-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(153,123,65,0.15), rgba(153,123,65,0.05));
  border: 1px solid rgba(153,123,65,0.4);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.6s 0.4s both;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 64rem;
  animation: fadeInUp 0.9s 0.2s both;
}

.hero-title-white {
  color: var(--text-primary);
}

.hero-title-gold {
  font-style: italic;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  margin-top: 2rem;
  max-width: 28rem;
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  animation: fadeIn 0.7s 0.6s both;
}

/* -- Upload Zone -- */
.upload-zone {
  display: flex;
  justify-content: center;
  padding: 0 1.5rem 2rem;
  animation: fadeInUp 0.8s 0.7s both;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 42rem;
  padding: 3.5rem 2rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-label:hover {
  transform: scale(1.03);
}

.upload-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: rgba(153,123,65,0.1);
  border: 1px solid rgba(153,123,65,0.2);
  animation: float 3s ease-in-out infinite;
}

.upload-icon {
  color: var(--gold);
}

.upload-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.upload-formats {
  font-size: 0.75rem;
  color: var(--text-muted-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -- Loading Screen -- */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 6rem 1.5rem;
  max-width: 32rem;
  margin: 0 auto;
  animation: fadeIn 0.6s ease;
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  animation: pulse 2s infinite;
}

.progress-track {
  width: 100%;
  height: 0.625rem;
  border-radius: 1rem;
  background: rgba(153,123,65,0.1);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 1rem;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 0.4s ease-out;
}

.loading-status {
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* -- Results Screen -- */
.results-screen {
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  animation: fadeIn 0.6s ease;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.results-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-subtitle {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.results-reset-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* -- Summary Card -- */
.summary-card {
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
  text-align: center;
}

.summary-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-subtitle {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* -- Result Cards Container -- */
.results-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* -- Individual Result Card -- */
.result-card {
  padding: 1.25rem 1.5rem;
  animation: fadeInUp 0.5s ease-out both;
}

.result-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-test-name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.result-value-group {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.result-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-body);
}

.result-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* -- Status Badge + Reference Range row -- */
.result-middle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
}

/* Badge color variants */
.badge-peak {
  color: var(--color-success);
  background: rgba(107,154,125,0.1);
  border-color: rgba(107,154,125,0.3);
}

.badge-surplus {
  color: var(--color-warning);
  background: rgba(153,123,65,0.1);
  border-color: rgba(153,123,65,0.3);
}

.badge-deficit {
  color: var(--color-danger);
  background: rgba(196,90,90,0.1);
  border-color: rgba(196,90,90,0.3);
}

/* Value color variants */
.value-peak    { color: var(--color-success); }
.value-surplus { color: var(--color-warning); }
.value-deficit { color: var(--color-danger); }

.result-ref {
  font-size: 0.75rem;
  color: var(--text-muted-light);
  letter-spacing: 0.03em;
}

/* -- Insight text (bottom row of each card) -- */
.result-insight {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* -- Footer -- */
.footer {
  padding: 4rem 1.5rem;
  text-align: center;
  margin-top: auto;
}

.footer-line {
  width: 4rem;
  height: 1px;
  background: rgba(153,123,65,0.3);
  margin: 0 auto 1rem;
}

.footer-disclaimer-label {
  font-size: 0.75rem;
  color: var(--text-muted-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-disclaimer {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgba(107,114,128,0.4);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.footer-copyright {
  margin-top: 1.5rem;
  font-size: 0.625rem;
  color: rgba(107,114,128,0.3);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}


/* ─── 5. COMPONENT CLASSES ────────────────────────────────── */

/* Glass Card (standard) — frosted glass with gold border */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 20px rgba(153,123,65,0.08);
}

/* Glass Card (large) — stronger blur for hero-level cards */
.glass-card-lg {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--gold-border-strong);
  box-shadow: 0 8px 48px rgba(0,0,0,0.55), 0 0 30px rgba(153,123,65,0.06);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: var(--radius);
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}

/* Gold button — transparent with gold border */
.btn-gold {
  background: linear-gradient(135deg, rgba(153,123,65,0.15), rgba(153,123,65,0.05));
  border: 1px solid rgba(153,123,65,0.4);
  border-radius: var(--radius);
  color: var(--gold-light);
  box-shadow: 0 0 24px rgba(153,123,65,0.12);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-gold:hover {
  background: linear-gradient(135deg, rgba(153,123,65,0.25), rgba(153,123,65,0.1));
  box-shadow: 0 0 40px rgba(153,123,65,0.25), 0 0 80px rgba(153,123,65,0.1);
  transform: scale(1.03);
}

/* Glow effects */
.glow-gold {
  box-shadow: 0 0 40px var(--gold-glow), 0 0 80px rgba(153,123,65,0.08);
}

.glow-gold-subtle {
  box-shadow: 0 0 30px var(--gold-subtle), 0 0 60px rgba(197,160,89,0.06);
}


/* ─── 6. UTILITY CLASSES ──────────────────────────────────── */
.hidden { display: none !important; }


/* ─── 7. ANIMATIONS ───────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(1.5rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-0.5rem); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes shimmer {
  from { background-position: 0% 0%; }
  to   { background-position: 200% 0%; }
}


/* ─── 8. RESPONSIVE ───────────────────────────────────────── */
@media (min-width: 768px) {
  .upload-label { padding: 5rem 3rem; }
  .upload-title { font-size: 1.875rem; }
  .results-screen { padding: 2.5rem 1.5rem; }
  .results-title { font-size: 2.25rem; }
  .result-card { padding: 1.5rem 1.75rem; }
  .result-test-name { font-size: 1.25rem; }
  .result-value { font-size: 2rem; }
  .summary-title { font-size: 1.5rem; }
}
