/* ============================================================
   style.css — Modern Fitness Minimalism
   Design System: Vibrant orange accent on dark/light themes
   Fonts: Space Grotesk (display) + DM Sans (body)
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  /* --- Spacing scale (4px base) --- */
  --space-1: 0.25rem;  /* 4px  */
  --space-2: 0.5rem;   /* 8px  */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.5rem;   /* 24px */
  --space-6: 2rem;     /* 32px */
  --space-7: 3rem;     /* 48px */
  --space-8: 4rem;     /* 64px */

  /* --- Border radius --- */
  --radius-sm: 0.5rem;   /* 8px  */
  --radius-md: 0.75rem;  /* 12px */
  --radius-lg: 1rem;     /* 16px */
  --radius-xl: 1.5rem;   /* 24px */
  --radius-full: 9999px;

  /* --- Accent color (vibrant orange) --- */
  --accent: #ff6b35;
  --accent-light: #ff9f6b;
  --accent-dark: #cc5629;
  --accent-H: 16;
  --accent-S: 85%;
  --accent-L: 52%;

  /* --- Elevation (shadows) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   2. DARK THEME (default)
   ============================================================ */
[data-bs-theme="dark"] {
  --color-bg-primary: #0f0f0f;
  --color-bg-secondary: #141414;
  --color-bg-tertiary: #1a1a1a;
  --color-bg-elevated: #1e1e1e;
  --color-bg-accent: rgba(255, 107, 53, 0.12);

  --color-text-primary: #fafafa;
  --color-text-secondary: #a3a3a3;
  --color-text-tertiary: #737373;

  --color-border: #2a2a2a;
  --color-border-hover: #404040;

  /* Bootstrap overrides */
  --bs-body-bg: var(--color-bg-primary);
  --bs-body-color: var(--color-text-primary);
  --bs-secondary-bg: var(--color-bg-secondary);
  --bs-tertiary-bg: var(--color-bg-tertiary);
  --bs-border-color: var(--color-border);
  --bs-secondary-border-color: var(--color-border);
  --bs-secondary-color: var(--color-text-secondary);
  --bs-heading-color: var(--color-text-primary);
}

/* ============================================================
   3. LIGHT THEME
   ============================================================ */
[data-bs-theme="light"] {
  --color-bg-primary: #fafafa;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #f5f5f5;
  --color-bg-elevated: #ffffff;
  --color-bg-accent: rgba(255, 107, 53, 0.08);

  --color-text-primary: #0f0f0f;
  --color-text-secondary: #525252;
  --color-text-tertiary: #737373;

  --color-border: #e5e5e5;
  --color-border-hover: #d4d4d4;

  --bs-body-bg: var(--color-bg-primary);
  --bs-body-color: var(--color-text-primary);
  --bs-secondary-bg: var(--color-bg-secondary);
  --bs-tertiary-bg: var(--color-bg-tertiary);
  --bs-border-color: var(--color-border);
  --bs-secondary-border-color: var(--color-border);
  --bs-secondary-color: var(--color-text-secondary);
  --bs-heading-color: var(--color-text-primary);
}

/* ============================================================
   4. BASE STYLES & TYPOGRAPHY
   ============================================================ */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.9rem, 0.85vw + 0.75rem, 1rem);
  line-height: 1.6;
  font-weight: 400;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  margin: 0;
  overflow-x: hidden;
}

/* Display heading font (Space Grotesk) */
h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 2.5vw + 1rem, 2.25rem); }
h2 { font-size: clamp(1.4rem, 1.8vw + 0.9rem, 1.75rem); }
h3 { font-size: clamp(1.15rem, 1.4vw + 0.8rem, 1.35rem); }
h4 { font-size: clamp(1rem, 1.2vw + 0.7rem, 1.1rem); }
h5 { font-size: clamp(0.9rem, 1vw + 0.65rem, 1rem); }
h6 { font-size: clamp(0.8rem, 0.9vw + 0.6rem, 0.9rem); }

/* Card titles should use display font */
.card-title, .card h5, .card h6 {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

/* Navbar brand */
.navbar-brand {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

/* Utility: text truncate */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Link colors */
a {
  color: var(--color-text-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: none;
  color: var(--accent);
}

/* ============================================================
   5. SVG ICON SYSTEM
   ============================================================ */
.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

.icon-lg {
  width: 1.75rem;
  height: 1.75rem;
}

.icon-24 {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-brand {
  width: 1.75rem;
  height: 1.75rem;
}

/* ============================================================
   6. NAVBAR (top)
   ============================================================ */
.navbar {
  background-color: var(--color-bg-secondary) !important;
  border-bottom: 1px solid var(--color-border) !important;
  padding: var(--space-2) var(--space-4);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-primary);
}

.navbar-brand svg {
  color: var(--accent);
}

/* ============================================================
   7. BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.25rem;
  align-items: center;
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3);
  z-index: 1030;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 0.65rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
}

.bottom-nav-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

.bottom-nav-link:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-tertiary);
}

.bottom-nav-link.active {
  color: var(--accent);
  background-color: var(--color-bg-accent);
}

.bottom-nav-link.active svg {
  color: var(--accent);
}

/* ============================================================
   8. BUTTONS
   ============================================================ */
.btn {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-secondary {
  color: var(--color-text-secondary);
  border-color: var(--color-border);
  background-color: var(--color-bg-primary);
}

.btn-outline-secondary:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-tertiary);
  border-color: var(--color-border-hover);
}

.btn-ghost {
  background: transparent;
  border: none;
  padding: var(--space-1) var(--space-2);
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.btn-success {
  background-color: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
}

.btn-success:hover {
  background-color: #16a34a;
  border-color: #16a34a;
}

.btn-warning {
  background-color: #f59e0b;
  border-color: #f59e0b;
  color: #0f0f0f;
}

.btn-warning:hover {
  background-color: #d97706;
  border-color: #d97706;
}

.btn-danger {
  background-color: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

.btn-info {
  background-color: #0ea5e9;
  border-color: #0ea5e9;
  color: #ffffff;
}

.btn-info:hover {
  background-color: #0284c7;
  border-color: #0284c7;
}

.bg-amber {
  background-color: #f59e0b !important;
}

.text-accent-emphasis {
  color: var(--accent) !important;
}

.btn:disabled, .btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Outline primary variant */
.btn-outline-primary {
  color: var(--accent);
  border-color: var(--accent);
  background-color: transparent;
}

.btn-outline-primary:hover {
  color: #ffffff;
  background-color: var(--accent);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* ============================================================
   9. CARDS
   ============================================================ */
.card {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.card.h-100 {
  height: 100% !important;
}

.card-header {
  background-color: var(--color-bg-tertiary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
}

.card-body {
  flex: 1 1 auto;
  padding: var(--space-4);
}

.card-footer {
  background-color: var(--color-bg-tertiary);
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
}

.card-title {
  margin-bottom: 0.25rem;
  color: var(--color-text-primary);
}

.card-text {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.list-group .list-group-item {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-secondary);
  padding: var(--space-2) 0;
}

.list-group-flush .list-group-item {
  border: none;
  border-bottom: 1px solid var(--color-border);
  padding-left: 0;
  padding-right: 0;
}

.list-group-flush .list-group-item:last-child {
  border-bottom: none;
}

/* ============================================================
   10. HOME VIEW
   ============================================================ */
.home-header {
  margin-bottom: var(--space-5);
}

.home-header h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.home-header .text-secondary {
  font-size: 0.95rem;
}

.today-session-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #ffffff;
  border: none;
  overflow: hidden;
  position: relative;
}

.today-session-card::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  z-index: 0;
}

.today-session-card .card-body {
  position: relative;
  z-index: 1;
}

.today-session-card .text-secondary {
  color: rgba(255, 255, 255, 0.8) !important;
}

.today-session-card .btn-primary {
  background-color: #ffffff;
  color: var(--accent);
  font-weight: 600;
}

.today-session-card .btn-primary:hover {
  background-color: #f8f8f8;
  color: var(--accent-dark);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.section-title h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-buttons {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Series grid */
#seriesContainer {
  --bs-gutter-x: 0;
  --bs-gutter-y: 1rem;
}

/* ============================================================
   11. SERIES / SESSIONS CARDS
   ============================================================ */
.session-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.session-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.session-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
}

.session-exercises {
  list-style: none;
  padding: 0;
  margin: 0;
}

.session-exercises li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
}

.session-exercises li:last-child {
  border-bottom: none;
}

.session-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.session-actions .btn {
  flex: 1;
  min-width: 80px;
}

/* ============================================================
   12. PLAYER SCREEN (fullscreen)
   ============================================================ */
body.player-open {
  background-color: var(--color-bg-primary);
}

body.player-open .navbar,
body.player-open .bottom-nav {
  display: none;
}

.player-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-primary);
  overflow-y: auto;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) calc(1rem + env(safe-area-inset-bottom, 0px)) env(safe-area-inset-left, 0);
}

.player-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
}

.player-close-btn {
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.player-close-btn:hover {
  background-color: var(--color-bg-primary);
  color: var(--accent);
}

.player-gif {
  aspect-ratio: 1 / 1;
  max-height: 42vh;
  margin: var(--space-5) auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  position: relative;
  width: 100%;
  max-width: 400px;
}

.player-gif::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
  z-index: 0;
}

.player-gif img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
}

.player-info {
  text-align: center;
  margin-bottom: var(--space-5);
}

.player-info h2 {
  margin-bottom: var(--space-2);
  color: var(--color-text-primary);
}

.player-exercise-meta {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.player-exercise-meta .badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-sm);
}

.player-phase-badge {
  text-align: center;
  margin-bottom: var(--space-3);
}

.player-phase-badge .badge {
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.player-timer {
  font-size: clamp(3rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

.player-timer.text-success { color: #22c55e; }
.player-timer.text-warning { color: #f59e0b; }
.player-timer.text-secondary { color: var(--color-text-secondary); }

.player-set-label {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-2);
}

.player-instructions {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.player-instructions li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.player-instructions li:last-child {
  border-bottom: none;
}

.player-instructions li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
  margin-top: 0.4rem;
  flex-shrink: 0;
}

.player-controls {
  display: flex;
  gap: 0.5rem;
  margin: var(--space-4) 0;
  flex-wrap: wrap;
}

.player-controls .btn {
  flex: 1;
}

.player-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.player-nav .btn {
  flex: 1;
  border-radius: var(--radius-lg);
}

/* Player completed screen */
.player-completed {
  text-align: center;
  padding: var(--space-5);
}

.player-completed .display-3 {
  font-size: clamp(3rem, 12vw, 5rem);
  margin-bottom: var(--space-4);
  color: var(--accent);
}

/* ============================================================
   13. PROGRESS VIEW
   ============================================================ */
.stat-card {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.stat-card .stat-icon {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: var(--space-1);
}

.stat-card .stat-value {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  font-weight: 700;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--color-text-primary);
}

.stat-card .stat-label {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.weight-form-card {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.weight-form-card .card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
}

.weight-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-border);
}

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

.weight-history-item .weight-value {
  font-weight: 600;
  color: var(--color-text-primary);
}

.chart-wrap {
  position: relative;
  height: 260px;
  min-height: 200px;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
}

/* ============================================================
   14. ACHIEVEMENT TOASTS
   ============================================================ */
.achievement-toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  box-shadow: var(--shadow-lg);
  max-width: 340px;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.achievement-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.achievement-toast-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.achievement-toast-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-primary);
}

.achievement-toast-desc {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-top: 0.1rem;
}

/* ============================================================
    15. NUTRITION VIEW
    ============================================================ */
.macro-progress .progress-bar {
  transition: width 0.3s ease;
}

.meal-card-active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.nutrition-tab .nav-link {
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
  color: var(--color-text-secondary);
}

.nutrition-tab .nav-link.active {
  background-color: var(--accent) !important;
  color: #ffffff;
}

/* ============================================================
    16. QUIZ / PLANNER
    ============================================================ */
.quiz-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.quiz-wrap h1 {
  margin-bottom: var(--space-2);
  text-align: center;
}

.quiz-progress {
  height: 6px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: var(--color-bg-tertiary);
  margin-bottom: var(--space-4);
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
  transition: width 0.3s ease;
}

.quiz-step {
  margin-bottom: var(--space-5);
}

.quiz-step h5 {
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quiz-options .btn {
  min-height: 52px;
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-secondary);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quiz-options .btn:hover {
  background-color: var(--color-bg-accent);
  border-color: var(--accent);
  color: var(--accent);
}

.quiz-options .btn-check:checked + .btn,
.quiz-options .btn-check + .btn:active {
  background-color: var(--color-bg-accent);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-4);
  gap: var(--space-2);
  flex-wrap: wrap;
}

.quiz-nav .btn {
  flex: 1;
}

/* Plan view */
.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.plan-header h1 {
  margin: 0;
}

.plan-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.plan-week-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-md);
}

.plan-week-controls .btn {
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-week-controls .week-number {
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
}

.plan-day-card {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  transition: all 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.plan-day-card.today {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent)20;
}

.plan-day-card.rest {
  opacity: 0.6;
}

.plan-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.plan-day-header .day-name {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.plan-day-header .today-badge {
  background-color: var(--accent);
  color: #ffffff;
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.plan-day-card .session-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.plan-day-card .session-meta {
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  margin-bottom: var(--space-2);
}

.plan-day-card .exercise-list {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-top: auto;
}

.plan-day-card .exercise-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.82rem;
}

.plan-day-card .exercise-list li:last-child {
  border-bottom: none;
}

.train-today-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  margin-top: auto;
  transition: all 0.2s ease;
}

.train-today-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}

/* ============================================================
    17. MODALS
   ============================================================ */
.modal-content {
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.modal-header {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4);
}

.modal-title {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

.modal-body {
  padding: var(--space-4);
}

.modal-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
}

.modal-dialog.scrollable {
  height: 90vh;
  max-height: 90vh;
}

.modal-dialog .modal-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Form controls */
.form-control {
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  background-color: var(--color-bg-secondary);
  border-color: var(--accent);
  color: var(--color-text-primary);
  box-shadow: 0 0 0 3px var(--color-bg-accent);
}

.form-control::placeholder {
  color: var(--color-text-tertiary);
}

.form-label {
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.form-control-lg {
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
}

/* Button group for radio style */
.btn-group .btn-check:checked + .btn,
.btn-group .btn-check + .btn:active {
  background-color: var(--color-bg-tertiary);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
    18. TABLE STYLES
   ============================================================ */
.table {
  margin-bottom: 1rem;
}

.table th {
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.table-hover tbody tr:hover {
  background-color: var(--color-bg-tertiary);
}

.table-responsive {
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ============================================================
    19. LIST GROUPS
   ============================================================ */
.list-group-item {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-primary);
  padding: 0.5rem 0;
}

.list-group-item .text-secondary {
  color: var(--color-text-secondary) !important;
}

/* Session log items */
.session-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

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

.session-log-title {
  color: var(--color-text-primary);
  font-weight: 500;
}

.session-log-meta {
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ============================================================
    20. PLACEHOLDER VIEWS
   ============================================================ */
.placeholder-view {
  text-align: center;
  padding: var(--space-5) 0;
}

.placeholder-view .display-icon {
  font-size: clamp(4rem, 12vw, 6rem);
  margin-bottom: var(--space-3);
  opacity: 0.4;
}

.placeholder-view h1 {
  font-weight: 600;
  color: var(--color-text-primary);
}

.placeholder-view .text-secondary {
  color: var(--color-text-secondary) !important;
  max-width: 420px;
  margin: 0 auto;
}

/* ============================================================
    21. BODIES & LAYOUT
   ============================================================ */
.container {
  max-width: 1100px;
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.container-fluid {
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}

.row {
  margin-left: calc(var(--space-2) * -1);
  margin-right: calc(var(--space-2) * -1);
}

.row > * {
  padding-left: var(--space-2);
  padding-right: var(--space-2);
}

/* Gap utilities */
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }

/* Flex utilities */
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }

/* ============================================================
    22. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Mobile first (already handled) */

/* Tablet */
@media (min-width: 576px) {
  .bottom-nav {
    gap: 0.25rem;
  }

  .bottom-nav-link {
    font-size: 0.7rem;
    padding: var(--space-2) var(--space-3);
  }

  .plan-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop */
@media (min-width: 768px) {
  .plan-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 992px) {
  .plan-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Desktop shows more cards in row */
  #seriesContainer {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .plan-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ============================================================
    23. UTILITY CLASSES
    24. ============================================================ */

/* Visually hidden for accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Transition helpers */
.transition-fast {
  transition: all 0.15s ease;
}

.transition-norm {
  transition: all 0.25s ease;
}

.transition-slow {
  transition: all 0.4s ease;
}

/* Transform hover effect */
.hover-lift {
  transition: transform 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
}

/* Text color helpers */
.text-accent {
  color: var(--accent) !important;
}

.text-muted-custom {
  color: var(--color-text-secondary) !important;
}

/* Background helpers */
.bg-accent-bg {
  background-color: var(--color-bg-accent);
}

/* Border helpers */
.border-accent {
  border-color: var(--accent) !important;
}

/* Badge variants */
.badge.bg-secondary-subtle {
  background-color: var(--color-bg-tertiary) !important;
  color: var(--color-text-secondary) !important;
}

.badge.bg-primary-subtle {
  background-color: var(--color-bg-accent) !important;
  color: var(--accent) !important;
}

.badge.bg-success {
  background-color: #22c55e !important;
}

.badge.bg-warning {
  background-color: #f59e0b !important;
}

.badge.bg-danger {
  background-color: #ef4444 !important;
}

.badge.bg-info {
  background-color: #0ea5e9 !important;
}

/* Timer numeric display */
.timer-display {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
    25. DARK MODE SPECIFIC ADJUSTMENTS
   ============================================================ */
[data-bs-theme="dark"] .navbar {
  background-color: var(--color-bg-secondary) !important;
}

[data-bs-theme="dark"] .bottom-nav {
  background-color: var(--color-bg-elevated);
  border-color: var(--color-border);
}

[data-bs-theme="light"] .bottom-nav {
  background-color: #ffffff;
  border-color: var(--color-border);
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
}

/* ============================================================
    26. ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

.animate-fade-scale {
  animation: fadeScale 0.3s ease forwards;
}

/* Staggered card reveals for series */
#seriesContainer .card,
.plan-grid .plan-day-card,
.achievement-grid .achievement-card {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

#seriesContainer .card:nth-child(1) { animation-delay: 0.05s; }
#seriesContainer .card:nth-child(2) { animation-delay: 0.1s; }
#seriesContainer .card:nth-child(3) { animation-delay: 0.15s; }
#seriesContainer .card:nth-child(4) { animation-delay: 0.2s; }
#seriesContainer .card:nth-child(5) { animation-delay: 0.25s; }
#seriesContainer .card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================
    27. PRINT STYLES
   ============================================================ */
@media print {
  .bottom-nav, .navbar, body.player-open .navbar {
    display: none !important;
  }
}

/* ============================================================
    28. SELECT / INPUT ADJUSTMENTS
   ============================================================ */
select.form-control:focus,
input.form-control:focus,
textarea.form-control:focus {
  box-shadow: none;
}

/* Number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  opacity: 0;
  pointer-events: none;
}

input[type="number"]:hover::-webkit-outer-spin-button,
input[type="number"]:hover::-webkit-inner-spin-button {
  opacity: 0.5;
}

/* ============================================================
    29. CHALLENGES + PROFILE (Fase 5)
   ============================================================ */
.challenge-card {
  background-color: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.challenge-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.challenge-progress {
  height: 6px;
  border-radius: 3px;
  background-color: var(--color-border);
}

.challenge-progress .progress-bar {
  background-color: var(--accent);
  border-radius: 3px;
}

.profile-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border);
}

.profile-summary-row:last-of-type {
  border-bottom: none;
}

.photo-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3);
}

.photo-timeline-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md, 0.5rem);
  background-color: var(--color-border);
}

.photo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

/* ============================================================
   Media manager (#/medios) — apartado de subida por cámara/archivo
   ============================================================ */
#mediaCameraVideo {
  background-color: #000;
}
#mediaCameraPreview img {
  border: 1px solid var(--color-border);
}
.media-card-thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border);
}

/* ============================================================
   Help modal (Fase 5) — content styling
   ============================================================ */
.help-content h3 {
  font-family: "Space Grotesk", var(--font-display, sans-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}
.help-content h3:first-child { margin-top: 0; }
.help-content p { margin-bottom: 0.75rem; }
.help-content ul,
.help-content ol { margin-bottom: 0.75rem; padding-left: 1.25rem; }
.help-content li { margin-bottom: 0.25rem; }
.help-content code {
  background: var(--color-border, rgba(128, 128, 128, 0.25));
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.85em;
}
.help-table {
  font-size: 0.85rem;
}
.help-table th {
  font-weight: 600;
  white-space: nowrap;
}
.help-tabs .nav-link {
  font-size: 0.85rem;
}
