/* =====================================================
   EXERCISE LIBRARY - CSS STYLES
   Aging Gracefully 102
   ===================================================== */

/* CSS Variables */
:root {
  --accent-green: #2D5A3D;
  --accent-green-light: #3D7A4D;
  --accent-gold: #D4A84B;
  --accent-gold-light: #E5C97A;
  --bg-dark: #0a0f0d;
  --bg-card: #111816;
  --bg-card-hover: #1a2420;
  --text-primary: #e8f0ec;
  --text-secondary: #a8b8b0;
  --text-muted: #6a7a72;
  --border-color: rgba(45, 90, 61, 0.3);

  /* EMG Confidence Colors */
  --confidence-high: #22c55e;
  --confidence-moderate: #eab308;
  --confidence-low: #f97316;
  --confidence-unverified: #6b7280;

  /* Accessibility */
  --min-touch-target: 44px;
  --focus-ring: 0 0 0 3px rgba(212, 168, 75, 0.5);
}

/* =====================================================
   BODY OUTLINE VISIBILITY FIX
   Ensure body silhouette is always visible in SVG diagrams
   ===================================================== */

.body-outline,
svg .body-outline,
#body-front .body-outline,
#body-back .body-outline,
#body-outline .body-outline,
#body-outline-back .body-outline {
  fill: rgba(245, 230, 211, 0.85) !important;
  stroke: rgba(200, 180, 160, 0.6) !important;
  stroke-width: 0.5 !important;
  opacity: 1 !important;
}

/* =====================================================
   LAYOUT & GENERAL STYLES
   ===================================================== */

.exercise-library {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.exercise-library section {
  margin-bottom: 4rem;
}

.exercise-library h2 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Navigation enhancements */
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  min-height: var(--min-touch-target);
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(45, 90, 61, 0.2);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(45, 90, 61, 0.3);
  border-bottom: 2px solid var(--accent-green);
}

/* =====================================================
   USER NAV SECTION
   ===================================================== */

.nav-user-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Guest state - Log In / Get Started buttons */
.nav-guest {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-nav-login {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-nav-login:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-nav-signup {
  background: var(--accent-green);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-nav-signup:hover {
  background: var(--accent-green-hover, #3a9956);
  transform: translateY(-1px);
}

/* User state - Greeting + Dropdown */
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.user-tier-badge {
  background: var(--accent-gold);
  color: #000;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.user-tier-badge:not(.premium) {
  display: none;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.user-menu-btn:hover,
.user-menu-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-green);
}

.user-menu-btn .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}

.user-menu-btn.active .chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 180px;
  padding: 0.5rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 0.25rem 0;
}

.user-dropdown .upgrade-link {
  color: var(--accent-gold);
}

.user-dropdown .upgrade-link:hover {
  background: rgba(212, 168, 75, 0.1);
}

/* =====================================================
   HERO SECTION - MUSCLE MAP
   ===================================================== */

.hero-section {
  text-align: center;
  padding: 3rem 0;
}

.hero-content h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.muscle-map-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
}

.muscle-map-wrapper {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  max-width: 600px;
  width: 100%;
}

/* View Toggle Buttons */
.view-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.view-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: var(--min-touch-target);
}

.view-btn:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--accent-green);
  border-color: var(--accent-green);
  color: white;
}

.view-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Muscle Maps */
.muscle-maps {
  display: flex;
  justify-content: center;
}

.muscle-map {
  width: 100%;
  max-width: 300px;
}

.muscle-map.hidden {
  display: none;
}

/* Index page inline SVG muscle styling */
.muscle-map .muscle-region {
  fill: #c49485;
  stroke: #b8847a;
  stroke-width: 0.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.muscle-map .muscle-region:hover,
.muscle-map .muscle-region.hovered {
  fill: #5ba3b8;
  stroke: #4a90a4;
  stroke-width: 1;
}

.muscle-map .muscle-region.selected {
  fill: #3dcc71;
  stroke: #27ae60;
  stroke-width: 1;
}

.body-svg {
  width: 100%;
  height: auto;
}

.body-part {
  fill: rgba(45, 90, 61, 0.2);
  stroke: var(--accent-green);
  stroke-width: 1;
}

/* Muscle Regions - Interactive */
.muscle-region {
  fill: rgba(45, 90, 61, 0.4);
  stroke: var(--accent-green);
  stroke-width: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.muscle-region:hover {
  fill: rgba(212, 168, 75, 0.5);
  stroke: var(--accent-gold);
  stroke-width: 2;
}

.muscle-region.active {
  fill: rgba(212, 168, 75, 0.6);
  stroke: var(--accent-gold);
  stroke-width: 2.5;
}

/* Muscle Tooltip */
.muscle-tooltip {
  position: absolute;
  background: var(--bg-dark);
  border: 1px solid var(--accent-gold);
  border-radius: 8px;
  padding: 1rem;
  max-width: 250px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.muscle-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.muscle-tooltip h4 {
  color: var(--accent-gold);
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.muscle-tooltip p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.tooltip-cta {
  color: var(--accent-green-light);
  font-size: 0.85rem;
  font-style: italic;
}

.map-instructions {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =====================================================
   CATEGORY CARDS SECTION
   ===================================================== */

.categories-section {
  padding: 2rem 0;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-green);
  background: var(--bg-card-hover);
}

.category-card:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.category-card h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.category-count {
  color: var(--accent-gold);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.category-all {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 75, 0.05);
}

.category-all:hover {
  border-color: var(--accent-gold-light);
  background: rgba(212, 168, 75, 0.1);
}

/* =====================================================
   GOAL CARDS SECTION
   ===================================================== */

.goals-section {
  padding: 2rem 0;
}

.goal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.goal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.goal-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-green);
  background: var(--bg-card-hover);
}

.goal-card:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.goal-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.goal-card h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

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

.goal-exercises li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 0.3rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.goal-exercises li::before {
  content: "•";
  color: var(--accent-green);
  position: absolute;
  left: 0;
}

/* =====================================================
   ESSENTIAL 10 SECTION
   ===================================================== */

.essential-section {
  padding: 2rem 0;
}

.essential-card {
  background: linear-gradient(135deg, rgba(45, 90, 61, 0.2) 0%, rgba(212, 168, 75, 0.1) 100%);
  border: 2px solid var(--accent-gold);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.essential-badge {
  display: inline-block;
  background: var(--accent-gold);
  color: var(--bg-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.essential-card h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.essential-card > p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.essential-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.essential-item {
  background: rgba(45, 90, 61, 0.3);
  border: 1px solid var(--accent-green);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--min-touch-target);
  border: none;
}

.btn-primary {
  background: var(--accent-green);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-green-light);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
}

.btn-outline:hover {
  background: var(--accent-green);
  color: white;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* =====================================================
   FEATURED EXERCISES SECTION
   ===================================================== */

.featured-section {
  padding: 2rem 0;
}

.exercise-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.exercise-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s ease;
}

.exercise-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-green);
}

.exercise-card:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.exercise-card-thumbnail {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, rgba(45, 90, 61, 0.3) 0%, rgba(45, 90, 61, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.exercise-card-thumbnail .placeholder-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.exercise-card-content {
  padding: 1.5rem;
}

.exercise-card h3 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.exercise-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--confidence-high);
}

.difficulty-badge.intermediate {
  background: rgba(234, 179, 8, 0.15);
  color: var(--confidence-moderate);
}

.difficulty-badge.advanced {
  background: rgba(249, 115, 22, 0.15);
  color: var(--confidence-low);
}

.exercise-card-muscles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.muscle-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.section-cta {
  text-align: center;
  margin-top: 2rem;
}

/* =====================================================
   EMG CONFIDENCE SECTION
   ===================================================== */

.emg-section {
  padding: 2rem 0;
}

.emg-explanation {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .emg-explanation {
    grid-template-columns: 1fr 1fr;
  }
}

.emg-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.emg-card h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin: 0 0 1rem;
}

.emg-card > p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.confidence-legend {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.confidence-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.confidence-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.confidence-dot.high {
  background: var(--confidence-high);
}

.confidence-dot.moderate {
  background: var(--confidence-moderate);
}

.confidence-dot.low {
  background: var(--confidence-low);
}

.confidence-dot.unverified {
  background: var(--confidence-unverified);
}

.confidence-label {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 140px;
}

.confidence-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* EMG Example */
.emg-example {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.emg-example h4 {
  color: var(--accent-gold);
  font-size: 1.1rem;
  margin: 0 0 1.5rem;
}

.activation-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activation-row {
  display: grid;
  grid-template-columns: 100px 1fr 50px 20px;
  align-items: center;
  gap: 0.75rem;
}

.muscle-name {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.activation-bar-container {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.activation-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-green-light) 100%);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.activation-bar.secondary {
  background: linear-gradient(90deg, var(--confidence-moderate) 0%, #f5d35a 100%);
}

.activation-percent {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: right;
}

/* =====================================================
   FOOTER
   ===================================================== */

.exercise-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 3rem 1.5rem 1.5rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  width: 60px;
  height: auto;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 250px;
}

.footer-links h4 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0 0 1rem;
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Footer Feedback Links */
.footer-feedback {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.feedback-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-green);
  color: var(--text-primary);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .muscle-map-wrapper {
    padding: 1rem;
  }

  .category-cards,
  .goal-cards {
    grid-template-columns: 1fr;
  }

  .essential-card {
    padding: 2rem 1.5rem;
  }

  .essential-card h2 {
    font-size: 1.5rem;
  }

  .exercise-cards {
    grid-template-columns: 1fr;
  }

  .activation-row {
    grid-template-columns: 80px 1fr 40px 16px;
    gap: 0.5rem;
  }

  .muscle-name {
    font-size: 0.8rem;
  }

  .confidence-label {
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  .exercise-library {
    padding: 0 1rem;
  }

  .view-toggle {
    flex-direction: column;
  }

  .essential-preview {
    gap: 0.3rem;
  }

  .essential-item {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* =====================================================
   ACCESSIBILITY ENHANCEMENTS
   ===================================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .muscle-region {
    stroke-width: 3;
  }

  .confidence-dot {
    border: 2px solid white;
  }

  .btn {
    border: 2px solid currentColor;
  }
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =====================================================
   LIBRARY PAGE STYLES
   ===================================================== */

.library-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Library Header */
.library-header {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .library-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.header-content h1 {
  font-size: 2rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.header-subtitle {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
}

/* Search */
.search-container {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  width: 100%;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  min-height: var(--min-touch-target);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: var(--focus-ring);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  width: var(--min-touch-target);
  height: var(--min-touch-target);
  background: var(--accent-green);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.search-btn:hover {
  background: var(--accent-green-light);
}

.search-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Search Suggestions Dropdown */
.search-container {
  position: relative;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(17, 24, 22, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  margin-top: 0.5rem;
  z-index: 100;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.search-suggestions.hidden {
  display: none;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.suggestion-item:last-of-type {
  border-bottom: none;
}

.suggestion-name {
  font-weight: 500;
}

.suggestion-name mark {
  background: rgba(212, 168, 75, 0.3);
  color: var(--accent-gold);
  padding: 0 2px;
  border-radius: 2px;
}

.suggestion-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.suggestion-footer {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestions-no-results {
  padding: 1.5rem;
  text-align: center;
}

.suggestions-no-results p:first-child {
  font-weight: 500;
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
}

.suggestions-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Library Layout */
.library-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .library-layout {
    grid-template-columns: 260px 1fr;
  }
}

/* Filter Sidebar */
.filter-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0;
  text-align: left;
}

.clear-filters-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.clear-filters-btn:hover {
  background: rgba(212, 168, 75, 0.1);
}

.clear-filters-btn:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Mobile Filter Toggle */
.filter-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--accent-green);
  border: none;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1rem;
}

.filter-toggle svg {
  transition: transform 0.2s ease;
}

.filter-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

@media (min-width: 900px) {
  .filter-toggle {
    display: none;
  }
}

/* Filter Groups */
.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 899px) {
  .filter-groups {
    display: none;
  }

  .filter-groups.expanded {
    display: flex;
  }
}

.filter-group h3 {
  font-size: 0.9rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.75rem;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Radio and Checkbox Options */
.filter-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.2s ease;
  min-height: var(--min-touch-target);
}

.filter-option:hover {
  background: rgba(45, 90, 61, 0.1);
}

.filter-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom,
.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  background: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.radio-custom {
  border-radius: 50%;
}

.checkbox-custom {
  border-radius: 4px;
}

.filter-option input:checked + .radio-custom,
.filter-option input:checked + .checkbox-custom {
  border-color: var(--accent-green);
  background: var(--accent-green);
}

.filter-option input:checked + .radio-custom::after,
.filter-option input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  position: relative;
}

.filter-option input:checked + .radio-custom::after {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
}

.filter-option input:checked + .checkbox-custom::after {
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  top: 0;
  left: 4px;
}

.filter-option input:focus-visible + .radio-custom,
.filter-option input:focus-visible + .checkbox-custom {
  box-shadow: var(--focus-ring);
}

.option-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.option-label.essential {
  color: var(--accent-gold);
  font-weight: 500;
}

/* Color Dot for Pillar Filters */
.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.option-count {
  color: var(--text-muted);
  font-size: 0.8em;
  margin-left: auto;
}

/* Advanced Filters Toggle */
.show-advanced-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.show-advanced-btn:hover {
  border-color: var(--accent-green);
  color: var(--text-secondary);
}

.show-advanced-btn svg {
  transition: transform 0.2s ease;
}

.filter-advanced {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   QUICK FILTERS SECTION
   ===================================================== */

.quick-filters-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.quick-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.quick-filters-header h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0;
  text-align: left;
}

.show-all-quick-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.show-all-quick-btn:hover {
  background: rgba(212, 168, 75, 0.1);
}

.quick-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

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

.quick-filter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  min-height: 90px;
  justify-content: center;
  gap: 0.5rem;
}

.quick-filter-card:hover {
  border-color: var(--accent-color, var(--accent-green));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.quick-filter-card.active {
  border-color: var(--accent-color, var(--accent-green));
  background: linear-gradient(135deg,
    rgba(var(--accent-color, var(--accent-green)), 0.1),
    var(--bg-card));
  box-shadow: 0 0 20px rgba(var(--accent-color, var(--accent-green)), 0.2);
}

.qf-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.qf-badge {
  font-size: 0.65rem;
  background: var(--accent-color, var(--accent-gold));
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qf-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Exercise Grid Container */
.exercise-grid-container {
  min-width: 0;
}

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

.results-count {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.sort-select {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  min-height: var(--min-touch-target);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: var(--focus-ring);
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(45, 90, 61, 0.2);
  border: 1px solid var(--accent-green);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.remove-filter {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 0.25rem;
  transition: color 0.2s ease;
}

.remove-filter:hover {
  color: var(--accent-gold);
}

/* Exercise Grid */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(45, 90, 61, 0.2);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state p {
  margin: 0;
  font-size: 1rem;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

/* Hidden utility */
[hidden] {
  display: none !important;
}

/* =====================================================
   EXERCISE DETAIL PAGE STYLES
   ===================================================== */

.exercise-detail-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Back Link */
.back-link {
  margin-bottom: 2rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: var(--accent-gold);
}

/* Exercise Header */
.exercise-header {
  margin-bottom: 2rem;
}

.header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.exercise-header h1 {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin: 0;
}

.header-badges {
  display: flex;
  gap: 0.5rem;
}

.essential-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 12px;
  background: rgba(212, 168, 75, 0.15);
  color: var(--accent-gold);
  font-weight: 600;
}

.alternate-names {
  color: var(--text-muted);
  font-size: 1rem;
  font-style: italic;
  margin: 0 0 1rem;
}

.equipment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.equipment-tag {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
}

/* Video Section */
.video-section {
  margin-bottom: 2rem;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-card);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.video-placeholder .placeholder-icon {
  font-size: 4rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

.video-placeholder p {
  color: var(--text-muted);
  margin: 0;
}

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Detail Cards */
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.detail-card h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
  text-align: left;
}

/* Muscle Activation Card */
.muscle-activation-card .activation-row {
  grid-template-columns: 20px 100px 1fr 45px 16px;
  margin-bottom: 0.75rem;
}

.muscle-role {
  color: var(--accent-green);
  font-size: 0.9rem;
}

.confidence-legend-compact {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.legend-item .confidence-dot {
  width: 10px;
  height: 10px;
}

/* EMG Attribution Card */
.emg-attribution-card {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(45, 90, 61, 0.08);
  border: 1px solid rgba(45, 90, 61, 0.2);
  border-radius: 10px;
}

.emg-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.emg-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.emg-header-text {
  flex: 1;
}

.emg-header-text h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
}

.data-quality-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-quality-badge.high {
  background: rgba(34, 197, 94, 0.2);
  color: var(--confidence-high);
}

.data-quality-badge.moderate {
  background: rgba(234, 179, 8, 0.2);
  color: var(--confidence-moderate);
}

.data-quality-badge.low {
  background: rgba(249, 115, 22, 0.2);
  color: var(--confidence-low);
}

.emg-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1rem;
}

.confidence-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.confidence-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.confidence-stat .stat-label {
  color: var(--text-muted);
}

.confidence-stat .stat-value {
  color: var(--text-secondary);
  font-weight: 500;
}

.emg-sources {
  padding-top: 1rem;
  border-top: 1px solid rgba(45, 90, 61, 0.2);
}

.emg-sources h5 {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.sources-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  padding-left: 1rem;
  position: relative;
}

.sources-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-green);
}

/* Source links */
.source-link {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.2s;
}

.source-link:hover {
  color: var(--accent-green);
  text-decoration: underline;
}

.external-link-icon {
  font-size: 0.75em;
  margin-left: 0.25em;
  opacity: 0.7;
}

/* ADL Card */
.adl-card h3 {
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin: 0 0 0.75rem;
}

.adl-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.baseline-connection {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.connection-label {
  color: var(--text-muted);
}

.baseline-connection a {
  color: var(--accent-green);
  text-decoration: none;
}

.baseline-connection a:hover {
  text-decoration: underline;
}

/* Instructions Card */
.instructions-card {
  margin-bottom: 1.5rem;
}

.instruction-section {
  margin-bottom: 1.5rem;
}

.instruction-section:last-child {
  margin-bottom: 0;
}

.instruction-section h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.instruction-section ul,
.instruction-section ol {
  margin: 0;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.instruction-section li {
  margin-bottom: 0.5rem;
}

.instruction-section.breathing {
  background: rgba(45, 90, 61, 0.1);
  padding: 1rem;
  border-radius: 8px;
}

.instruction-section.breathing h4 {
  color: var(--accent-green);
}

.instruction-section.breathing p {
  margin: 0 0 0.5rem;
  color: var(--text-secondary);
}

.instruction-section.breathing p:last-child {
  margin-bottom: 0;
}

/* Modifications Card */
.modifications-card {
  margin-bottom: 1.5rem;
}

.modifications-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 500px) {
  .modifications-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.modification-card {
  padding: 1.25rem;
  border-radius: 8px;
  text-align: center;
}

.modification-card.easier {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.modification-card.harder {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.mod-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.modification-card h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.modification-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}

/* Safety Card */
.safety-card {
  margin-bottom: 2rem;
}

.safety-section {
  margin-bottom: 1.25rem;
}

.safety-section:last-child {
  margin-bottom: 0;
}

.safety-section h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

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

.safety-list li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.safety-list.precautions li {
  color: var(--confidence-moderate);
}

.safety-list.contraindications li {
  color: var(--confidence-low);
}

/* =====================================================
   PROGRESSION PATHS
   ===================================================== */

.progression-paths-card {
  margin-bottom: 1.5rem;
}

.progression-paths-card h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
}

/* Individual Chain */
.progression-chain {
  margin-bottom: 2rem;
}

.progression-chain:last-child {
  margin-bottom: 0;
}

.progression-chain-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.progression-chain-header h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
  margin: 0;
}

.progression-chain-category {
  font-size: 0.75rem;
  color: var(--accent-gold);
  background: rgba(212, 168, 75, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.progression-chain-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

/* Horizontal Track */
.progression-track {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  padding: 1rem 0.5rem;
  gap: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-green) transparent;
  -webkit-overflow-scrolling: touch;
}

.progression-track::-webkit-scrollbar {
  height: 6px;
}

.progression-track::-webkit-scrollbar-track {
  background: transparent;
}

.progression-track::-webkit-scrollbar-thumb {
  background: var(--accent-green);
  border-radius: 3px;
}

/* Level Group */
.progression-level {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 120px;
}

.progression-level-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Nodes Container */
.progression-nodes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

/* Individual Node */
.progression-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  padding: 0.75rem 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  min-width: 110px;
  max-width: 140px;
  cursor: pointer;
}

.progression-node:hover {
  background: rgba(45, 90, 61, 0.15);
  border-color: var(--accent-green);
  transform: translateY(-2px);
}

/* Node Dot */
.node-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-bottom: 0.5rem;
  border: 2px solid var(--text-muted);
  background: transparent;
  transition: all 0.2s ease;
}

/* Current Exercise Node */
.progression-node.current {
  background: rgba(45, 90, 61, 0.25);
  border-color: var(--accent-green);
  cursor: default;
}

.progression-node.current:hover {
  transform: none;
}

.progression-node.current .node-dot {
  background: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(45, 90, 61, 0.5);
}

.progression-node.current .node-label {
  color: var(--text-primary);
  font-weight: 600;
}

/* Completed/Past Nodes */
.progression-node.completed .node-dot {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

.progression-node.completed .node-label {
  color: var(--text-muted);
}

/* Future Nodes */
.progression-node.future .node-dot {
  border-color: var(--accent-gold);
  background: transparent;
}

.progression-node.future .node-label {
  color: var(--text-secondary);
}

/* Same Level Nodes */
.progression-node.same-level .node-dot {
  background: rgba(45, 90, 61, 0.4);
  border-color: var(--accent-green);
}

.progression-node.same-level .node-label {
  color: var(--text-secondary);
}

/* Node Text */
.node-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
  word-break: break-word;
}

.node-difficulty {
  font-size: 0.65rem;
  margin-top: 0.25rem;
}

/* Connector Line Between Levels */
.progression-connector {
  width: 32px;
  height: 2px;
  background: var(--border-color);
  align-self: center;
  margin-top: 28px;
  flex-shrink: 0;
}

/* Callout Cards */
.progression-callout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
}

.progression-callout.ready-for-more {
  background: rgba(45, 90, 61, 0.1);
  border-color: rgba(45, 90, 61, 0.3);
}

.progression-callout.build-up-to {
  background: rgba(212, 168, 75, 0.05);
  border-color: rgba(212, 168, 75, 0.2);
}

.callout-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.callout-content h4 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.callout-criteria {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
  font-style: italic;
}

.callout-text {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.callout-link {
  color: var(--accent-green);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.callout-link:hover {
  color: var(--accent-gold);
}

/* Progression mobile responsive */
@media (max-width: 768px) {
  .progression-level {
    min-width: 100px;
  }

  .progression-node {
    min-width: 90px;
    max-width: 110px;
  }

  .node-label {
    font-size: 0.75rem;
  }

  .progression-callout {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Mark Complete Button (Exercise Detail) */
.detail-complete-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.btn-mark-complete {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--accent-green, #2ecc71);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-mark-complete:hover {
  background: #27ae60;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.btn-mark-complete:active {
  transform: scale(0.97);
}

.btn-mark-complete .complete-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-mark-complete.has-completions {
  background: #27ae60;
}

.btn-mark-complete.completing {
  animation: completeButtonPulse 0.6s ease;
}

@keyframes completeButtonPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); box-shadow: 0 0 16px rgba(46, 204, 113, 0.5); }
  100% { transform: scale(1); }
}

.completion-count-badge {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  font-weight: 500;
}

@media (max-width: 768px) {
  .detail-complete-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-mark-complete {
    justify-content: center;
    padding: 0.75rem;
    font-size: 1rem;
  }

  .completion-count-badge {
    text-align: center;
  }
}

/* Related Section */
.related-section h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0 0 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.exercise-card-mini {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.exercise-card-mini:hover {
  border-color: var(--accent-green);
  transform: translateY(-2px);
}

.exercise-card-mini .card-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.exercise-card-mini .card-content {
  flex: 1;
  min-width: 0;
}

.exercise-card-mini h4 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.exercise-card-mini .difficulty-badge.small {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  margin-bottom: 0.35rem;
  display: inline-block;
}

.exercise-card-mini .card-muscles {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Baseline Tests Section */
.baseline-tests-card {
  margin-bottom: 1.5rem;
}

.baseline-tests-card .section-intro {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.baseline-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.baseline-test-card {
  display: block;
  background: rgba(45, 90, 61, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.baseline-test-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.baseline-test-card.primary {
  background: rgba(45, 90, 61, 0.15);
}

.baseline-test-card .test-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.test-pillar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.test-type-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(45, 90, 61, 0.3);
  color: var(--accent-green-light);
}

.test-type-badge.primary {
  background: rgba(212, 168, 75, 0.3);
  color: var(--accent-gold);
}

.baseline-test-card h4 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.baseline-test-card .test-description {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.test-pillar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.error-state h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.error-state p {
  color: var(--text-secondary);
  margin: 0 0 1.5rem;
}

/* Responsive Detail Page */
@media (max-width: 768px) {
  .exercise-header h1 {
    font-size: 1.8rem;
  }

  .muscle-activation-card .activation-row {
    grid-template-columns: 16px 80px 1fr 35px 14px;
    gap: 0.4rem;
  }
}

/* =====================================================
   MUSCLE DETAIL PAGE STYLES
   ===================================================== */

.muscle-detail-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Muscle Header */
.muscle-header {
  margin-bottom: 2rem;
}

.muscle-header .header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.muscle-header h1 {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin: 0;
}

.region-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 15px;
  font-weight: 500;
}

.region-badge.lower_body {
  background: rgba(34, 197, 94, 0.15);
  color: var(--confidence-high);
}

.region-badge.upper_body {
  background: rgba(249, 115, 22, 0.15);
  color: var(--confidence-low);
}

.region-badge.core {
  background: rgba(234, 179, 8, 0.15);
  color: var(--confidence-moderate);
}

.common-name {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

/* Muscle Detail Cards */
.muscle-detail-page .detail-card {
  margin-bottom: 1.5rem;
}

.muscle-detail-page .detail-card.highlight-card {
  background: linear-gradient(135deg, rgba(45, 90, 61, 0.15) 0%, rgba(212, 168, 75, 0.08) 100%);
  border-color: var(--accent-green);
}

/* Anatomy Grid */
.anatomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.anatomy-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.anatomy-item h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.5rem;
}

.anatomy-item p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Function Section */
.function-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.function-content li {
  color: var(--text-secondary);
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.5;
}

.function-content li::before {
  content: "→";
  color: var(--accent-green);
  position: absolute;
  left: 0;
}

.function-group {
  margin-bottom: 1.25rem;
}

.function-group:last-child {
  margin-bottom: 0;
}

.function-group h4 {
  font-size: 1rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

/* Aging Importance */
.importance-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
}

.importance-card h4 {
  font-size: 1rem;
  color: var(--accent-gold);
  margin: 0 0 0.75rem;
}

.importance-card p {
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.importance-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.importance-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.importance-item strong {
  color: var(--text-primary);
}

.importance-item span {
  color: var(--text-secondary);
}

/* ADL List */
.adl-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.adl-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.adl-list li:last-child {
  border-bottom: none;
}

.adl-activity {
  color: var(--text-secondary);
}

.adl-importance {
  font-size: 0.9rem;
}

/* Dysfunctions */
.dysfunctions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dysfunction-item {
  background: rgba(249, 115, 22, 0.05);
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 1rem;
  border-radius: 8px;
}

.dysfunction-item h4 {
  color: var(--confidence-low);
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.dysfunction-item p {
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.exercises-to-help {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.exercises-to-help strong {
  color: var(--accent-green);
}

/* Muscle Exercise Cards */
.exercise-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.muscle-exercise-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.muscle-exercise-card:hover {
  border-color: var(--accent-green);
  transform: translateY(-2px);
}

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

.muscle-exercise-card .card-icon {
  font-size: 1.5rem;
  opacity: 0.6;
}

.muscle-exercise-card .card-activation {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.muscle-exercise-card .activation-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.muscle-exercise-card h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.muscle-exercise-card .difficulty-badge.small {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

.see-more {
  text-align: center;
  margin-top: 1.5rem;
}

/* Baseline Tests */
.baseline-tests {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.baseline-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(45, 90, 61, 0.1);
  border: 1px solid var(--accent-green);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.baseline-card:hover {
  background: rgba(45, 90, 61, 0.2);
  transform: translateX(4px);
}

.baseline-icon {
  font-size: 1.75rem;
}

.baseline-info {
  flex: 1;
}

.baseline-info h4 {
  color: var(--text-primary);
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.baseline-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
}

.baseline-arrow {
  color: var(--accent-green);
  font-size: 1.25rem;
}

/* Responsive Muscle Page */
@media (max-width: 768px) {
  .muscle-header h1 {
    font-size: 1.8rem;
  }

  .anatomy-grid {
    grid-template-columns: 1fr;
  }

  .exercise-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   PREMIUM BADGES
   ===================================================== */

.premium-badge {
  font-size: 0.6rem;
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.nav-link .premium-badge {
  font-size: 0.55rem;
  padding: 1px 4px;
}

/* =====================================================
   ACCESS GATES - Full Page Gates
   ===================================================== */

.access-gate {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 2rem;
}

.access-gate .gate-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.access-gate .gate-icon {
  width: 80px;
  height: 80px;
  background: rgba(45, 90, 61, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--accent-green);
}

.access-gate .gate-icon.premium {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.15), rgba(231, 76, 60, 0.15));
  color: #f39c12;
}

.access-gate h2 {
  font-size: 1.75rem;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
}

.access-gate .gate-message {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0 0 2rem;
  line-height: 1.6;
}

.access-gate .trial-notice {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Gate Benefits List */
.access-gate .gate-benefits {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: left;
}

.access-gate .gate-benefits h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.access-gate .gate-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.access-gate .gate-benefits li {
  color: var(--text-secondary);
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.access-gate .benefit-icon {
  color: var(--accent-green);
  font-weight: bold;
  font-size: 1.1rem;
}

.access-gate .benefit-icon.premium {
  color: #f39c12;
}

/* Pricing Options */
.access-gate .pricing-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.access-gate .price-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  position: relative;
}

.access-gate .price-card.popular {
  border-color: #f39c12;
  background: rgba(243, 156, 18, 0.08);
}

.access-gate .price-card.selected {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px var(--accent-green);
}

.access-gate .popular-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f39c12, #e74c3c);
  color: white;
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.access-gate .price-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.access-gate .price-amount {
  display: block;
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 700;
}

.access-gate .price-period {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.access-gate .price-savings {
  display: block;
  color: #22c55e;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* Gate Action Buttons */
.access-gate .gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn-gate-primary,
.btn-gate-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-gate-primary {
  background: var(--accent-green);
  color: white;
}

.btn-gate-primary:hover {
  background: var(--accent-green-light);
}

.btn-gate-primary.premium {
  background: linear-gradient(135deg, #f39c12, #e74c3c);
}

.btn-gate-primary.premium:hover {
  filter: brightness(1.1);
}

.btn-gate-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-gate-secondary:hover {
  border-color: var(--accent-green);
  color: var(--text-primary);
}

/* Gate Notes */
.access-gate .gate-note {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.access-gate .gate-note a {
  color: var(--accent-green);
  text-decoration: none;
}

.access-gate .gate-note a:hover {
  text-decoration: underline;
}

/* =====================================================
   ACCESS GATES - Modal Overlays
   ===================================================== */

.gate-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1rem;
}

.gate-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  overflow: hidden;
}

.gate-modal.compact {
  max-width: 380px;
}

.gate-modal-content {
  padding: 2rem;
  text-align: center;
  position: relative;
}

.gate-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.gate-modal-close:hover {
  color: var(--text-primary);
}

.gate-modal .gate-icon {
  width: 64px;
  height: 64px;
  background: rgba(45, 90, 61, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--accent-green);
}

.gate-modal .gate-icon.small {
  width: 48px;
  height: 48px;
}

.gate-modal h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.gate-modal p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.gate-modal-benefits {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.gate-modal-benefits p {
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.gate-modal-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gate-modal-benefits li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.gate-modal-benefits li::before {
  content: "\2713";
  color: var(--accent-green);
  margin-right: 0.5rem;
}

.gate-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gate-modal-actions .btn-gate-primary,
.gate-modal-actions .btn-gate-secondary {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

/* =====================================================
   ACCESS GATES - Responsive
   ===================================================== */

@media (max-width: 640px) {
  .access-gate .gate-content {
    padding: 2rem 1.5rem;
  }

  .access-gate .pricing-options {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .access-gate .price-card {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    text-align: left;
    padding: 1rem;
  }

  .access-gate .price-card.popular {
    grid-template-columns: 1fr auto auto;
  }

  .access-gate .popular-badge {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
    width: fit-content;
  }

  .access-gate .price-label {
    margin-bottom: 0;
  }

  .access-gate .price-amount {
    font-size: 1.5rem;
  }

  .access-gate .price-savings {
    margin-top: 0;
    grid-column: 1 / -1;
  }
}

/* =====================================================
   DISCLAIMER POPUP STYLES
   ===================================================== */

/* Overlay - covers entire screen */
.disclaimer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
}

/* Popup container */
.disclaimer-popup {
  background: linear-gradient(180deg, #1F2937 0%, #111827 100%);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid #374151;
  position: relative;
}

/* Header section */
.disclaimer-header {
  background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
  padding: 24px 32px;
  text-align: center;
  border-radius: 16px 16px 0 0;
}

.disclaimer-header h2 {
  color: #FFFFFF;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Content section */
.disclaimer-content {
  padding: 32px;
}

.disclaimer-welcome {
  font-size: 1.25rem;
  color: #F9FAFB;
  text-align: center;
  margin: 0 0 16px;
}

.disclaimer-content > p {
  color: #D1D5DB;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Key points section */
.disclaimer-key-points {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.disclaimer-key-points h3 {
  color: #FBBF24;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.disclaimer-key-points ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.disclaimer-key-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  color: #E5E7EB;
  line-height: 1.5;
  padding-left: 0;
}

.disclaimer-key-points li:last-child {
  margin-bottom: 0;
}

.disclaimer-key-points li::before {
  content: none;
}

.disclaimer-key-points li strong {
  color: #FBBF24;
}

/* Full terms link */
.disclaimer-full-link {
  display: block;
  text-align: center;
  padding: 14px 20px;
  background: #1F2937;
  border: 1px solid #4B5563;
  border-radius: 8px;
  color: #60A5FA;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.disclaimer-full-link:hover {
  background: #374151;
  border-color: #60A5FA;
}

/* Checkbox container */
.disclaimer-checkbox-container {
  background: #1F2937;
  border: 2px solid #374151;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.disclaimer-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  color: #E5E7EB;
  line-height: 1.6;
}

.disclaimer-checkbox-label input[type="checkbox"] {
  display: none;
}

/* Custom checkbox */
.disclaimer-checkbox-label .checkmark {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid #6B7280;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-top: 2px;
  background: transparent;
}

.disclaimer-checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: #10B981;
  border-color: #10B981;
}

.disclaimer-checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: "\2713";
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.disclaimer-checkbox-label .checkbox-text {
  font-size: 0.95rem;
}

/* Accept button */
.disclaimer-accept-btn {
  display: block;
  width: 100%;
  padding: 18px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 16px;
}

.disclaimer-accept-btn:disabled {
  background: #374151;
  color: #6B7280;
  cursor: not-allowed;
}

.disclaimer-accept-btn:not(:disabled) {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.disclaimer-accept-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Footer text */
.disclaimer-footer-text {
  font-size: 0.85rem;
  color: #9CA3AF;
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.disclaimer-footer-text a {
  color: #60A5FA;
  text-decoration: none;
}

.disclaimer-footer-text a:hover {
  text-decoration: underline;
}

/* =====================================================
   DISCLAIMER POPUP - MOBILE RESPONSIVE
   ===================================================== */

@media (max-width: 600px) {
  .disclaimer-overlay {
    padding: 12px;
    align-items: center;  /* Keep centered on mobile */
    overflow-y: auto;     /* Allow scrolling if needed */
  }

  .disclaimer-popup {
    max-height: 90vh;     /* More viewport height available */
    margin: 1rem;
    border-radius: 12px;
    overflow-y: auto;     /* Scroll within popup */
  }

  .disclaimer-header {
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
  }

  .disclaimer-header h2 {
    font-size: 1.1rem;
  }

  .disclaimer-content {
    padding: 24px 20px;
  }

  .disclaimer-welcome {
    font-size: 1.1rem;
  }

  .disclaimer-key-points {
    padding: 20px 16px;
  }

  .disclaimer-key-points li {
    font-size: 0.9rem;
  }

  .disclaimer-checkbox-label .checkbox-text {
    font-size: 0.85rem;
  }

  .disclaimer-accept-btn {
    padding: 16px 24px;
    font-size: 1rem;
  }
}

/* ─── Pillar Badges ────────────────────────────────────────────────────────── */

/* Exercise cards - small pills */
.exercise-card-pillars {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.pillar-pill {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  color: var(--pill-color);
  background: color-mix(in srgb, var(--pill-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 25%, transparent);
  line-height: 1.4;
}

.pillar-pill.pillar-secondary {
  opacity: 0.7;
  font-weight: 500;
}

/* Exercise detail page - larger badges */
.pillar-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.pillar-badge-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pill-color);
  background: color-mix(in srgb, var(--pill-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pill-color) 25%, transparent);
}

.pillar-badge-detail.pillar-badge-secondary {
  opacity: 0.75;
  font-weight: 500;
  font-size: 0.8rem;
}

.pillar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pill-color);
  flex-shrink: 0;
}

/* ─── Phase 5: Pillar Bars (For You page) ────────────────────────────────── */

.pillar-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.pillar-bar-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
  flex-shrink: 0;
}

.pillar-bar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pillar-bar-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary, #e0e0e0);
}

.pillar-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.pillar-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
  min-width: 2px;
}

.pillar-bar-value {
  min-width: 28px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
}

/* ─── Phase 5: Pillar Insight Messages ───────────────────────────────────── */

.pillar-insight {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.pillar-insight p {
  margin: 0;
}

.pillar-insight-weak {
  background: rgba(231, 76, 60, 0.1);
  border-left: 3px solid #e74c3c;
  color: var(--text-primary, #e0e0e0);
}

.pillar-insight-strong {
  background: rgba(46, 204, 113, 0.1);
  border-left: 3px solid #2ecc71;
  color: var(--text-primary, #e0e0e0);
}

.pillar-insight-balanced {
  background: rgba(52, 152, 219, 0.1);
  border-left: 3px solid #3498db;
  color: var(--text-primary, #e0e0e0);
}

/* ─── Phase 5: Self-Rating Widget ────────────────────────────────────────── */

.self-rating-item {
  margin-bottom: 1.25rem;
}

.self-rating-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.self-rating-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary, #e0e0e0);
  flex: 1;
}

.self-rating-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-gold, #f0c674);
  min-width: 20px;
  text-align: right;
}

.self-rating-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.self-rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--slider-color, #3498db);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.self-rating-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--slider-color, #3498db);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.self-rating-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  margin-top: 0.2rem;
}

/* ─── Phase 5: Pillar Priority Cards ─────────────────────────────────────── */

.pillar-priority-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.pillar-priority-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.pillar-priority-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
}

.pillar-priority-score {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #aaa);
  margin-left: auto;
}

.pillar-priority-gap {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
}

.pillar-priority-exercises {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.pillar-exercise-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-primary, #e0e0e0);
  transition: background 0.15s;
}

.pillar-exercise-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pillar-exercise-name {
  font-size: 0.85rem;
}

/* ─── Phase 5: For You Recommendation Cards ──────────────────────────────── */

.recommendation-reason {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary, #aaa);
}

.recommendation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

@media (max-width: 600px) {
  .pillar-bar-label {
    min-width: 110px;
  }
  .recommendation-grid {
    grid-template-columns: 1fr;
  }
  .pillar-priority-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .pillar-priority-score {
    margin-left: 0;
  }
}

/* =====================================================
   MUSCLE LINKS IN EXERCISE DETAIL (Phase 6)
   ===================================================== */

.muscle-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
  cursor: pointer;
}

.muscle-link:hover {
  color: var(--accent-color, #e8a87c);
  text-decoration: underline;
}

/* =====================================================
   MUSCLE GROUP FILTER (Phase 6)
   ===================================================== */

.muscle-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-bottom: 4px;
}

.muscle-group-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.muscle-group-btn.active {
  background: rgba(232, 168, 124, 0.15);
  border-color: var(--accent-color, #e8a87c);
  color: var(--accent-color, #e8a87c);
}

.muscle-group-count {
  font-size: 11px;
  opacity: 0.6;
}
