/* --------------------------------------------------
   CineAHO Blood Pressure Stage/Risk Checker
   Custom Styling - Premium Cyber Dark Theme
-------------------------------------------------- */

/* Root Theme Color Variables */
:root {
  --bg-color: #060913;
  --bg-grid: rgba(255, 255, 255, 0.015);
  
  --panel-bg: rgba(14, 20, 38, 0.55);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-hover-border: rgba(37, 99, 235, 0.35);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #475569;

  /* BP Level Specific Colors */
  --bp-blue: #0ea5e9;
  --bp-green: #10b981;
  --bp-yellow: #eab308;
  --bp-orange: #f97316;
  --bp-red: #ef4444;
  --bp-purple: #a855f7;
  
  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 16px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-color: #f0f4f8;
  --bg-grid: rgba(15, 23, 42, 0.02);
  
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(15, 23, 42, 0.08);
  --panel-hover-border: rgba(37, 99, 235, 0.45);
  
  --text-main: #0f172a;
  --text-muted: #57657a;
  --text-dark: #94a3b8;
  
  --shadow-card: 0 12px 35px 0 rgba(15, 23, 42, 0.07);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.4s ease, color 0.3s ease;
}

/* Background Grid Pattern */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Ambient Glow Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -3;
  pointer-events: none;
  opacity: 0.28;
  transition: opacity 0.5s ease;
}

.bg-glow-blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--bp-blue) 0%, transparent 70%);
  top: -150px;
  left: 5%;
}

.bg-glow-purple {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--bp-purple) 0%, transparent 70%);
  bottom: 10%;
  right: 5%;
}

[data-theme="light"] .bg-glow {
  opacity: 0.12;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

/* Header Styling */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 1.25rem 1.5rem 0 1.5rem;
  border-radius: 50px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-2px);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--bp-red);
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--bp-red);
  font-weight: 500;
}

.app-version {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--bp-red);
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.15rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--bp-red);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.15);
}

/* Calculator Layout Container */
.calculator-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 53% 47%;
  gap: 2rem;
  align-items: start;
}

/* Input Section Styling */
.input-section {
  padding: 2.25rem;
}

.panel-header {
  margin-bottom: 2rem;
}

.panel-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.panel-header h2 i {
  color: var(--bp-red);
}

.panel-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.input-group {
  margin-bottom: 2.25rem;
}

.input-group:last-of-type {
  margin-bottom: 1.75rem;
}

.input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.input-label-row label {
  font-size: 1.02rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.text-red {
  color: var(--bp-red);
}

.text-blue {
  color: var(--bp-blue);
}

.value-display {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 4px 12px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bg-red-opacity {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.bg-red-opacity strong {
  color: var(--bp-red);
  font-size: 1.35rem;
  font-weight: 800;
}

.bg-blue-opacity {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.bg-blue-opacity strong {
  color: var(--bp-blue);
  font-size: 1.35rem;
  font-weight: 800;
}

/* Range Sliders custom styling */
.slider-wrapper {
  margin-bottom: 0.85rem;
}

.styled-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  transition: background 0.3s;
}

[data-theme="light"] .styled-slider {
  background: rgba(15, 23, 42, 0.08);
}

/* Systolic red thumb */
.systolic-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bp-red);
  border: 4px solid var(--bg-color);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.systolic-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #f87171;
}

.systolic-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bp-red);
  border: 4px solid var(--bg-color);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.systolic-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #f87171;
}

/* Diastolic blue thumb */
.diastolic-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bp-blue);
  border: 4px solid var(--bg-color);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.6);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.diastolic-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #38bdf8;
}

.diastolic-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bp-blue);
  border: 4px solid var(--bg-color);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.6);
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.diastolic-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #38bdf8;
}

/* Preset Buttons */
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-preset {
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

[data-theme="light"] .btn-preset {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.05);
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--text-muted);
  color: var(--text-main);
}

.btn-preset.active {
  background: var(--text-main);
  border-color: var(--text-main);
  color: var(--bg-color);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Quick Checklist Guide Box */
.quick-measure-guide {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
}

[data-theme="light"] .quick-measure-guide {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.04);
}

.quick-measure-guide h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quick-measure-guide h4 i {
  color: var(--bp-green);
}

.quick-measure-guide ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-measure-guide ul li {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  position: relative;
  padding-left: 0.85rem;
}

.quick-measure-guide ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--bp-red);
  font-weight: bold;
}

/* Results Section styling */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.result-card {
  padding: 2.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  transition: var(--transition-smooth);
}

/* Glow Orb behind result card */
.status-indicator-dot {
  position: absolute;
  top: 15px;
  right: 20px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: var(--transition-smooth);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.result-display-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.result-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
}

.result-status-text {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.result-value-text {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.result-value-text small {
  font-size: 1.15rem;
  font-weight: 500;
  opacity: 0.75;
}

.result-risk-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 0.25rem;
}

.action-plan-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

.action-plan-box h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.action-plan-box h4 i {
  color: var(--bp-blue);
}

.action-plan-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Dynamic State Theme Styling for Result Cards */

/* 1. Hypotension (Blue) */
.bp-hypo {
  border-color: rgba(14, 165, 233, 0.25);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 25px rgba(14, 165, 233, 0.15);
}
.bp-hypo .status-indicator-dot { background: var(--bp-blue); box-shadow: 0 0 12px var(--bp-blue); }
.bp-hypo .result-status-text { color: var(--bp-blue); }
.bp-hypo .result-risk-badge { background: rgba(14, 165, 233, 0.1); border-color: rgba(14, 165, 233, 0.25); color: var(--bp-blue); }

/* 2. Normal (Green) */
.bp-normal {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 25px rgba(16, 185, 129, 0.15);
}
.bp-normal .status-indicator-dot { background: var(--bp-green); box-shadow: 0 0 12px var(--bp-green); }
.bp-normal .result-status-text { color: var(--bp-green); }
.bp-normal .result-risk-badge { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); color: var(--bp-green); }

/* 3. Elevated (Yellow) */
.bp-elevated {
  border-color: rgba(234, 179, 8, 0.25);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 25px rgba(234, 179, 8, 0.15);
}
.bp-elevated .status-indicator-dot { background: var(--bp-yellow); box-shadow: 0 0 12px var(--bp-yellow); }
.bp-elevated .result-status-text { color: var(--bp-yellow); }
.bp-elevated .result-risk-badge { background: rgba(234, 179, 8, 0.1); border-color: rgba(234, 179, 8, 0.25); color: var(--bp-yellow); }

/* 4. Stage 1 Hypertension (Orange) */
.bp-stage1 {
  border-color: rgba(249, 115, 22, 0.25);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 25px rgba(249, 115, 22, 0.15);
}
.bp-stage1 .status-indicator-dot { background: var(--bp-orange); box-shadow: 0 0 12px var(--bp-orange); }
.bp-stage1 .result-status-text { color: var(--bp-orange); }
.bp-stage1 .result-risk-badge { background: rgba(249, 115, 22, 0.1); border-color: rgba(249, 115, 22, 0.25); color: var(--bp-orange); }

/* 5. Stage 2 Hypertension (Red) */
.bp-stage2 {
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45), 0 0 25px rgba(239, 68, 68, 0.15);
}
.bp-stage2 .status-indicator-dot { background: var(--bp-red); box-shadow: 0 0 12px var(--bp-red); }
.bp-stage2 .result-status-text { color: var(--bp-red); }
.bp-stage2 .result-risk-badge { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); color: var(--bp-red); }

/* 6. Hypertensive Crisis (Purple) */
.bp-crisis {
  border-color: rgba(168, 85, 247, 0.4);
  background: radial-gradient(circle at center, rgba(168, 85, 247, 0.05) 0%, rgba(14, 20, 38, 0.7) 100%);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 35px rgba(168, 85, 247, 0.35);
  animation: crisisFlashingBorder 2s infinite ease-in-out alternate;
}
.bp-crisis .status-indicator-dot { background: var(--bp-purple); box-shadow: 0 0 12px var(--bp-purple); animation: crisisDotPulse 1s infinite alternate; }
.bp-crisis .result-status-text { color: var(--bp-purple); font-weight: 900; animation: textShimmer 1.5s infinite linear; }
.bp-crisis .result-risk-badge { background: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.35); color: var(--bp-purple); font-weight: 800; }

@keyframes crisisFlashingBorder {
  0% { border-color: rgba(168, 85, 247, 0.25); box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 20px rgba(168, 85, 247, 0.15); }
  100% { border-color: rgba(168, 85, 247, 0.55); box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 45px rgba(168, 85, 247, 0.45); }
}

@keyframes crisisDotPulse {
  0% { transform: scale(0.85); box-shadow: 0 0 6px var(--bp-purple); opacity: 0.7; }
  100% { transform: scale(1.2); box-shadow: 0 0 20px var(--bp-purple); opacity: 1; }
}

@keyframes textShimmer {
  0%, 100% { text-shadow: 0 0 5px rgba(168, 85, 247, 0.4); }
  50% { text-shadow: 0 0 15px rgba(168, 85, 247, 0.8); }
}

/* Metric Display Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.metric-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-icon {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.metric-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.metric-value small {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.75;
}

.metric-status {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 8px;
}

.status-normal {
  background: rgba(16, 185, 129, 0.1);
  color: var(--bp-green);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.status-warn {
  background: rgba(249, 115, 22, 0.1);
  color: var(--bp-orange);
  border: 1px solid rgba(249, 115, 22, 0.15);
}

.status-alert {
  background: rgba(239, 68, 68, 0.1);
  color: var(--bp-red);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.metric-footer {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.6rem;
}

/* Classification standard table styling */
.classification-section {
  padding: 2.25rem;
}

.section-title-wrapper {
  margin-bottom: 1.75rem;
}

.section-title-wrapper h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.section-title-wrapper h2 i {
  color: var(--bp-red);
}

.section-title-wrapper p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.table-container {
  overflow-x: auto;
}

.bp-class-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.bp-class-table th, 
.bp-class-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .bp-class-table th,
[data-theme="light"] .bp-class-table td {
  border-color: rgba(15, 23, 42, 0.06);
}

.bp-class-table th {
  font-weight: 700;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .bp-class-table th {
  background: rgba(15, 23, 42, 0.02);
}

.bp-class-table tbody tr {
  transition: var(--transition-smooth);
}

.bp-class-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

/* Conjunctions inside table values */
.conjunction-and,
.conjunction-or {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  margin: 0 4px;
  display: inline-block;
  vertical-align: middle;
}

.conjunction-and {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.conjunction-or {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

/* Status Badges */
.status-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-block;
}

.badge-blue { background: rgba(14, 165, 233, 0.1); color: var(--bp-blue); border: 1px solid rgba(14, 165, 233, 0.2); }
.badge-green { background: rgba(16, 185, 129, 0.1); color: var(--bp-green); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-yellow { background: rgba(234, 179, 8, 0.1); color: var(--bp-yellow); border: 1px solid rgba(234, 179, 8, 0.2); }
.badge-orange { background: rgba(249, 115, 22, 0.1); color: var(--bp-orange); border: 1px solid rgba(249, 115, 22, 0.2); }
.badge-red { background: rgba(239, 68, 68, 0.1); color: var(--bp-red); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-purple { background: rgba(168, 85, 247, 0.1); color: var(--bp-purple); border: 1px solid rgba(168, 85, 247, 0.2); }

/* Table highlight styles when active */
.row-active-hypo { background: rgba(14, 165, 233, 0.05) !important; }
.row-active-normal { background: rgba(16, 185, 129, 0.05) !important; }
.row-active-elevated { background: rgba(234, 179, 8, 0.05) !important; }
.row-active-stage1 { background: rgba(249, 115, 22, 0.05) !important; }
.row-active-stage2 { background: rgba(239, 68, 68, 0.05) !important; }
.row-active-crisis { background: rgba(168, 85, 247, 0.07) !important; font-weight: bold; }

.pulse-alert {
  animation: badgeAlertFlash 1s infinite alternate;
}

@keyframes badgeAlertFlash {
  0% { box-shadow: 0 0 0px rgba(168, 85, 247, 0); }
  100% { box-shadow: 0 0 10px rgba(168, 85, 247, 0.6); }
}

/* Habits Advice segment */
.habits-section {
  padding: 2.25rem;
}

.habits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.habit-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 1.75rem;
  transition: var(--transition-smooth);
}

[data-theme="light"] .habit-card {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.04);
}

.habit-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.habit-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.diet-icon { background: rgba(16, 185, 129, 0.1); color: var(--bp-green); }
.exercise-icon { background: rgba(14, 165, 233, 0.1); color: var(--bp-blue); }
.lifestyle-icon { background: rgba(249, 115, 22, 0.1); color: var(--bp-orange); }

.habit-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.habit-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.habit-card ul li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  position: relative;
  padding-left: 0.85rem;
}

.habit-card ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-muted);
  opacity: 0.6;
}

/* Guide Section styling */
.guide-section {
  padding: 2.5rem;
}

.guide-header {
  margin-bottom: 2.25rem;
}

.guide-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.guide-header h2 i {
  color: var(--bp-red);
}

.guide-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.25rem;
}

.guide-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 1.75rem;
  transition: var(--transition-smooth);
}

[data-theme="light"] .guide-card {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.04);
}

.guide-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.guide-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.6rem;
}

.guide-card h3 i {
  color: var(--bp-red);
}

.info-content-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 0.85rem;
}

.info-content-box p strong {
  color: var(--text-main);
  font-size: 0.88rem;
}

.desc-text {
  color: var(--text-muted);
  line-height: 1.5;
}

.card-line {
  height: 1px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  margin: 0.35rem 0;
}

/* Steps Checklist */
.steps-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.steps-checklist li {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.steps-checklist li strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.15rem;
}

/* FAQ Accordion list */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.faq-qa {
  display: flex;
  flex-direction: column;
  gap: 0.40rem;
}

.faq-q {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.faq-a {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Emergency card alert banner styling */
.emergency-alert-card {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(168, 85, 247, 0.04);
  border: 1px solid rgba(168, 85, 247, 0.25);
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.12);
  animation: crisisFlashingAlert 1.5s infinite ease-in-out alternate;
}

@keyframes crisisFlashingAlert {
  0% { border-color: rgba(168, 85, 247, 0.15); box-shadow: 0 0 10px rgba(168, 85, 247, 0.05); }
  100% { border-color: rgba(168, 85, 247, 0.4); box-shadow: 0 0 25px rgba(168, 85, 247, 0.2); }
}

.alert-icon-left {
  font-size: 2.2rem;
  color: var(--bp-purple);
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.6));
}

.alert-content-right h4 {
  color: var(--bp-purple);
  font-size: 0.98rem;
  font-weight: 800;
  margin-bottom: 0.45rem;
}

.alert-content-right p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Medical disclaimer notice box */
.medical-disclaimer {
  margin-top: 2.25rem;
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.02);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.medical-disclaimer h4 {
  color: var(--bp-red);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.medical-disclaimer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Footer styling */
.calculator-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------
   Responsive Design Breakpoints
-------------------------------------------------- */

@media (max-width: 1200px) {
  .habits-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 992px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  
  .main-header {
    margin: 1rem 1rem 0 1rem;
    padding: 0.75rem 1.25rem;
  }
  
  .input-section {
    padding: 1.75rem;
  }
  
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .logo-text {
    font-size: 0.95rem;
  }
  
  .app-version {
    display: none;
  }
  
  .main-header {
    padding: 0.5rem 1rem;
  }
  
  .calculator-container {
    padding: 1rem;
  }
  
  .result-value-text {
    font-size: 2.2rem;
  }
}
