/* Basic reset and variables */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Define theme color variables for consistency */
:root {
  --color-primary: #004e8a;
  --color-primary-dark: #002f5b;
  --color-secondary: #00a896;
  --color-secondary-light: #00c1a6;
  --color-accent: #007acc;
  --color-background: #f8fbff;
  --color-background-alt: #eaf3fb;
  --color-light: #ffffff;
  --color-text: #222222;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  /* Subtle gradient background for a clean, modern look using theme variables */
  background: linear-gradient(180deg, var(--color-background) 0%, var(--color-background-alt) 100%);
  /* Use theme text color for better contrast on light backgrounds */
  color: var(--color-text);
  /* Base font size for desktop */
  font-size: 16px;
}

a {
  color: #005ea2;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

/* Global heading styles for consistency across pages */
h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #0a2540;
  text-align: center;
}
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: #0a2540;
  text-align: center;
}

/* Navigation */
.navbar {
  /* Gradient for navigation bar using theme colors */
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: var(--color-light);
  padding: 0.75rem 0;
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
}
.cta-btn {
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  color: var(--color-light);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.cta-btn:hover {
  background: linear-gradient(90deg, #028079 0%, #00b190 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Additional navigation link styling */
.nav-links {
  display: flex;
  align-items: center;
}
.nav-links a {
  margin-left: 1rem;
  color: var(--color-light);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
/* Highlight the active page within navigation */
.nav-links .active-link {
  background: var(--color-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--color-light);
}
.nav-links a:hover {
  text-decoration: underline;
  background: rgba(255, 255, 255, 0.15);
}
/* Tracker link style for home page nav */
.tracker-link {
  border: 2px solid #00a896;
  color: #00a896;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.tracker-link:hover {
  background: #00a896;
  color: #fff;
}

/* Hero section */
.hero {
  /* Replace the background image with a vibrant gradient for a stunning look */
  background: linear-gradient(135deg, #004e8a 0%, #00a5a8 100%);
  color: #fff;
  padding: 5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Add a dark overlay over the hero background to improve text readability */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Slightly lighten the overlay since there is no image underneath */
  background: rgba(0, 0, 0, 0.2);
  z-index: 0;
}

/* Ensure hero content appears above the overlay */
.hero > * {
  position: relative;
  z-index: 1;
}
.hero-content {
  max-width: 700px;
  margin: 0 auto;
}
.primary-btn {
  display: inline-block;
  margin-top: 1.5rem;
  background: linear-gradient(90deg, #00a896 0%, #00c1a6 100%);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  transition: background 0.2s;
}
.primary-btn:hover {
  background: linear-gradient(90deg, #028079 0%, #00b190 100%);
}

/* How it works */
.how-it-works {
  padding: 3rem 0;
  background: #fff;
}
.how-it-works h2 {
  text-align: center;
  margin-bottom: 2rem;
}
.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.step {
  flex: 1 1 200px;
  background: #f0f4fa;
  padding: 1rem;
  border-radius: 6px;
  text-align: center;
}
.step h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

/* Footer */
.footer {
  /* Gradient footer to complement the header and hero */
  background: linear-gradient(90deg, #004e8a 0%, #0a2540 100%);
  color: #ffffff;
  text-align: center;
  padding: 1rem;
}

/* Planner form */
.plan-form {
  margin-top: 2rem;
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.plan-form fieldset {
  border: none;
  margin-bottom: 1.5rem;
}
.plan-form legend {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #0a2540;
}
.plan-form label {
  display: block;
  margin-bottom: 1rem;
}
.plan-form input[type='number'],
.plan-form input[type='date'],
.plan-form select,
.plan-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}
.checkboxes label {
  display: block;
  margin-bottom: 0.25rem;
}
.secondary-btn {
  margin-top: 1.5rem;
  background: #eaf5f1;
  color: #00a896;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
.secondary-btn:hover {
  background: #d4ebe2;
}

.plan-output {
  margin-top: 2rem;
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Countdown container styling */
.countdown {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background-color: #f5faff;
  border-left: 4px solid #007acc;
  border-radius: 6px;
}
.countdown h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}
.countdown ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}
.countdown li {
  list-style-type: disc;
  margin-bottom: 0.25rem;
}

/* Coach search results */
.coach-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.coach-card {
  background: #ffffff;
  border: 1px solid #e0eaf0;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.coach-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.coach-card p {
  margin-bottom: 0.5rem;
}
.coach-card a.secondary-btn {
  display: inline-block;
  margin-top: 0.5rem;
}

/* Coach announcement banner styling */
.coach-banner {
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  color: var(--color-light);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}
.coach-banner p {
  margin-bottom: 0.5rem;
}
.coach-banner a {
  color: var(--color-light);
  font-weight: bold;
  text-decoration: underline;
  transition: opacity 0.2s;
}
.coach-banner a:hover {
  opacity: 0.9;
}
.plan-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.plan-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  overflow-x: auto;
  display: block;
}
.plan-table th,
.plan-table td {
  border: 1px solid #ddd;
  padding: 0.5rem;
  text-align: left;
  vertical-align: top;
}
.plan-table th {
  background: #f0f8ff;
  border: 1px solid #d0e2ff;
}

/* Completed workout indicator */
.plan-table td.completed {
  background: #e6f9ec;
  border-color: #b5e3c6;
  font-weight: 500;
}

/* Info icon styling for tooltips */
.info-icon {
  display: inline-block;
  margin-left: 0.25rem;
  width: 1.1rem;
  height: 1.1rem;
  line-height: 1.1rem;
  text-align: center;
  border-radius: 50%;
  background-color: #007acc;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
}

/* Tooltip for info icons, shown on click */
.info-tooltip {
  display: none;
  margin-left: 0.5rem;
  background-color: #007acc;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: normal;
  position: relative;
  z-index: 10;
}

.info-tooltip.visible {
  display: inline-block;
}

/* Achievements section styling */
.achievements-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.achievement-badge {
  background: #f5faff;
  border-left: 4px solid #00a896;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  min-width: 200px;
  max-width: 250px;
}
.achievement-badge h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0a2540;
}
.achievement-badge p {
  margin: 0;
  font-size: 0.875rem;
  color: #333;
}

@media (max-width: 600px) {
  /* Increase base font size on small screens for better readability */
  body {
    font-size: 17px;
  }
  /* Increase table cell font size on mobile */
  .plan-table th,
  .plan-table td {
    font-size: 0.9rem;
  }
  .steps {
    flex-direction: column;
  }
  .hero {
    padding: 2rem 0;
  }

  /* Responsive nav: stack links and add borders on small screens */
  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0.5rem;
  }
  .nav-links a {
    margin-left: 0;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    width: 100%;
    text-align: left;
  }
  /* Ensure active link stands out even in mobile layout */
  .nav-links .active-link {
    background: #00a896;
    color: #fff;
    border-color: #00a896;
  }
  /* Make plan actions buttons full width on mobile */
  .plan-actions {
    flex-direction: column;
    width: 100%;
  }
  .plan-actions .secondary-btn,
  .plan-actions .primary-btn {
    width: 100%;
    margin-top: 0.5rem;
  }
  /* Adjust achievements container to stack badges */
  .achievements-container {
    flex-direction: column;
  }
  .coach-list {
    grid-template-columns: 1fr;
  }
}