/* ✅ NEW: CSS Custom Properties for Performance & Maintainability */
:root {
  /* Color Palette */
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #10b981;
  --secondary-hover: #059669;
  --accent-color: #f59e0b;
  --accent-hover: #d97706;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Border Colors */
  --border-primary: #e2e8f0;
  --border-secondary: #cbd5e1;
  --border-focus: #4f46e5;
  
  /* Shadow System */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Spacing System */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  
  /* Container Max Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* ✅ DARK MODE: CSS Custom Properties */
.dark-mode {
  /* Background Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-overlay: rgba(0, 0, 0, 0.7);
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  /* Border Colors */
  --border-primary: #334155;
  --border-secondary: #475569;
  --border-focus: #6366f1;
  
  /* Shadow System (darker for dark mode) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  /* Add transition for body background and color for dark mode */
  transition: background-color 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  /* Initially hide the container with opacity, it will fade in when body.loaded */
  opacity: 0;
  /* Ensure it's always block, but its visibility is controlled by opacity */
  display: block;
  /* Add transition for opacity for a smooth fade-in */
  transition: opacity 0.6s ease;
  /* Also transition other properties for dark mode */
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, opacity 0.6s ease;
}

/* When the body has the 'loaded' class, the container becomes visible */
body.loaded .container {
  opacity: 1;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  color: var(--primary-color);
}
.subtitle {
  font-size: 1rem;
  color: var(--secondary-color);
  margin-bottom: 2rem;
}
.buttons button {
  display: block;
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 119, 255, 0.2);
}
.buttons button:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 119, 255, 0.3);
}
#download-btn {
  display: none;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 217, 126, 0.3);
  animation: fadeInUp 0.5s ease-out;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#download-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 217, 126, 0.4);
}
#save-btn {
  display: none;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#save-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(0, 119, 255, 0.4);
}
.plan-box {
  margin-top: 2rem;
  background: white;
  padding: 1rem;
  border-radius: 10px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInPlan 0.6s ease-out forwards;
}
.logo {
  font-size: 2.5rem;
  margin: 0;
}
.splash-sub {
  font-size: 1.1rem;
  margin-top: 0.5rem;
  font-weight: 300;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInPlan {
  to { opacity: 1; transform: translateY(0); }
}
.custom-goal {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}
.custom-goal input {
  padding: 12px;
  font-size: 1rem;
  width: 80%;
  max-width: 400px;
  margin-bottom: 10px;
  border: 2px solid var(--border-primary);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
}
.custom-goal button {
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}
.custom-goal button:hover {
  background-color: var(--primary-hover);
}
.workout-plan {
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.workout-plan ul {
  padding-left: 1.25rem;
  margin: 1rem 0;
}
.workout-plan li {
  margin-bottom: 0.5rem;
  list-style-type: disc;
}
.workout-plan strong {
  font-size: 1.05rem;
  color: var(--text-heading);
  display: block;
  margin: 1rem 0 0.5rem;
}
.section-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-top: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--text-heading);
  border-left: 5px solid var(--secondary-color);
  padding-left: 12px;
  background: var(--bg-accent);
  padding: 8px 12px;
  border-radius: 6px;
}
.section-box {
  background: var(--bg-accent);
  padding: 10px 12px;
  margin: 15px 0 8px;
  border-radius: 8px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 4px solid var(--primary-color);
  color: var(--text-primary);
}
.section-icon {
  font-size: 1.2rem;
}
.workout-list {
  padding-left: 1.2rem;
  margin-bottom: 2rem;
}
.workout-list li {
  margin-bottom: 0.5rem;
}

/* Spinner */
.spinner-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  margin: 1rem 0;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .spinner-container {
  background: rgba(30, 30, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0077ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

body.dark-mode .spinner {
  border-color: #374151;
  border-top-color: #3b82f6;
}

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

/* Dark Mode Toggle */
body.dark-mode { /* Apply dark mode styles directly to body */
  background-color: #121212;
  color: #f5f5f5;
}

body.dark-mode .container,
body.dark-mode .plan-box,
body.dark-mode .workout-plan {
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.05);
}

body.dark-mode .custom-goal input {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border: 1px solid #555;
}

body.dark-mode .custom-goal button {
  background-color: #3b82f6;
}

body.dark-mode .custom-goal button:hover {
  background-color: #2563eb;
}

body.dark-mode .section-box {
  background-color: #2c2c2c;
  border-left: 4px solid #4a90e2;
  color: #ddd;
}

body.dark-mode #download-btn {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
  box-shadow: 0 4px 12px rgba(0, 217, 126, 0.3);
}

body.dark-mode #download-btn:hover {
  background: linear-gradient(135deg, var(--secondary-hover), var(--secondary-color));
}

/* Consolidated Toggle Switch UI and Positioning */
.dark-mode-toggle { /* Corrected class name from 'body.dark-mode -toggle' */
  display: flex; /* Use flexbox for alignment */
  align-items: center;
  justify-content: center; /* Center horizontally */
  margin-bottom: 1.5rem; /* Add some space below the toggle */
  gap: 10px; /* Space between switch and label */
}

/* === Navigation Button Styles === */
.nav-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 119, 255, 0.2);
  font-family: 'Inter', sans-serif;
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
  background: linear-gradient(135deg, var(--primary-hover), #004499);
}

.nav-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 119, 255, 0.2);
}

body.dark-mode .nav-btn {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

body.dark-mode .nav-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* === Enhanced Dark Mode Toggle === */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 0.5rem;
  border-radius: 12px;
  background: rgba(0, 119, 255, 0.05);
  border: 1px solid rgba(0, 119, 255, 0.1);
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  background: rgba(0, 119, 255, 0.1);
  border-color: rgba(0, 119, 255, 0.2);
}

body.dark-mode .dark-mode-toggle {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

body.dark-mode .dark-mode-toggle:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

/* The actual switch styling */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  transition: all 0.3s ease;
  border-radius: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .slider {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.2);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dark mode specific styles for the switch */
body.dark-mode .slider {
  background: linear-gradient(135deg, #4b5563, #374151);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode input:checked + .slider {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .slider:before {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode input:checked + .slider:before {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
  transition: color 0.3s ease;
}

body.dark-mode .toggle-label {
  color: #e5e7eb;
}

/* Ensure container alignment for various screen heights */
@media (min-height: 600px) {
  body .container {
    justify-content: center;
  }
}

.input-warning {
  color: #f39c12;
  font-weight: bold;
  text-align: center;
  margin: 20px auto;
  animation: pulse 1s ease-in-out;
}

.input-warning.fade-out {
  opacity: 0;
  transition: opacity 1s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.page-hero {
  padding: 3rem 1rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, #0077ff, #00d97e);
  color: white;
  border-bottom-left-radius: 30% 10%;
  border-bottom-right-radius: 30% 10%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.6s ease-out;
}

.page-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.page-hero .subtitle {
  color: #e0ffe8;
  font-size: 1.1rem;
  font-weight: 400;
}

.page-content {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #333;
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

.page-content p {
  margin-bottom: 1.5rem;
}

.back-link {
  margin-top: 2rem;
}

.back-link a {
  color: #0077ff;
  font-weight: 600;
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

body.dark-mode .page-content {
  color: #e0e0e0;
}

body.dark-mode .back-link a {
  color: #80cfff;
}

/* === Modern Navigation Bar === */
.nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: 'Inter', sans-serif;
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: 70px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: #0077ff;
}

.nav-items {
  display: flex;
  gap: 1.5rem;
}

.nav-items a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-items a:hover {
  background: #e6f0ff;
  color: #0077ff;
}

.nav-items a.active {
  background: #0077ff;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 119, 255, 0.3);
}

/* Dark mode adjustments */
body.dark-mode .nav-links {
  background: var(--bg-secondary, #1e293b);
  border-bottom: 1px solid var(--border-primary, #334155);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.dark-mode .nav-logo {
  color: #80cfff;
}

body.dark-mode .nav-items a {
  color: #e0e0e0;
}

body.dark-mode .nav-items a:hover {
  background: #333;
  color: #00d97e;
}

body.dark-mode .nav-items a.active {
  background: #00d97e;
  color: #1a1a1a;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 217, 126, 0.3);
}

/* Responsive collapse */
.dark-mode-toggle {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
/* ─── Hamburger button (desktop: hidden) ─── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
}
/* ─── Base: hide off-canvas container on desktop ─── */
.nav-items {
  display: flex;
  gap: 1rem;
}

/* ─── Hamburger button hides on desktop ─── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  /* hide the inline menu */
  .nav-items {
    display: flex;              /* keep flex so links stack nicely */
    flex-direction: column;
    position: fixed;            /* slide-in drawer */
    top: 0;
    left: -250px;               /* hidden off-screen */
    width: 250px;
    height: 100vh;
    padding: 1.5rem 1rem;
    background: var(--bg, #fff);
    box-shadow: 2px 0 6px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    z-index: 1000;
  }
  /* when open, slide in */
  .nav-items.open {
    left: 0;
  }

  /* stack & style links */
  .nav-items a {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    text-align: left;
  }
  .nav-items a:last-child {
    border-bottom: none;
  }
}
/* ─── Hamburger button (desktop: hidden) ─── */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
}

/* Screen reader only class */
.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;
}

/* Mobile navigation backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .nav-items {
    width: min(280px, 80vw);
    transform: translateX(-100%);
  }

  .nav-items.open {
    transform: translateX(0);
  }

  .nav-items.open + .nav-backdrop {
    display: block;
    opacity: 1;
  }
}

/* ─── Off-canvas drawer on mobile ─── */
@media (max-width: 768px) {
  /* show the toggle on small screens */
  .menu-toggle {
    display: block;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* start fully off-screen via transform */
  .nav-items {
    display: flex;              /* keep flex so links still stack nicely */
    flex-direction: column;
    position: fixed;            /* slide-in drawer */
    top: 0;
    left: 0;
    width: min(280px, 75vw);
    height: 100vh;
    padding: 1.5rem 1rem;
    background: var(--bg, #fff);
    box-shadow: 2px 0 6px rgba(0,0,0,0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  /* when "open" class is toggled, slide it into view */
  .nav-items.open {
    transform: translateX(0);
  }

  /* style the stacked links */
  .nav-items a {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    text-align: left;
  }
  .nav-items a:last-child {
    border-bottom: none;
  }
}
/* ─── Dark-mode overrides for off-canvas nav ─── */
body.dark-mode .nav-items {
  background-color: #1f1f1f;       /* dark drawer background */
}

body.dark-mode .nav-items a {
  color: #e0e0e0;                  /* light link text */
  border-bottom: 1px solid #333;   /* subtle divider */
}

body.dark-mode .nav-items a:hover {
  background-color: #333;          /* hover state */
}

/* ─── Ensure the hamburger/x icon matches text color ─── */
.menu-toggle {
  color: #333;                     /* default icon color */
}

body.dark-mode .menu-toggle {
  color: #e0e0e0;                  /* icon in dark mode */
}
/* ─── Mobile: one-line nav with logo, burger, and dark-mode toggle ─── */
@media (max-width: 768px) {
  .nav-links {
    /* override any column setting */
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 1rem 1rem;
    min-height: 60px;
  }

  /* Remove the extra bottom margin from the toggle */
  .dark-mode-toggle {
    margin-bottom: 0 !important;
  }

  /* Order them explicitly, just in case */
  .nav-logo        { order: 1; }
  .menu-toggle     { order: 2; }
  .dark-mode-toggle{ order: 3; }

  /* If you still have a @media (max-width:600px) block setting
     .nav-links to column, you can safely delete or comment that out. */
}
/* ─── Restore desktop nav above 768px ─── */
@media (min-width: 769px) {
  .nav-items {
    /* undo any off-canvas hiding */
    transform: none !important;
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
    gap: 1.5rem; /* whatever spacing you prefer */
  }
  .menu-toggle {
    /* hide the hamburger on desktop */
    display: none !important;
  }
}
/* ─── Hide the burger on desktop ─── */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }
}
/* ─── Nav-link reset so they're flat, no shadow or roundness ─── */
.nav-items a {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.5rem 0.75rem !important;
  transition: color 0.2s ease, background-color 0.2s ease;
}

/* ─── Hover & focus ─── */
.nav-items a:hover,
.nav-items a:focus {
  background-color: rgba(0, 119, 255, 0.1) !important; /* light brand tint */
  color: #0077ff !important;
  outline: none;
}

/* ─── Active page indicator ─── */
.nav-items a.active {
  background: transparent !important;
  color: #0077ff !important;
  border-bottom: 2px solid #0077ff !important;
  padding-bottom: calc(0.75rem - 2px) !important; /* keep height consistent */
}

/* ─── Dark-mode tweaks ─── */
body.dark-mode .nav-items a {
  color: #e0e0e0 !important;
}
body.dark-mode .nav-items a:hover,
body.dark-mode .nav-items a:focus {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #80cfff !important;
}
body.dark-mode .nav-items a.active {
  color: #80cfff !important;
  border-bottom-color: #80cfff !important;
}
/* ─── Nav links: flat, inline text ─── */
.nav-items a {
  /* remove any residual background or border */
  background: none !important;
  border: none !important;
  box-shadow: none !important;

  /* tighten up the padding so they feel like text, not buttons */
  padding: 0.25rem 0.5rem !important;
  margin: 0 0.75rem;               /* space between links */
  line-height: 1;                  /* keep them vertically centered */
  transition: color 0.2s ease, border-color 0.2s ease;
}

/* ─── Hover: underline only ─── */
.nav-items a:hover,
.nav-items a:focus {
  background: none !important;
  color: #0077ff !important;       /* your accent */
  text-decoration: underline;
}

/* ─── Active page: underline persists ─── */
.nav-items a.active {
  background: none !important;
  color: #0077ff !important;
  text-decoration: underline;
}

/* ─── Dark-mode tweaks ─── */
body.dark-mode .nav-items a:hover,
body.dark-mode .nav-items a:focus {
  color: #80cfff !important;
}

body.dark-mode .nav-items a.active {
  color: #80cfff !important;
}
/* ─── Nav links: single underline only ─── */
.nav-items a,
.nav-items a:hover,
.nav-items a:focus,
.nav-items a.active {
  /* remove any border-based underlines */
  border-bottom: none !important;
}

.nav-items a:hover,
.nav-items a:focus,
.nav-items a.active {
  /* apply exactly one text-decoration underline */
  text-decoration: underline !important;
}

.nav-items a {
  /* keep link padding tight so it doesn't feel button-y */
  padding: 0.25rem 0.5rem !important;
  margin: 0 0.75rem;
  background: none !important;
  box-shadow: none !important;
}
/* ─── Prevent any nav-items overflow ─── */
.nav-links {
  overflow: hidden;
}

@media (max-width: 768px) {
  .nav-links {
    overflow-x: hidden;
  }
}
/* ── AUTH POP-UP ── */
.auth-container {
  display: none;
  max-width: 360px;
  margin: 1rem auto;
  padding: 1.5rem;
  background: white;
  color: #1f1f1f;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
}
.auth-container input {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
.btn.auth-btn {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.btn.auth-btn:hover {
  opacity: 0.9;
}
.auth-message {
  margin-top: 0.75rem;
  font-weight: 500;
}
.auth-message.error   { color: #e74c3c; }
.auth-message.success { color: #2ecc71; }

/* DARK MODE OVERRIDES */
body.dark-mode .auth-container {
  background: #1f1f1f;
  color: #e0e0e0;
}
body.dark-mode .auth-container input {
  background: #2a2a2a;
  border-color: #555;
  color: #e0e0e0;
}
body.dark-mode .btn.auth-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
/* full-screen, translucent backdrop */
#auth-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;              /* hidden by default */
  align-items: center;        /* vertically center */
  justify-content: center;    /* horizontally center */
  background: rgba(0,0,0,0.4);
  z-index: 1000;
}

/* shrink the card a bit to 90% on mobile, 360px max on desktop */
.auth-container {
  width: 90%;
  max-width: 360px;
  margin: 0; /* we're centering via flex on the overlay */
}
/* ── Login Modal Styling ── */
#auth-container {
  /* limit how wide the card can grow */
  width: 90%;
  max-width: 360px;
  padding: 2rem;
  background: #1e1e1e;         /* match your dark theme */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);

  /* stack its children neatly */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#auth-container input {
  /* make inputs fill the card but not exceed it */
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2a2a2a;
  color: #f0f0f0;
  box-sizing: border-box;
}

#auth-container .auth-btn {
  /* buttons already full-width, but just in case */
  width: 100%;
}
@media (max-width: 768px) {
  /* hide full email + logout pill */
  #nav-user-email,
  #nav-logout {
    display: none;
  }

  /* hide the "Dark Mode" text, leave only the switch */
  .dark-mode-label {
    display: none;
  }
}
/* Hide desktop auth & dark-mode on small screens */
@media (max-width: 768px) {
  .nav-auth,
  .dark-mode-toggle {
    display: none;
  }
  .nav-items .mobile-nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #ddd;
  }
}

/* By default hide those new mobile sections on desktop */
.mobile-nav-section {
  display: none;
}

/* Ensure mobile dark toggle is hidden on desktop */
@media (min-width: 769px) {
  .mobile-dark-toggle {
    display: none !important;
  }
}

.error-message {
  color: #e74c3c;
  background: #fdf2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
  font-weight: 500;
}

body.dark-mode .error-message {
  color: #fca5a5;
  background: #450a0a;
  border-color: #7f1d1d;
}

/* Mobile-specific nav button improvements */
@media (max-width: 768px) {
  .nav-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .dark-mode-toggle {
    padding: 0.4rem;
    gap: 8px;
  }
  
  .toggle-label {
    font-size: 0.8rem;
  }
  
  .switch {
    width: 52px;
    height: 28px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  .slider:before {
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
  }
  
  input:checked + .slider:before {
    transform: translateX(24px);
  }
}

/* Ensure nav buttons work well in the mobile menu */
.mobile-nav-section .nav-btn {
  width: 100%;
  margin: 0.25rem 0;
  justify-content: center;
}

/* Desktop nav button positioning */
@media (min-width: 769px) {
  .nav-auth {
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  
  .nav-btn {
    white-space: nowrap;
  }
}

/* Mobile dark mode toggle enhancements */
.mobile-dark-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  background: rgba(0, 119, 255, 0.05);
  border: 1px solid rgba(0, 119, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.mobile-dark-toggle:hover {
  background: rgba(0, 119, 255, 0.1);
  border-color: rgba(0, 119, 255, 0.2);
}

.mobile-dark-toggle .toggle-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: #374151;
  margin-right: 1rem;
}

body.dark-mode .mobile-dark-toggle {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

body.dark-mode .mobile-dark-toggle:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

body.dark-mode .mobile-dark-toggle .toggle-label {
  color: #e5e7eb;
}

/* Enhanced mobile switch styling */
.mobile-dark-toggle .switch {
  width: 56px;
  height: 30px;
  flex-shrink: 0;
}

.mobile-dark-toggle .slider {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  border-radius: 30px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-dark-toggle .slider:before {
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-dark-toggle input:checked + .slider {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-dark-toggle input:checked + .slider:before {
  transform: translateX(26px);
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Dark mode mobile switch */
body.dark-mode .mobile-dark-toggle .slider {
  background: linear-gradient(135deg, #4b5563, #374151);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .mobile-dark-toggle input:checked + .slider {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .mobile-dark-toggle .slider:before {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

body.dark-mode .mobile-dark-toggle input:checked + .slider:before {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Add a subtle animation for the mobile toggle */
.mobile-dark-toggle .switch {
  transition: transform 0.2s ease;
}

.mobile-dark-toggle .switch:active {
  transform: scale(0.95);
}

/* Exercise card enhancements */
.exercise-item {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin: 0.5rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #0077ff;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.exercise-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.exercise-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #0077ff, #00d97e);
}

.exercise-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.exercise-sets {
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.exercise-tip {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #0369a1;
}

/* Difficulty badges */
.difficulty-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.difficulty-beginner {
  background: #dcfce7;
  color: #166534;
}

.difficulty-intermediate {
  background: #fef3c7;
  color: #92400e;
}

.difficulty-advanced {
  background: #fee2e2;
  color: #991b1b;
}

/* Equipment tags */
.equipment-tag {
  display: inline-block;
  padding: 0.2rem 0.4rem;
  background: #f3f4f6;
  color: #374151;
  border-radius: 6px;
  font-size: 0.7rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
}

/* Dark mode exercise cards */
body.dark-mode .exercise-item {
  background: #1f2937;
  border-left-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .exercise-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .exercise-name {
  color: #f9fafb;
}

body.dark-mode .exercise-sets {
  color: #d1d5db;
}

body.dark-mode .exercise-tip {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #93c5fd;
}

body.dark-mode .equipment-tag {
  background: #374151;
  color: #d1d5db;
}

/* No Templates Message */
.no-templates-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
  background: #f8fafc;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
  grid-column: 1 / -1;
  margin: 2rem 0;
}

.no-templates-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.no-templates-message h3 {
  color: #374151;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.no-templates-message p {
  color: #6b7280;
  font-size: 0.95rem;
  max-width: 300px;
}

/* Dark mode no templates message */
body.dark-mode .no-templates-message {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode .no-templates-message h3 {
  color: #f9fafb;
}

body.dark-mode .no-templates-message p {
  color: #9ca3af;
}

/* Dashboard Styles */
.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-header {
  text-align: center;
  margin-bottom: 3rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #0077ff, #00d97e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stats-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 119, 255, 0.1);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  font-size: 2rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0077ff, #00d97e);
  border-radius: 12px;
  color: white;
}

.stat-content h3 {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.stat-change {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 500;
}

.dashboard-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.dashboard-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #1f2937;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 0.5rem;
}

.workout-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

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

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

.empty-state p {
  margin-bottom: 1.5rem;
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
}

.progress-chart {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  text-align: center;
  color: #6b7280;
}

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

.chart-placeholder h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

/* Dark mode dashboard */
body.dark-mode .dashboard-container {
  background: #111827;
}

body.dark-mode .stats-card {
  background: #1f2937;
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .stats-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-mode .stat-content h3 {
  color: #9ca3af;
}

body.dark-mode .stat-number {
  color: #f9fafb;
}

body.dark-mode .dashboard-section {
  background: #1f2937;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .dashboard-section h2 {
  color: #f9fafb;
  border-bottom-color: #374151;
}

body.dark-mode .empty-state {
  color: #9ca3af;
}

body.dark-mode .empty-state h3 {
  color: #e5e7eb;
}

body.dark-mode .chart-placeholder {
  color: #9ca3af;
}

body.dark-mode .chart-placeholder h3 {
  color: #e5e7eb;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }
  
  .dashboard-header h1 {
    font-size: 2rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .stats-card {
    padding: 1rem;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .dashboard-section {
    padding: 1.5rem;
  }
}

/* Comprehensive mobile navigation hiding on desktop */
@media (min-width: 769px) {
  .mobile-nav-section,
  .mobile-dark-toggle {
    display: none !important;
  }
  
  /* Ensure nav-items only shows the main navigation links on desktop */
  .nav-items {
    display: flex !important;
    flex-direction: row !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
    gap: 1.5rem;
    padding: 0;
  }
  
  /* Hide mobile-specific elements in nav-items on desktop */
  .nav-items .mobile-nav-section {
    display: none !important;
  }
}

/* Enhanced Home Screen Styles */
.hero-section {
  background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
  color: white;
  padding: 4rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #fbbf24;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.floating-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  animation: float 6s ease-in-out infinite;
}

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

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-icon {
  font-size: 1.5rem;
}

.card-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.exercise-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.exercise-preview:last-child {
  border-bottom: none;
}

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

.exercise-sets {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Main Container */
.main-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* Mobile responsiveness for main container */
@media (max-width: 768px) {
  .main-container {
    padding: 2rem 1rem;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 1.5rem 0.5rem;
  }
}

.workout-generator {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.generator-header {
  text-align: center;
  margin-bottom: 2rem;
}

.generator-header h2 {
  font-size: 2rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.generator-header p {
  color: #6b7280;
  font-size: 1.1rem;
}

.goal-input-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.input-wrapper {
  flex: 1;
  position: relative;
  min-width: 0; /* Prevent flex item from overflowing */
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  z-index: 1;
}

#goal-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f9fafb;
  box-sizing: border-box;
  max-width: 100%;
}

#goal-input:focus {
  outline: none;
  border-color: #0077ff;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.1);
}

.generate-button {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0; /* Prevent button from shrinking */
}

.generate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 119, 255, 0.3);
}

.btn-icon {
  font-size: 1.2rem;
}

.quick-templates {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.templates-label {
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  margin: 0 0 0.5rem 0;
}

.template-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  flex: 1;
}

.template-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #374151;
  white-space: nowrap;
  min-width: fit-content;
}

.template-btn:hover {
  background: #0077ff;
  color: white;
  border-color: #0077ff;
  transform: translateY(-1px);
}

.template-btn.active {
  background: #0077ff;
  color: white;
  border-color: #0077ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
}

.plan-display-container {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  min-height: 200px;
}

.plan-placeholder {
  text-align: center;
  color: #6b7280;
  padding: 2rem;
}

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

.plan-placeholder h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #374151;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.save-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
}

.save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 119, 255, 0.3);
}

/* Features Section */
.features-section {
  background: #f8fafc;
  padding: 4rem 2rem;
  margin-top: 3rem;
}

.features-container {
  max-width: 1200px;
  margin: 0 auto;
}

.features-container h2 {
  text-align: center;
  font-size: 2.5rem;
  color: #1f2937;
  margin-bottom: 3rem;
}

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

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.feature-card h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1rem;
}

.feature-card p {
  color: #6b7280;
  line-height: 1.6;
}

/* Dark mode styles */
body.dark-mode .hero-section {
  background: linear-gradient(135deg, #0c4a6e 0%, #065f46 100%);
}

body.dark-mode .workout-generator {
  background: #1f2937;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.dark-mode .generator-header h2 {
  color: #f9fafb;
}

body.dark-mode .generator-header p {
  color: #d1d5db;
}

body.dark-mode #goal-input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode #goal-input:focus {
  background: #4b5563;
  border-color: #3b82f6;
}

body.dark-mode .templates-label {
  color: #d1d5db;
}

body.dark-mode .template-btn {
  background: #374151;
  border-color: #4b5563;
  color: #d1d5db;
}

body.dark-mode .template-btn:hover {
  background: #3b82f6;
  color: white;
}

body.dark-mode .plan-display-container {
  background: #1f2937;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .plan-placeholder {
  color: #9ca3af;
}

body.dark-mode .plan-placeholder h3 {
  color: #f9fafb;
}

body.dark-mode .features-section {
  background: #111827;
}

body.dark-mode .features-container h2 {
  color: #f9fafb;
}

body.dark-mode .feature-card {
  background: #1f2937;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .feature-card h3 {
  color: #f9fafb;
}

body.dark-mode .feature-card p {
  color: #d1d5db;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-stats {
    justify-content: center;
    gap: 1.5rem;
  }
  
  .goal-input-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .input-wrapper {
    width: 100%;
  }
  
  #goal-input {
    width: 100%;
    box-sizing: border-box;
  }
  
  .generate-button {
    width: 100%;
    justify-content: center;
  }
  
  .quick-templates {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1.25rem;
  }
  
  .templates-label {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
  }
  
  .template-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .template-btn {
    width: 100%;
    text-align: center;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    border-radius: 12px;
  }
}

/* Additional responsive improvements for very small screens */
@media (max-width: 480px) {
  .quick-templates {
    margin-top: 1rem;
  }
  
  .templates-label {
    font-size: 0.85rem;
  }
  
  .template-btn {
    padding: 0.75rem 0.875rem;
    font-size: 0.85rem;
  }
}
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* Plan Display Enhancements */
.plan-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.plan-header h2 {
  font-size: 2rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.plan-subtitle {
  color: #6b7280;
  font-size: 1.1rem;
}

.workout-plan {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-box {
  background: #f8fafc;
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.section-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.section-icon {
  font-size: 1.5rem;
}

.section-title {
  font-size: 1.25rem;
  color: #1f2937;
  margin: 0;
}

.workout-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exercise-item {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  position: relative;
}

.exercise-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exercise-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.exercise-name {
  font-weight: 600;
  color: #1f2937;
  font-size: 1.1rem;
}

.exercise-sets {
  color: #6b7280;
  font-size: 0.9rem;
  background: #f3f4f6;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.exercise-tip {
  background: #fef3c7;
  color: #92400e;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  border-left: 4px solid #f59e0b;
}

/* Dark mode styles for plan display */
body.dark-mode .plan-header {
  border-bottom-color: #374151;
}

body.dark-mode .plan-header h2 {
  color: #f9fafb;
}

body.dark-mode .plan-subtitle {
  color: #9ca3af;
}

body.dark-mode .section-box {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode .section-header {
  border-bottom-color: #4b5563;
}

body.dark-mode .section-title {
  color: #f9fafb;
}

body.dark-mode .exercise-item {
  background: #1f2937;
  border-color: #4b5563;
}

body.dark-mode .exercise-name {
  color: #f9fafb;
}

body.dark-mode .exercise-sets {
  background: #374151;
  color: #d1d5db;
}

body.dark-mode .exercise-tip {
  background: #451a03;
  color: #fbbf24;
  border-left-color: #f59e0b;
}

/* About Page Specific Styles */
.about-preview .mission-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.about-preview .mission-item:last-child {
  border-bottom: none;
}

.mission-text {
  font-weight: 500;
  font-size: 0.95rem;
}

.content-section {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 2.5rem;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: #6b7280;
  font-size: 1.1rem;
}

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

.story-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.story-card h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1rem;
}

.story-card p {
  color: #6b7280;
  line-height: 1.6;
}

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

.tech-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.tech-card h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1rem;
}

.tech-card p {
  color: #6b7280;
  line-height: 1.6;
}

/* Dark mode styles for About page */
body.dark-mode .content-section {
  background: #1f2937;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

body.dark-mode .section-header h2 {
  color: #f9fafb;
}

body.dark-mode .section-header p {
  color: #d1d5db;
}

body.dark-mode .story-card,
body.dark-mode .tech-card {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode .story-card h3,
body.dark-mode .tech-card h3 {
  color: #f9fafb;
}

body.dark-mode .story-card p,
body.dark-mode .tech-card p {
  color: #d1d5db;
}

/* Mobile responsiveness for About page */
@media (max-width: 768px) {
  .section-header h2 {
    font-size: 2rem;
  }
  
  .story-grid,
  .tech-grid {
    grid-template-columns: 1fr;
  }
  
  .content-section {
    padding: 1.5rem;
  }
}

/* FAQ Page Specific Styles */
.faq-preview .faq-preview-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.faq-preview-text {
  font-weight: 500;
  font-size: 0.95rem;
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.faq-item {
  background: #f8fafc;
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.faq-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.faq-question h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin: 0;
  font-weight: 600;
}

.faq-answer {
  padding-left: 2.5rem;
}

.faq-answer p {
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

/* Dark mode styles for FAQ page */
body.dark-mode .faq-item {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode .faq-question h3 {
  color: #f9fafb;
}

body.dark-mode .faq-answer p {
  color: #d1d5db;
}

/* Mobile responsiveness for FAQ page */
@media (max-width: 768px) {
  .faq-item {
    padding: 1.5rem;
  }
  
  .faq-question {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .faq-answer {
    padding-left: 0;
  }
}

/* Contact Page Specific Styles */
.contact-preview .contact-preview-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.contact-preview-text {
  font-weight: 500;
  font-size: 0.95rem;
}

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

.contact-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.contact-card h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1rem;
}

.contact-card p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.contact-link {
  color: #0077ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.contact-link:hover {
  color: #005fcc;
}

.contact-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.contact-faq-item {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.contact-faq-item h3 {
  font-size: 1.1rem;
  color: #1f2937;
  margin-bottom: 0.75rem;
}

.contact-faq-item p {
  color: #6b7280;
  line-height: 1.6;
  margin: 0;
}

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

.social-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
}

.social-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.social-card h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1rem;
}

.social-card p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.social-link {
  color: #0077ff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid #0077ff;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: #0077ff;
  color: white;
}

.newsletter-signup {
  display: flex;
  gap: 0.5rem;
  max-width: 300px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.9rem;
}

.newsletter-btn {
  background: #0077ff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.newsletter-btn:hover {
  background: #005fcc;
}

/* Dark mode styles for Contact page */
body.dark-mode .contact-card,
body.dark-mode .contact-faq-item,
body.dark-mode .social-card {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode .contact-card h3,
body.dark-mode .contact-faq-item h3,
body.dark-mode .social-card h3 {
  color: #f9fafb;
}

body.dark-mode .contact-card p,
body.dark-mode .contact-faq-item p,
body.dark-mode .social-card p {
  color: #d1d5db;
}

body.dark-mode .newsletter-input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

/* Mobile responsiveness for Contact page */
@media (max-width: 768px) {
  .contact-grid,
  .contact-faq-grid,
  .social-grid {
    grid-template-columns: 1fr;
  }
  
  .newsletter-signup {
    flex-direction: column;
  }
  
  .social-links {
    flex-direction: column;
    align-items: center;
  }
}

/* Saved Page Specific Styles */
.saved-preview .saved-preview-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.saved-preview-text {
  font-weight: 500;
  font-size: 0.95rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #6b7280;
}

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

.empty-state h3 {
  font-size: 1.5rem;
  color: #374151;
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 119, 255, 0.3);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.action-card {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

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

.action-card h3 {
  font-size: 1.25rem;
  color: #1f2937;
  margin-bottom: 1rem;
  word-wrap: break-word;
}

.action-card p {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  word-wrap: break-word;
}

.action-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-block;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 119, 255, 0.3);
}

.action-status {
  background: #10b981;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Dark mode styles for Saved page */
body.dark-mode .empty-state {
  color: #9ca3af;
}

body.dark-mode .empty-state h3 {
  color: #f9fafb;
}

body.dark-mode .action-card {
  background: #374151;
  border-color: #4b5563;
}

body.dark-mode .action-card h3 {
  color: #f9fafb;
}

body.dark-mode .action-card p {
  color: #d1d5db;
}

/* Mobile responsiveness for Saved page */
@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  
  .action-card {
    padding: 1.5rem;
    margin: 0;
  }
  
  .action-card h3 {
    font-size: 1.1rem;
  }
  
  .action-card p {
    font-size: 0.9rem;
  }
  
  .empty-state {
    padding: 2rem 1rem;
  }
}

@media (max-width: 480px) {
  .quick-actions-grid {
    padding: 0 0.5rem;
    gap: 1rem;
  }
  
  .action-card {
    padding: 1rem;
  }
  
  .action-icon {
    font-size: 2.5rem;
  }
  
  .action-card h3 {
    font-size: 1rem;
  }
  
  .action-card p {
    font-size: 0.85rem;
  }
}

/* Enhanced Logged-In User Section */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.nav-user-info:hover {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.user-email {
  font-size: 0.9rem;
  color: #374151;
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-logout {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logout:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.nav-logout::before {
  content: '🚪';
  font-size: 0.8rem;
}

/* Mobile logged-in section */
.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  min-width: 0; /* Allow flex item to shrink */
  width: 100%; /* Take full width */
  box-sizing: border-box;
}

.mobile-user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0; /* Prevent avatar from shrinking */
}

.mobile-user-email {
  font-size: 0.85rem; /* Slightly smaller font */
  color: #374151;
  font-weight: 500;
  flex: 1;
  min-width: 0; /* Allow text to shrink */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all; /* Break long emails */
  max-width: calc(100% - 40px); /* Account for avatar and gap */
}

.mobile-nav-logout {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  justify-content: center;
}

.mobile-nav-logout:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.mobile-nav-logout::before {
  content: '🚪';
  font-size: 0.8rem;
}

/* Enhanced Login Modal Styling */
#auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

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

#auth-container {
  width: 90%;
  max-width: 400px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 2.5rem;
  position: relative;
  animation: slideUp 0.3s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#auth-container h2 {
  text-align: center;
  font-size: 1.75rem;
  color: #1f2937;
  margin-bottom: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#auth-container input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  color: #374151;
  box-sizing: border-box;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

#auth-container input:focus {
  outline: none;
  border-color: #0077ff;
  background: white;
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.1);
  transform: translateY(-1px);
}

#auth-container input::placeholder {
  color: #9ca3af;
}

.btn.auth-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.btn.auth-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn.auth-btn:hover::before {
  left: 100%;
}

#btn-signup {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
}

#btn-signup:hover {
  background: linear-gradient(135deg, #005fcc, #0047a3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 119, 255, 0.3);
}

#btn-login {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

#btn-login:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.auth-message {
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-message.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.auth-message.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* Close button for modal */
.auth-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Dark mode styles for auth modal */
body.dark-mode #auth-container {
  background: #1f2937;
  border-color: #374151;
}

body.dark-mode #auth-container h2 {
  color: #f9fafb;
}

body.dark-mode #auth-container input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode #auth-container input:focus {
  background: #4b5563;
  border-color: #3b82f6;
}

body.dark-mode #auth-container input::placeholder {
  color: #9ca3af;
}

body.dark-mode .auth-close {
  color: #9ca3af;
}

body.dark-mode .auth-close:hover {
  background: #374151;
  color: #f9fafb;
}

/* Modern Button Styling for Saved Plans and Dashboard */
.btn-secondary {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #374151;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Workout Card Styling */
.workout-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.workout-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.workout-card-header {
  margin-bottom: 1rem;
}

.workout-card-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 0.5rem 0;
}

.workout-date {
  font-size: 0.85rem;
  color: #6b7280;
  display: block;
}

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

/* Dark mode support for buttons and cards */
body.dark-mode .btn-secondary {
  background: linear-gradient(135deg, #374151, #4b5563);
  color: #f9fafb;
  border-color: #4b5563;
}

body.dark-mode .btn-secondary:hover {
  background: linear-gradient(135deg, #4b5563, #6b7280);
}

body.dark-mode .workout-card {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

body.dark-mode .workout-card-header h4 {
  color: #f9fafb;
}

body.dark-mode .workout-date {
  color: #9ca3af;
}

/* Confirmation Modal */
.confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirmation-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

.confirmation-content h3 {
  color: #1f2937;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.confirmation-content p {
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.confirmation-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

body.dark-mode .confirmation-content {
  background: #1f2937;
  border: 1px solid #374151;
}

body.dark-mode .confirmation-content h3 {
  color: #f9fafb;
}

body.dark-mode .confirmation-content p {
  color: #9ca3af;
}

/* Additional mobile improvements for user email */
@media (max-width: 480px) {
  .mobile-user-info {
    padding: 0.75rem 0.75rem; /* Slightly less padding on very small screens */
  }
  
  .mobile-user-email {
    font-size: 0.8rem; /* Even smaller font on very small screens */
    max-width: calc(100% - 35px); /* Adjust for smaller avatar gap */
  }
  
  .mobile-user-avatar {
    width: 28px; /* Slightly smaller avatar on very small screens */
    height: 28px;
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .mobile-user-email {
    font-size: 0.75rem; /* Smallest font for very narrow screens */
    max-width: calc(100% - 30px);
  }
  
  .mobile-user-avatar {
    width: 24px; /* Smallest avatar for very narrow screens */
    height: 24px;
    font-size: 0.7rem;
  }
}

/* ✅ NEW: Enhanced Loading States & Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* ✅ ENHANCED: Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.loading-pulse {
  animation: pulse 2s infinite;
}

/* ✅ ENHANCED: Smooth Transitions */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

.scale-in {
  animation: scaleIn 0.4s ease-out;
}

/* ✅ ENHANCED: Hover Effects */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

.hover-glow {
  transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

/* ✅ ENHANCED: Button Interactions */
.btn {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: scale(0.98);
}

/* ✅ ENHANCED: Form Interactions */
.input-wrapper {
  position: relative;
  transition: all var(--transition-normal);
}

.input-wrapper:focus-within {
  transform: translateY(-2px);
}

.input-wrapper:focus-within .input-icon {
  color: var(--primary-color);
  transform: scale(1.1);
}

/* ✅ ENHANCED: Card Animations */
.card-enter {
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}

.card-enter.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ✅ ENHANCED: Navigation Smoothness */
.nav-items a {
  position: relative;
  transition: all var(--transition-normal);
}

.nav-items a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: width var(--transition-normal);
}

.nav-items a:hover::after,
.nav-items a.active::after {
  width: 100%;
}

.nav-items a.active::after {
  animation: activePulse 2s ease-in-out infinite;
}

@keyframes activePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ✅ ENHANCED: Progress Indicators */
.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

/* ✅ ENHANCED: Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-tooltip);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: #ffffff !important;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #1a202c !important;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  min-width: 300px;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.toast.success {
  border-left: 4px solid #10b981;
  background: #f0fdf4 !important;
  color: #166534 !important;
}

.toast.error {
  border-left: 4px solid #ef4444;
  background: #fef2f2 !important;
  color: #991b1b !important;
}

.toast.info {
  border-left: 4px solid #3b82f6;
  background: #eff6ff !important;
  color: #1e40af !important;
}

.toast-icon {
  font-size: var(--font-size-lg);
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: inherit !important;
}

.toast-message {
  color: inherit !important;
  font-size: 14px;
}

.toast-close {
  background: none;
  border: none;
  color: #6b7280 !important;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.toast-close:hover {
  background: #f1f5f9;
  color: #1a202c !important;
}

/* Dark mode toast styling */
body.dark-mode .toast {
  background: #2d3748 !important;
  border: 1px solid #4a5568;
  color: #e2e8f0 !important;
}

body.dark-mode .toast.success {
  background: #065f46 !important;
  color: #d1fae5 !important;
}

body.dark-mode .toast.error {
  background: #7f1d1d !important;
  color: #fecaca !important;
}

body.dark-mode .toast.info {
  background: #1e3a8a !important;
  color: #dbeafe !important;
}

body.dark-mode .toast-title {
  color: inherit !important;
}

body.dark-mode .toast-message {
  color: inherit !important;
}

body.dark-mode .toast-close {
  color: #a0aec0 !important;
}

body.dark-mode .toast-close:hover {
  background: #4a5568;
  color: #e2e8f0;
}

/* Workout Display Styles */
.workout-results {
  margin: 2rem 0;
  padding: 0 1rem;
}

.workout-display {
  background: var(--bg-card, #ffffff);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.1));
  margin: 2rem auto;
  max-width: 800px;
}

.workout-header {
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-primary, #e2e8f0);
  padding-bottom: 1.5rem;
}

.workout-header h2 {
  color: var(--primary-color, #00d97e);
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 700;
}

.workout-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.workout-meta span {
  background: var(--bg-secondary, #f8fafc);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-primary, #1a202c);
}

.workout-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.workout-section {
  margin-bottom: 2rem;
}

.workout-section h3 {
  color: var(--secondary-color, #6366f1);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.exercises {
  display: grid;
  gap: 1rem;
}

.exercise-card {
  background: var(--bg-tertiary, #f8fafc);
  border-radius: 12px;
  padding: 1.5rem;
  border-left: 4px solid var(--primary-color, #00d97e);
  transition: all 0.3s ease;
}

.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.exercise-info h4 {
  color: var(--text-primary, #1a202c);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.exercise-details {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.exercise-details span {
  background: var(--bg-primary, #ffffff);
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary, #4a5568);
}

.exercise-tip {
  background: var(--bg-accent, #fffbeb);
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 1rem;
  color: var(--text-primary, #1a202c);
  font-style: italic;
}

/* Dark mode workout display */
body.dark-mode .workout-display {
  background: var(--bg-card-dark, #2d3748);
  color: #e2e8f0;
}

body.dark-mode .workout-meta span {
  background: #4a5568;
  color: #e2e8f0;
}

body.dark-mode .exercise-card {
  background: #4a5568;
  color: #e2e8f0;
}

body.dark-mode .exercise-details span {
  background: #2d3748;
  color: #a0aec0;
}

body.dark-mode .exercise-tip {
  background: #2d3748;
  border-color: #d69e2e;
  color: #e2e8f0;
}

/* ✅ ENHANCED: Modal Animations */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  opacity: 0;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.show .modal-content {
  transform: scale(1);
  opacity: 1;
}

/* ✅ ENHANCED: Dark Mode Transitions */
body {
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body * {
  transition: background-color var(--transition-normal), 
              color var(--transition-normal), 
              border-color var(--transition-normal),
              box-shadow var(--transition-normal);
}

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

/* ✅ ENHANCED: Focus States */
.btn:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ✅ ENHANCED: Loading Spinner */
.spinner-enhanced {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

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

/* ✅ ENHANCED: Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
}

/* ✅ ENHANCED: Ripple Effect Animation */
@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ✅ ENHANCED: Field Error Styles */
.field-error {
  color: #ef4444;
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
  animation: fadeInUp 0.3s ease-out;
}

.input-wrapper input.error,
.input-wrapper textarea.error,
.input-wrapper select.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.input-wrapper.focused input,
.input-wrapper.focused textarea,
.input-wrapper.focused select {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ✅ ENHANCED: Loading State Styles */
.loading-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: var(--radius-lg);
}

.dark-mode .loading-state {
  background: rgba(15, 23, 42, 0.9);
}

.loading-state p {
  margin-top: var(--space-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

/* ✅ ENHANCED: Enhanced Button States */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ✅ ENHANCED: Focus Indicators for Accessibility */
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ✅ ENHANCED: Smooth Page Transitions */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-normal);
}

.page-transition.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* ✅ ENHANCED: Enhanced Card Interactions */
.card-interactive {
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card-interactive::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left var(--transition-slow);
}

.card-interactive:hover::before {
  left: 100%;
}

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

/* ✅ ENHANCED: Success/Error States */
.state-success {
  border-color: var(--secondary-color) !important;
  background-color: rgba(16, 185, 129, 0.05) !important;
}

.state-error {
  border-color: #ef4444 !important;
  background-color: rgba(239, 68, 68, 0.05) !important;
}

.state-warning {
  border-color: var(--accent-color) !important;
  background-color: rgba(245, 158, 11, 0.05) !important;
}

/* ✅ ENHANCED: Micro-interactions */
.micro-bounce {
  animation: microBounce 0.3s ease-out;
}

@keyframes microBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.micro-shake {
  animation: microShake 0.5s ease-out;
}

@keyframes microShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ✅ ENHANCED: Enhanced Typography */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ✅ ENHANCED: Enhanced Spacing Utilities */
.space-xs { margin: var(--space-xs); }
.space-sm { margin: var(--space-sm); }
.space-md { margin: var(--space-md); }
.space-lg { margin: var(--space-lg); }
.space-xl { margin: var(--space-xl); }

.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

/* ✅ ENHANCED: Responsive Utilities */
.hide-mobile {
  display: block;
}

.show-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }
  
  .show-mobile {
    display: block;
  }
}

/* ✅ ENHANCED: Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .btn, .nav-links, .dark-mode-toggle {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   🎯 ENHANCED TEMPLATE SELECTION INTERFACE
   ═══════════════════════════════════════════════════════════════ */

.template-selection-section {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.template-header {
  text-align: center;
  margin-bottom: 2rem;
}

.template-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.template-subtitle {
  color: #64748b;
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Template Filters */
.template-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

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

.filter-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-select:hover {
  border-color: #9ca3af;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.template-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.template-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.template-card:hover::before {
  transform: scaleX(1);
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #e5e7eb;
}

.template-card.selected {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #dbeafe 0%, #f0f9ff 100%);
}

.template-card.selected::before {
  transform: scaleX(1);
}

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

.template-card-icon {
  font-size: 2rem;
  margin-right: 0.75rem;
}

.template-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  flex: 1;
}

.template-difficulty-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-difficulty-badge.beginner {
  background: #d1fae5;
  color: #065f46;
}

.template-difficulty-badge.intermediate {
  background: #fef3c7;
  color: #92400e;
}

.template-difficulty-badge.advanced {
  background: #fee2e2;
  color: #991b1b;
}

.template-card-description {
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.template-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.template-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.template-meta-icon {
  font-size: 0.9rem;
}

.template-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.template-tag {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.template-card-footer {
  display: flex;
  justify-content: between;
  align-items: center;
  gap: 1rem;
}

.template-select-btn {
  flex: 1;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.template-select-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

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

.template-customize-btn {
  background: white;
  color: #6b7280;
  border: 2px solid #e5e7eb;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.template-customize-btn:hover {
  color: #374151;
  border-color: #9ca3af;
}

/* Template Loading State */
.template-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #6b7280;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Template Actions */
.template-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.show-more-btn, .reset-filters-btn {
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.show-more-btn {
  background: #3b82f6;
  color: white;
  border: none;
}

.show-more-btn:hover {
  background: #2563eb;
}

.reset-filters-btn {
  background: white;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}

.reset-filters-btn:hover {
  color: #374151;
  border-color: #9ca3af;
}

/* Empty State */
.template-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
}

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

.template-empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.5rem;
}

.template-empty-description {
  color: #6b7280;
  font-size: 1rem;
}

/* Dark Mode Support */
body.dark-mode .template-selection-section {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

body.dark-mode .template-title {
  color: #f8fafc;
}

body.dark-mode .template-subtitle {
  color: #94a3b8;
}

body.dark-mode .template-filters {
  background: rgba(30, 41, 59, 0.7);
}

body.dark-mode .filter-label {
  color: #e2e8f0;
}

body.dark-mode .filter-select {
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

body.dark-mode .template-card {
  background: #334155;
  border-color: #475569;
}

body.dark-mode .template-card:hover {
  background: #475569;
}

body.dark-mode .template-card-title {
  color: #f8fafc;
}

body.dark-mode .template-card-description {
  color: #94a3b8;
}

body.dark-mode .template-meta-item {
  background: #475569;
  color: #94a3b8;
}

body.dark-mode .template-loading {
  color: #94a3b8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .template-selection-section {
    padding: 1.5rem;
    margin: 1rem 0;
  }
  
  .template-filters {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .template-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .template-card {
    padding: 1rem;
  }
  
  .template-card-meta {
    gap: 0.5rem;
  }
  
  .template-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .template-title {
    font-size: 1.5rem;
  }
  
  .template-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .template-card-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ✅ TEMPLATE CARD STYLES */
.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
  box-shadow: var(--shadow-sm);
}

.template-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-secondary);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.template-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.template-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.template-difficulty {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.template-difficulty.beginner {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.template-difficulty.intermediate {
  background: rgba(251, 191, 36, 0.1);
  color: #d97706;
}

.template-difficulty.advanced {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.template-duration {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.template-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

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

.template-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.template-card-footer {
  margin-top: auto;
}

.template-card-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  white-space: nowrap;
}

.template-card-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

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

/* Template grid layout */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .template-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .template-card {
    padding: 1rem;
  }
  
  .template-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .template-card-meta {
    align-items: flex-start;
    flex-direction: row;
    gap: 0.5rem;
  }
}

/* ✅ DARK THEME STYLES */
[data-theme="dark"] {
  /* Background Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;
  --bg-overlay: rgba(0, 0, 0, 0.8);
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  /* Border Colors */
  --border-primary: #334155;
  --border-secondary: #475569;
  --border-focus: #6366f1;
  
  /* Adjust shadows for dark theme */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Dark theme specific overrides */
[data-theme="dark"] body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

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

[data-theme="dark"] .features-section {
  background: var(--bg-secondary);
}

[data-theme="dark"] .feature-card {
  background: var(--bg-card);
  border-color: var(--border-primary);
}

[data-theme="dark"] .template-card {
  background: var(--bg-card);
  border-color: var(--border-primary);
}

[data-theme="dark"] .template-card:hover {
  border-color: var(--border-secondary);
}

[data-theme="dark"] input, 
[data-theme="dark"] select, 
[data-theme="dark"] button {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

[data-theme="dark"] .plan-display-container {
  background: var(--bg-card);
  border-color: var(--border-primary);
}

/* Smooth transitions for theme changes */
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   IMPROVED WORKOUT PLAN DISPLAY STYLES
   ======================================== */

/* Override existing workout plan styles with improved layout */
#plan-display .workout-plan {
  background: var(--bg-secondary, #ffffff);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-primary, #e5e7eb);
  max-width: none;
}

#plan-display .plan-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-primary, #e5e7eb);
}

#plan-display .plan-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

#plan-display .plan-description {
  font-size: 1.125rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

#plan-display .plan-meta {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

#plan-display .plan-meta span {
  background: var(--success-bg, #f0f9ff);
  color: var(--primary-color, #0ea5e9);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
}

#plan-display .workouts {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

#plan-display .workout {
  background: var(--bg-tertiary, #f8fafc);
  border-radius: 12px;
  padding: 2rem;
  border-left: 4px solid var(--primary-color, #0ea5e9);
  margin-bottom: 0;
}

#plan-display .workout-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin-bottom: 0.5rem;
}

#plan-display .workout-description {
  font-size: 1rem;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

#plan-display .workout-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

#plan-display .workout-type,
#plan-display .workout-duration {
  background: var(--bg-secondary, #ffffff);
  border: 1px solid var(--border-primary, #e5e7eb);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary, #1f2937);
}

#plan-display .exercises {
  display: grid;
  gap: 1.5rem;
}

#plan-display .exercise {
  background: var(--bg-secondary, #ffffff);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-primary, #e5e7eb);
  transition: all 0.3s ease;
  position: relative;
}

#plan-display .exercise:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

#plan-display .exercise-header {
  margin-bottom: 1rem;
}

#plan-display .exercise-header h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#plan-display .exercise-header h4::before {
  content: counter(exercise-counter);
  counter-increment: exercise-counter;
  background: var(--primary-color, #0ea5e9);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

#plan-display .workout {
  counter-reset: exercise-counter;
}

#plan-display .exercise-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

#plan-display .sets-reps,
#plan-display .rest {
  background: var(--success-bg, #f0f9ff);
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border-light, #e0f2fe);
  font-weight: 600;
  color: var(--primary-color, #0ea5e9);
}

#plan-display .instructions {
  background: var(--bg-tertiary, #f8fafc);
  border: 1px solid var(--border-primary, #e5e7eb);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--text-primary, #1f2937);
}

#plan-display .tips {
  background: var(--warning-bg, #fffbeb);
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 1rem;
  line-height: 1.6;
  color: #92400e;
}

#plan-display .tips strong {
  color: #78350f;
  margin-right: 0.5rem;
}

#plan-display .plan-schedule,
#plan-display .plan-tips,
#plan-display .plan-warnings {
  margin-top: 2.5rem;
  padding: 2rem;
  border-radius: 12px;
}

#plan-display .plan-schedule {
  background: var(--info-bg, #f0f9ff);
  border: 1px solid var(--primary-color, #0ea5e9);
}

#plan-display .plan-tips {
  background: var(--success-bg, #f0fdf4);
  border: 1px solid #22c55e;
}

#plan-display .plan-warnings {
  background: var(--error-bg, #fef2f2);
  border: 1px solid #ef4444;
}

#plan-display .plan-schedule h3,
#plan-display .plan-tips h3,
#plan-display .plan-warnings h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary, #1f2937);
}

#plan-display .plan-schedule p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  color: var(--text-primary, #1f2937);
}

#plan-display .plan-tips ul,
#plan-display .plan-warnings ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#plan-display .plan-tips li,
#plan-display .plan-warnings li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

#plan-display .plan-tips li::before {
  content: "✅";
  position: absolute;
  left: 0;
  top: 0;
}

#plan-display .plan-warnings li::before {
  content: "⚠️";
  position: absolute;
  left: 0;
  top: 0;
}

/* Dark Mode Styles for Improved Layout */
[data-theme="dark"] #plan-display .workout-plan,
body.dark-mode #plan-display .workout-plan {
  background: var(--bg-primary, #0f172a);
  border-color: var(--border-primary, #334155);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #plan-display .plan-header,
body.dark-mode #plan-display .plan-header {
  border-bottom-color: var(--border-primary, #334155);
}

[data-theme="dark"] #plan-display .plan-header h2,
body.dark-mode #plan-display .plan-header h2 {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] #plan-display .plan-description,
body.dark-mode #plan-display .plan-description {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] #plan-display .workout,
body.dark-mode #plan-display .workout {
  background: var(--bg-secondary, #1e293b);
  border-left-color: var(--primary-color, #0ea5e9);
}

[data-theme="dark"] #plan-display .exercise,
body.dark-mode #plan-display .exercise {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--border-primary, #334155);
}

[data-theme="dark"] #plan-display .exercise:hover,
body.dark-mode #plan-display .exercise:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] #plan-display .exercise-header h4,
body.dark-mode #plan-display .exercise-header h4 {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] #plan-display .workout-header h3,
body.dark-mode #plan-display .workout-header h3 {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] #plan-display .workout-description,
body.dark-mode #plan-display .workout-description {
  color: var(--text-secondary, #cbd5e1);
}

[data-theme="dark"] #plan-display .workout-type,
[data-theme="dark"] #plan-display .workout-duration,
body.dark-mode #plan-display .workout-type,
body.dark-mode #plan-display .workout-duration {
  background: var(--bg-primary, #0f172a);
  border-color: var(--border-primary, #334155);
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] #plan-display .sets-reps,
[data-theme="dark"] #plan-display .rest,
body.dark-mode #plan-display .sets-reps,
body.dark-mode #plan-display .rest {
  background: var(--bg-primary, #0f172a);
  border-color: var(--border-primary, #334155);
  color: var(--primary-color, #0ea5e9);
}

[data-theme="dark"] #plan-display .instructions,
body.dark-mode #plan-display .instructions {
  background: var(--bg-tertiary, #334155);
  border-color: var(--border-primary, #475569);
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] #plan-display .tips,
body.dark-mode #plan-display .tips {
  background: #451a03;
  border-color: #f59e0b;
  color: #fbbf24;
}

[data-theme="dark"] #plan-display .plan-schedule,
body.dark-mode #plan-display .plan-schedule {
  background: var(--bg-secondary, #1e293b);
  border-color: var(--primary-color, #0ea5e9);
}

[data-theme="dark"] #plan-display .plan-schedule h3,
[data-theme="dark"] #plan-display .plan-schedule p,
body.dark-mode #plan-display .plan-schedule h3,
body.dark-mode #plan-display .plan-schedule p {
  color: var(--text-primary, #f8fafc);
}

[data-theme="dark"] #plan-display .plan-tips,
body.dark-mode #plan-display .plan-tips {
  background: #064e3b;
  border-color: #10b981;
  color: #6ee7b7;
}

[data-theme="dark"] #plan-display .plan-warnings,
body.dark-mode #plan-display .plan-warnings {
  background: #7f1d1d;
  border-color: #f87171;
  color: #fca5a5;
}

/* Responsive Design for Workout Plans */
@media (max-width: 768px) {
  #plan-display .workout-plan {
    padding: 1.5rem;
    margin: 1rem 0;
  }
  
  #plan-display .plan-header h2 {
    font-size: 2rem;
  }
  
  #plan-display .exercise-details {
    grid-template-columns: 1fr;
  }
  
  #plan-display .plan-meta {
    gap: 1rem;
  }
  
  #plan-display .workout-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ✅ ENHANCED: Accessibility - Touch Targets */
.nav-btn,
.btn-primary,
.action-btn,
.auth-btn,
.menu-toggle,
.dark-mode-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

/* Ensure toggle switches are accessible */
.switch {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
}

/* Make links touchable */
.nav-items a {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  display: inline-flex;
  align-items: center;
}

/* Ensure form inputs are accessible */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  min-height: 44px;
  padding: 0.5rem 1rem;
}

