/* 🌐 Global Reset & Scroll Fix */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  font-family: system-ui, sans-serif;
  background: linear-gradient(to bottom right, #ececec, #d4f3ff);
  color: #333;
}

/* 🧱 Layout Containers */
.container {
  width: 100%;
  padding: 0;
  overflow-x: hidden;
}

.dashboard {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

/* 📢 Header & Footer */
.header {
  background: #007bff;
  color: white;
  padding: 1.5rem 1rem;
  text-align: center;
}

.footer {
  background: #f0f0f0;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #666;
}

/* 🧩 Card Components - Shared Styles */
.card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

.card-section {
  margin-bottom: 2.5rem;
}

.card-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* 1️⃣ Tiny Cards Section */
.card-section.tiny {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-tiny {
  flex: 1 1 calc(33.333% - 1rem);
  height: 60px;
  font-size: 0.9rem;
}

/* 2️⃣ Big Cards Section */
.card-section.big {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.card-big {
  height: 160px;
  font-size: 1.1rem;
}

/* 3️⃣ & 5️⃣ Medium Cards (Goals & Upcoming) */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-medium {
  height: 100px;
  font-size: 1rem;
}

/* 4️⃣ Scrollable Cards Section (Discover Picks) */
.scroll-row {
  display: flex;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  gap: 1rem;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

.card-scroll {
  min-width: 180px;
  height: 120px;
  flex-shrink: 0;
}

/* 🖥️ Responsive Desktop Layout */
@media (min-width: 768px) {
  .card-section.big {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-grid {
    flex-direction: row;
    justify-content: space-between;
  }

  .card-medium {
    flex: 1 1 calc(33.333% - 1rem);
  }

  .card-tiny {
    flex: 1 1 calc(30% - 1rem);
  }
}

/* Plan modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 999;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: min(520px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 8px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.modal-body h3 {
  margin: 0 0 6px;
}

.modal-subtext {
  margin: 0 0 16px;
  color: #475569;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.modal-field label {
  font-weight: 600;
  color: #0f172a;
}

.modal-field select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
}

.modal-preview {
  background: #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 16px;
}

.modal-preview h4 {
  margin: 0 0 8px;
}

.primary-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: #0ea5e9;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  font-size: 1rem;
}

.primary-btn:hover {
  background: #0284c7;
}

/* 🎯 Race Prep Modal */
.race-prep.hidden {
  display: none;
}

.race-prep {
  background: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ⏱️ Race Countdown Block */
.race-countdown {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 2rem;
}

.race-countdown input {
  padding: 0.5rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* ✨ Highlight Animation for Flash Effect */
.highlight {
  animation: flash 3s ease-in-out;
}

@keyframes flash {
  0% { background-color: #fffecb; }
  50% { background-color: #f9f871; }
  100% { background-color: white; }
}

/* 📍 Local Event List Styles */
.event-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-items li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  font-size: 1rem;
}

/* 🔗 Link Styling for Tiny Cards */
.card-tiny:link,
.card-tiny:visited {
  text-decoration: none;
  color: inherit;
}

/* 🏁 Waterside Half Marathon Sections */
.hidden {
  display: none;
}

.waterside-details {
  background: #fff;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.checklist {
  padding-left: 1.2rem;
  line-height: 1.6;
}

.race-week-list {
  padding-left: 1.2rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* 📝 Run Logging Form */
.run-log-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--card-bg, #f9f9f9);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  max-width: 400px;
}

.run-log-form label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.run-log-form input,
.run-log-form select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

.run-log-form button {
  background-color: #0077cc;
  color: white;
  font-weight: bold;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.run-log-form button:hover {
  background-color: #005fa3;
}

#runMessage {
  margin-top: 0.5rem;
  font-style: italic;
  color: #333;
}

#nextRaceCard {
    padding: 1rem;
    border-radius: 10px;
    background: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
  }

  .auth-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }
  
  .auth-form {
    margin-bottom: 1em;
  }
  
  .auth-form input {
    width: 100%;
    margin: 6px 0;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
  }
  
  .auth-form button, #logoutBtn {
    padding: 10px 20px;
    border: none;
    background: #0077cc;
    color: white;
    border-radius: 8px;
    cursor: pointer;
  }
  
.auth-form button:hover, #logoutBtn:hover {
  background: #005fa3;
}

/* Plan snapshot */
#planSnapshot {
  background: #fff;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: #0ea5e9;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: #475569;
}
  
  
