/* Modern Athletic Design System */
:root {
  --bg-color: #080d16;
  --panel-bg: rgba(13, 20, 35, 0.65);
  --border-color: rgba(255, 255, 255, 0.06);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  /* Axis Colors */
  --color-endurance: #00f2fe;
  --color-strength: #ff5858;
  --color-hybrid: #a18cd1;
  --color-hybrid-dark: #8a2be2;
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body.light-theme {
  --bg-color: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.75);
  --border-color: rgba(15, 23, 42, 0.08);
  --text-primary: #0f172a;
  --text-secondary: #475569;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Glowing Orbs */
body::before, body::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}
body::before {
  top: 10%;
  left: 10%;
  background: var(--color-endurance);
}
body::after {
  bottom: 20%;
  right: 10%;
  background: var(--color-strength);
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  margin-bottom: 2.5rem;
  text-align: center;
}

header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--color-endurance), var(--color-hybrid), var(--color-strength));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Responsive collapse */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphism Panels */
.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.panel-title.strength { color: var(--color-strength); }
.panel-title.endurance { color: var(--color-endurance); }
.panel-title.hybrid { color: var(--color-hybrid); }

/* Form Fields */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

input[type="number"], input[type="text"], select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 0.75rem;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.2s;
}

input[type="number"]:focus, input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--color-hybrid);
  box-shadow: 0 0 0 2px rgba(161, 140, 209, 0.2);
}

/* Toggle Buttons */
.segmented-control {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  padding: 2px;
}

.segmented-control button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.segmented-control button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.segmented-control.strength button.active {
  background: var(--color-strength);
  color: #fff;
}

.segmented-control.endurance button.active {
  background: var(--color-endurance);
  color: #0b0f19;
}

/* Results Display */
.score-hero {
  text-align: center;
  padding: 1rem 0;
}

.score-circles-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.12) 0%, rgba(138, 43, 226, 0.02) 70%);
  border: 3px solid var(--color-hybrid);
  box-shadow: 0 0 15px rgba(161, 140, 209, 0.2);
  position: relative;
}

.score-circle::before {
  content: '';
  position: absolute;
  top: -6px; left: -6px; right: -6px; bottom: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(161, 140, 209, 0.4);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

.score-value {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.score-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  max-width: 110px;
  line-height: 1.3;
}

.classification-tag {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(161, 140, 209, 0.15);
  color: var(--color-hybrid);
  border: 1px solid rgba(161, 140, 209, 0.3);
  margin-top: 0.5rem;
}

/* Metrics Cards Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.metric-card .title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.metric-card .value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.metric-card .subtext {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.metric-card.strength-accent .value { color: var(--color-strength); }
.metric-card.endurance-accent .value { color: var(--color-endurance); }

/* Chart and Canvas */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

canvas#quadrantChart {
  width: 100%;
  max-width: 450px;
  aspect-ratio: 1 / 1;
  background: transparent;
}

/* Sliders */
.slider-group {
  margin-bottom: 1.25rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.slider-header span.val {
  color: var(--text-primary);
  font-weight: 700;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-hybrid);
  cursor: pointer;
  box-shadow: 0 0 8px var(--color-hybrid);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.slider-group.strength input[type="range"]::-webkit-slider-thumb {
  background: var(--color-strength);
  box-shadow: 0 0 8px var(--color-strength);
}

.slider-group.endurance input[type="range"]::-webkit-slider-thumb {
  background: var(--color-endurance);
  box-shadow: 0 0 8px var(--color-endurance);
}

/* Accordions for Explanations */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1rem;
}

.accordion-item {
  border-bottom: 1px solid var(--border-color);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: none;
  color: var(--text-primary);
  padding: 1rem;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.accordion-content {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: none;
  line-height: 1.6;
}

.accordion-content p {
  margin-bottom: 0.75rem;
}

.accordion-content p:last-child {
  margin-bottom: 0;
}

.accordion-content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: monospace;
}

.accordion-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.accordion-content th, .accordion-content td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: center;
}

.accordion-content th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

/* Action Buttons */
.btn-container {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--color-hybrid-dark), #4a00e0);
  border: none;
  color: #fff;
  padding: 0.85rem;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(138, 43, 226, 0.25);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

.btn.btn-outline {
  background: transparent;
  border: 1px solid rgba(161, 140, 209, 0.4);
  color: var(--color-hybrid);
  box-shadow: none;
}

.btn.btn-outline:hover {
  background: rgba(161, 140, 209, 0.08);
}

/* Running Pace Table */
.pace-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.pace-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}

.pace-box .lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pace-box .val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Light Theme Specific Adjustments */
body.light-theme::before, body.light-theme::after {
  opacity: 0.06;
}

body.light-theme .panel {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

body.light-theme input[type="number"], 
body.light-theme input[type="text"], 
body.light-theme select,
body.light-theme .segmented-control,
body.light-theme .accordion-header,
body.light-theme .pace-box {
  background: rgba(15, 23, 42, 0.04);
}

body.light-theme .segmented-control button.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

body.light-theme .segmented-control.strength button.active {
  background: var(--color-strength);
  color: #fff;
}

body.light-theme .segmented-control.endurance button.active {
  background: var(--color-endurance);
  color: #0f172a;
}

body.light-theme .score-circle {
  background: radial-gradient(circle, rgba(138, 43, 226, 0.08) 0%, rgba(138, 43, 226, 0.01) 70%);
  box-shadow: 0 0 20px rgba(161, 140, 209, 0.15);
}

body.light-theme .metric-card {
  background: rgba(15, 23, 42, 0.02);
}

body.light-theme .accordion-content {
  background: rgba(15, 23, 42, 0.02);
}

body.light-theme .accordion-content code {
  background: rgba(15, 23, 42, 0.06);
}

.sim-table tr {
  border-bottom: 1px solid var(--border-color);
}
