body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background: #f9fafb;
  color: #333;
  margin: 0;
  padding: 0;
}

a {
  color: #3b82f6;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* --- Progress Bar --- */
.vrs-progress-bar {
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
  height: 12px;
  margin: 10px 0;
}
.vrs-progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #81c784);
  width: 0;
  transition: width 1s ease;
}

/* --- Challenge Card --- */
.vrs-challenge-card {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease;
}
.vrs-challenge-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* --- Buttons --- */
button, .button {
  background-color: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}
button:disabled, .button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}
button:hover:not(:disabled), .button:hover:not(:disabled) {
  background-color: #2563eb;
}

/* --- Modal Styles --- */
.vrs-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.vrs-modal-content {
  background: white;
  max-width: 600px;
  width: 90%;
  border-radius: 12px;
  padding: 20px 25px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

#vrs-modal-close {
  position: absolute;
  top: 12px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: #555;
}

#vrs-modal-close:hover {
  color: #000;
}

/* --- AI Chat --- */
#vrs-modal-ai-chat {
  margin-top: 20px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

#vrs-ai-input {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  resize: vertical;
}

#vrs-ai-send {
  margin-top: 8px;
  width: 100%;
}

#vrs-ai-response {
  margin-top: 12px;
  background: #f0f9ff;
  border-radius: 6px;
  padding: 10px;
  font-style: italic;
  max-height: 150px;
  overflow-y: auto;
}

/* --- Quiz Styles --- */
#vrs-modal-quiz fieldset {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 15px;
  margin-bottom: 15px;
}

#vrs-modal-quiz legend {
  font-weight: 600;
  margin-bottom: 8px;
}

#vrs-modal-quiz label {
  cursor: pointer;
}

#vrs-modal-quiz button[type="submit"] {
  background-color: #10b981;
  width: 100%;
  padding: 10px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  color: white;
  transition: background-color 0.3s ease;
}

#vrs-modal-quiz button[type="submit"]:hover {
  background-color: #059669;
}

/* --- Branching buttons --- */
.vrs-branching-options p {
  font-weight: 600;
  margin-bottom: 10px;
}

.vrs-branch-btn {
  background-color: #f97316;
  color: white;
  border: none;
  padding: 8px 14px;
  margin: 4px 6px 8px 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.vrs-branch-btn:hover {
  background-color: #c2410c;
}

/* --- Leaderboard --- */
#vrs-leaderboard ol {
  list-style-position: inside;
  padding-left: 0;
  max-height: 280px;
  overflow-y: auto;
}

#vrs-leaderboard li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

#vrs-leaderboard img {
  border-radius: 50%;
  margin-right: 12px;
  border: 2px solid #3b82f6;
  width: 40px;
  height: 40px;
  object-fit: cover;
}

/* --- Manual submission form --- */
#vrs-manual-submit label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

#vrs-manual-submit input {
  width: 100%;
  max-width: 150px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

#vrs-manual-submit button {
  margin-top: 8px;
}
.vrs-waypoint-marker {
  box-shadow: 0 0 6px rgba(255, 87, 34, 0.8);
  transition: transform 0.2s ease;
}
.vrs-waypoint-marker:hover {
  transform: scale(1.3);
  box-shadow: 0 0 12px rgba(255, 87, 34, 1);
}

.vrs-friend-marker {
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.8);
  transition: transform 0.2s ease;
}
.vrs-friend-marker:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(59, 130, 246, 1);
}
.vrs-waypoint-marker {
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
  transition: transform 0.2s ease;
}
.vrs-waypoint-marker:hover {
  transform: scale(1.4);
  box-shadow: 0 0 12px rgba(245, 158, 11, 1);
}

.vrs-friend-marker {
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.8);
  transition: transform 0.2s ease;
}
.vrs-friend-marker:hover {
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(59, 130, 246, 1);
}
.vrs-user-marker {
  background-size: cover;
  background-position: center;
  cursor: pointer;
}
.vrs-leaderboard-list, .vrs-friends-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.vrs-leaderboard-list li, .vrs-friends-list li {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}
/* ————— Manual Activity Modal Improvements ————— */

#vrs-manual-activity-modal form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

#vrs-manual-activity-modal form input,
#vrs-manual-activity-modal form select {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
}

#vrs-manual-activity-form button {
  margin-right: 8px;
}
/* constrain and wrap waypoint pop-up content */
.mapboxgl-popup-content {
  max-width: 220px;          /* adjust to taste */
  white-space: normal;       /* allow text to wrap */
  overflow-wrap: break-word; /* break long words/URLs */
  word-wrap: break-word;     /* legacy word-wrap support */
}

/* ensure videos/images inside pop-ups scale within that width */
.mapboxgl-popup-content video,
.mapboxgl-popup-content img {
  max-width: 100%;
  height: auto;
}
.vrs-form-group {
  margin-bottom: 16px;
}

.vrs-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
}

.vrs-form-group input[type="number"],
.vrs-form-group input[type="text"],
.vrs-form-group select,
.vrs-form-group input[type="file"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.vrs-btn-submit {
  width: 100%;
  padding: 10px 0;
  background: #c17846;
  color: #fff;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.vrs-btn-submit:hover {
  background: #a65f34;
}

.vrs-popup-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #888;
}
/* All Routes grid & cards */
.vrs-all-routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px,1fr));
  gap: 20px;
  margin: 20px 0;
}
.vrs-route-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease;
}
.vrs-route-card:hover {
  transform: translateY(-4px);
}
.vrs-route-thumb {
  width: 100%;
  padding-top: 56%; /* 16:9 aspect ratio */
  background-size: cover;
  background-position: center;
}
.vrs-route-title {
  margin: 12px 16px 4px;
  font-size: 1.1rem;
}
.vrs-route-dates {
  font-size: .9rem;
  color: #666;
  margin: 0 16px 12px;
}
.vrs-route-dates time {
  display: block;
}
.vrs-join-btn {
  margin: auto 16px 16px;
  padding: 10px 0;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  transition: background .2s ease;
}
.vrs-join-btn.joined {
  background: #9ca3af;
  cursor: default;
}
.vrs-join-btn:not(.joined):hover {
  background: #2563eb;
}
/* ——— My Challenges: match All Routes card style ——— */

/* Turn the container into the same responsive grid */
.vrs-challenges-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

/* Card styling */
.vrs-challenge-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: transform 0.2s ease;
}

.vrs-challenge-card:hover {
  transform: translateY(-4px);
}

/* Title */
.vrs-challenge-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

/* Thicker progress bar */
.vrs-challenge-card .vrs-progress-bar {
  height: 14px;
  margin: 12px 0;
}

.vrs-challenge-card .vrs-progress-fill {
  /* Inherit your existing gradient */
  background: linear-gradient(90deg, #4caf50, #81c784);
}

/* Percentage text spacing */
.vrs-challenge-card p {
  margin: 0 0 12px;
  font-weight: 600;
}

/* Button sits at bottom of card */
.vrs-challenge-card .vrs-btn {
  margin-top: auto;
  padding: 10px 0;
  border-radius: 6px;
  font-weight: 600;
}

/* Completed badge tweaks */
.vrs-challenge-card .vrs-completed-badge {
  margin-top: 12px;
  font-weight: 700;
  color: #388e3c;
}
/* — My Challenges: Card Grid & Thumbnails — */

.vrs-challenges-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.vrs-challenge-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.vrs-challenge-card:hover {
  transform: translateY(-4px);
}

.vrs-challenge-thumb {
  width: 100%;
  padding-top: 56%;    /* 16:9 aspect ratio */
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}

.vrs-challenge-card h3 {
  margin: 0 16px 12px;
  font-size: 1.1rem;
}

.vrs-challenge-card .vrs-progress-bar {
  margin: 0 16px 12px;
  height: 14px;
}

.vrs-challenge-card .vrs-progress-fill {
  background: linear-gradient(90deg, #4caf50, #81c784);
}

.vrs-challenge-card p {
  margin: 0 16px 12px;
  font-weight: 600;
}

.vrs-challenge-card .vrs-btn {
  margin: auto 16px 16px;
  padding: 10px 0;
  text-align: center;
}

.vrs-challenge-card .vrs-completed-badge {
  margin: 12px 16px 16px;
  font-weight: 700;
  color: #388e3c;
}
/* — My Challenges: enforce same font and two columns on desktop — */

/* 1. Match the All Routes system font */
.vrs-challenges-container,
.vrs-challenge-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* 2. Single column on mobile, two columns on tablets/desktops */
.vrs-challenges-container {
  display: grid;
  grid-template-columns: 1fr;  /* fallback single column */
  gap: 20px;
  padding: 20px 0;
}

@media (min-width: 768px) {
  .vrs-challenges-container {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

/* 3. (Optional) Three columns on very wide screens */
@media (min-width: 1200px) {
  .vrs-challenges-container {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
  }
}
/* — My Challenges: enforce grid & gap — */
.vrs-challenges-container {
  display: grid !important;
  /* fill as many 300px-wide cards as will fit on one row */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  grid-gap: 24px !important;
  margin: 20px !important;  /* add some breathing room around the whole grid */
  padding: 0 !important;
  box-sizing: border-box;
}

/* Ensure each card doesn’t collapse or stretch oddly */
.vrs-challenge-card {
  margin: 0 !important;     /* margin handled by grid-gap */
  width: 100% !important;
  box-sizing: border-box;
}
/* — My Challenges: single column + larger gaps — */

.vrs-challenges-container {
  display: grid !important;
  grid-template-columns: 1fr !important;    /* always one column */
  grid-row-gap: 40px !important;            /* space between rows */
  grid-column-gap: 0 !important;             /* no horizontal gap needed */
  margin: 30px !important;                  /* breathing room around container */
  padding: 0 !important;
  box-sizing: border-box;
}

.vrs-challenge-card {
  width: 100% !important;
  margin: 0 !important;                     /* margins handled by row-gap */
}
/* — My Challenges: Single-col centered + big gaps — */

.vrs-challenges-container {
  /* center container and limit its width */
  max-width: 800px;
  margin: 30px auto !important;
  padding: 0 20px !important;
  
  /* force grid + one column */
  display: grid !important;
  grid-template-columns: 1fr !important;
  
  /* uniform 40px gap between cards */
  gap: 40px !important;
  box-sizing: border-box;
}

.vrs-challenge-card {
  /* make sure cards don’t stretch beyond their container */
  width: 100% !important;
  margin: 0 !important;
}
/* — My Challenges: force single-col, center, and big vertical gaps — */

.vrs-challenges-container {
  max-width: 800px !important;          /* limit width */
  margin: 30px auto !important;         /* center + top/bottom space */
  padding: 0 20px !important;           /* side padding */
  box-sizing: border-box;
  display: block !important;            /* ensure block flow */
}

.vrs-challenges-container .vrs-challenge-card {
  margin-bottom: 40px !important;       /* 40px gap between cards */
  width: 100% !important;               /* full width of container */
  box-sizing: border-box;
}

.vrs-challenges-container .vrs-challenge-card:last-child {
  margin-bottom: 0 !important;          /* no extra gap after last card */
}
/* — “Buy to Join” button style — */
.vrs-buy-btn {
  display: inline-block;
  margin: auto 16px 16px;
  padding: 10px 0;
  width: calc(100% - 32px);
  font-size: 1rem;
  text-align: center;
  background: #f59e0b;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  transition: background .2s ease;
}
.vrs-buy-btn:hover {
  background: #d97706;
}

/* Tweak free‐join button to match width */
.vrs-join-btn {
  width: calc(100% - 32px);
}
.vrs-popup-modal.fullscreen {
  top: 0; left: 0; transform: none;
  width: 100vw; height: 100vh;
  padding: 0;
}
.vrs-popup-modal.fullscreen header {
  display:flex; justify-content:space-between; align-items:center;
  background: #fff; padding: 1rem; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.vrs-popup-modal.fullscreen #vrs-waypoint-content {
  background: #fff; height: calc(100vh - 60px); /* adjust for header */
}
.vrs-popup-modal.fullscreen {
  animation: popupFadeIn 0.3s ease-out;
}
@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.vrs-join-btn.expired {
  background: #9ca3af;
  cursor: default;
  color: #fff;
}
/* Container for the three stats */
#vrs-stats-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
}
.vrs-stat-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1rem 1.2rem;
  text-align: center;
  flex: 1;
  max-width: 120px;
}
.vrs-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: #333;
}
.vrs-stat-label {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: #777;
}

/* Modern curved progress bar */
#vrs-progress-bar-wrapper {
  width: 80%;
  margin: 0 auto 2rem;
}
#vrs-progress-bar-bg {
  background: #eee;
  border-radius: 12px;
  overflow: hidden;
  height: 16px;
}
#vrs-progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #81c784);
  transition: width 0.6s ease-out;
}

/* Action buttons row */
#vrs-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.vrs-action-btn {
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
}
.vrs-action-btn:hover {
  background: #125ea3;
  transform: translateY(-2px);
}
.vrs-action-btn:active {
  transform: translateY(0);
}
@media (max-width: 600px) {
  /* stack stats horizontally without labels */
  #vrs-stats-bar,
  #vrs-distance-percent,
  #vrs-total-time {
    width: 100%;
    text-align: center;
    margin: 6px 0;
  }

  /* make the “＋” button span full width on its own row */
  #vrs-button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  #vrs-manual-add-btn {
    flex: 1 1 100%;
    font-size: 2.5rem;
    line-height: 1.1;
  }
  /* the remaining three buttons share the next line */
  #vrs-button-row .vrs-btn-circle:not(#vrs-manual-add-btn) {
    flex: 1 1 calc(33% - 8px);
  }
}
/* Progress‐button wrapper */
.vrs-progress-button-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
}

/* Outline button that fills from left */
.vrs-progress-btn {
  position: relative;
  flex: 1;
  padding: 12px 0;
  border: 2px solid #4caf50;
  border-radius: 8px;
  background: transparent;
  color: #4caf50;
  font-weight: 700;
  overflow: hidden;
  cursor: pointer;
}
.vrs-progress-btn #vrs-percent-text {
  position: relative;
  z-index: 2;
}
.vrs-progress-btn #vrs-progress-fill-btn {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: #4caf50;
  transition: width 0.5s ease;
  z-index: 1;
}

/* Stats button */
.vrs-stats-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  border: 2px solid #1976d2;
  border-radius: 8px;
  background: #fff;
  color: #1976d2;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Stats popup tweaks */
#vrs-popup-stats .vrs-popup-modal {
  max-width: 280px;
}
#vrs-stats-container {
  text-align: center;
  padding: 1rem;
  background: #fff;
}
.vrs-progress-btn {
  position: relative;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 22px;
  background: #e0e0e0;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
#vrs-progress-fill-btn {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0; /* JS drives this */
  background: #4caf50;
  transition: width .5s ease;
}
.vrs-progress-btn #vrs-percent-text {
  position: relative;
  z-index: 1;
  line-height: 44px;
  font-weight: bold;
  color: #fff;
}
#vrs-stats-pills {
  display: flex;
  justify-content: center;
  gap: 1rem;
}
#vrs-stats-pills span {
  padding: 0.25rem 0.5rem;
  border: 1px solid #4caf50;
  border-radius: 12px;
  font-size: 0.9rem;
}
.vrs-stats-btn {
  display: block;
  width: 100%;
  margin: 0.5rem auto;
  padding: 0.5rem;
  background: #fff;
  border: 2px solid #4caf50;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
/* === Bottom panel: Add + View Stats on one row === */
#vrs-bottom-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
}

/* === Hide any old pills === */
#vrs-stats-pills {
  display: none !important;
}

/* === “Add” button styling === */
.vrs-progress-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 48px;
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
}
.vrs-progress-btn::before {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
}
#vrs-percent-text {
  font-weight: 700;
}

/* === “View Stats” button inline === */
#vrs-stats-btn {
  margin-left: 0.5rem;
  padding: 0 1rem;
  height: 48px;
  background: #fff;
  color: #4caf50;
  border: 2px solid #4caf50;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

/* === Square off all circle icons === */
.vrs-btn-circle {
  width: 48px !important;
  height: 48px !important;
  border-radius: 8px !important;
}
/* === Bottom panel: 75/25 split & wrapping for other buttons === */
#vrs-bottom-panel {
  display: flex;
  flex-wrap: wrap;      /* allow second row */
  align-items: center;
  gap: 0.5rem;
}

/* Add = 75%, Stats = 25% */
.vrs-progress-btn {
  flex: 3 1 0;          /* grow/shrink, base 0 */
}
#vrs-stats-btn {
  flex: 1 1 0;
}

/* Make sure both buttons respect their heights */
.vrs-progress-btn,
#vrs-stats-btn {
  min-width: 0;         /* prevent overflow */
}

/* === Circle-icon row underneath (if you still have vrs-btn-circle) === */
#vrs-button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Square off circle icons but let them shrink on mobile */
.vrs-btn-circle {
  flex: 0 1 48px;       /* fixed basis but shrink if needed */
  width: 48px !important;
  height: 48px !important;
  border-radius: 8px !important;
}
/* ————————————————————————————————————————————— */
/* KEEP “Add” + “View Stats” TOGETHER IN ONE ROW */
/* ————————————————————————————————————————————— */

#vrs-bottom-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* wrapper around the two big buttons */
.vrs-progress-button-wrapper {
  display: flex;
  flex-wrap: nowrap;      /* keep them side by side */
  width: 100%;
  gap: 0.5rem;
}

/* “Add” = 75% of width, “View Stats” = 25% */
.vrs-progress-btn {
  flex: 3 1 0;
}
#vrs-stats-btn {
  flex: 1 1 0;
}

/* force no minimum size so they shrink properly */
.vrs-progress-btn,
#vrs-stats-btn {
  min-width: 0;
}

/* ————————————————————————————————————————————— */
/* OTHER ICON BUTTONS ON THE LINE BELOW */
/* ————————————————————————————————————————————— */

#vrs-button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* square‐off circle icons but allow them to shrink */
.vrs-btn-circle {
  flex: 0 1 48px;
  width: 48px !important;
  height: 48px !important;
  border-radius: 8px !important;
}

/* ————————————————————————————————————————————— */
/* BLACK “+” AND PERCENT TEXT INSIDE THE PROGRESS BUTTON */
/* ————————————————————————————————————————————— */

.vrs-progress-btn {
  background: #4caf50;   /* your green fill */
  color: #000;           /* default text color black */
}

.vrs-progress-btn::before,
.vrs-progress-btn #vrs-percent-text {
  color: #000 !important;
}
/* ————————————————————————— Mobile layout ————————————————————————— */
@media (max-width: 600px) {

  /* bottom panel stacks */
  #vrs-bottom-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  /* wrap add+stats in one row */
  .vrs-progress-button-wrapper {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  /* 75% Add, 25% View Stats */
  .vrs-progress-btn { flex: 3 1 0; min-width: 0; }
  #vrs-stats-btn    { flex: 1 1 0; min-width: 0; }

  /* circle icons on next line */
  #vrs-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
  }
}

/* ————————————————————————— Desktop reset ————————————————————————— */
/* revert bottom-panel to your original desktop layout */
@media (min-width: 601px) {
  #vrs-bottom-panel    { display: block; padding: 1rem; }
  .vrs-progress-btn    { width: auto; display: inline-flex; }
  #vrs-stats-btn       { margin-left: 1rem; display: inline-block; }
  #vrs-button-row      { display: flex; gap: 0.5rem; margin-top: 1rem; }
}
/* === Progress/Add button: text on top of fill === */
.vrs-progress-btn {
  position: relative;
  overflow: hidden;
  background: #e0e0e0;
  border: 2px solid #4caf50;
  color: #000;               /* make the “+” and text black */
}
.vrs-progress-btn #vrs-progress-fill-btn {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;                  /* updated by JS */
  background: #4caf50;
  z-index: 1;                /* behind the text */
}
.vrs-progress-btn span,
.vrs-progress-btn::before {
  position: relative;
  z-index: 2;                /* above the fill */
  color: #000;               /* black “+” and percentage */
}

/* === Button-row: equal size, single line on mobile === */
#vrs-button-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;         /* never wrap to next line */
  overflow-x: auto;          /* allow sideways scroll if needed */
  padding: 0 0.5rem;
}
.vrs-btn-circle {
  flex: 1 1 0;
  min-width: 48px;           /* force equal minimal size */
  height:    48px;
  border-radius: 4px !important; /* squared corners */
  font-size: 1.4rem !important;
}

/* ensure on mobile they stay one line */
@media (max-width: 600px) {
  #vrs-button-row {
    justify-content: space-between;
  }
}
/* ── Fix percentage text disappearing ── */
.vrs-progress-btn {
  position: relative;
  background: transparent;     /* keep your transparent background */
  overflow: hidden;
}
.vrs-progress-btn #vrs-progress-fill-btn {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;                  /* driven by JS */
  background: #4caf50;
  z-index: 1;                 /* behind text */
}
.vrs-progress-btn span,
.vrs-progress-btn::before {
  position: relative;
  z-index: 2;                 /* above the fill */
  color: #000;                /* black “+” and percentage */
}

/* ── Add vs Stats width ratio ── */
.vrs-progress-button-wrapper {
  display: flex;
  gap: 8px;
}
.vrs-progress-btn {
  flex: 2 1 0;                /* ~66% of the row */
  min-width: 0;               /* allow shrinking */
}
.vrs-stats-btn {
  flex: 1 1 0;                /* ~33% of the row */
  min-width: 0;
}

/* ── Ensure on mobile they remain same line ── */
@media (max-width: 600px) {
  #vrs-bottom-panel {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }
  .vrs-progress-button-wrapper {
    width: 100%;
  }
}

/* ── Lock circle buttons into one row ── */
#vrs-button-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0 0.5rem;
}
.vrs-btn-circle {
  flex: 1 1 0;
  min-width: 48px;
  height: 48px;
  font-size: 1.4rem !important;
  border-radius: 4px !important;
}
/* ── Progress/Add vs Stats flex tuning ── */
.vrs-progress-button-wrapper {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.vrs-progress-btn {
  flex: 2 2 0;              /* ~66% of row */
  min-width: 0;             /* allow it to shrink */
  position: relative;
  overflow: hidden;
}

.vrs-stats-btn {
  flex: 1 1 0;              /* ~33% of row */
  min-width: 0;
}

/* ── Make “+” and percentage larger and always on top ── */
.vrs-progress-btn::before {
  content: "+"; 
  font-size: 2.2rem;        /* bigger “+” */
  line-height: 1;
  margin-right: 0.5rem;
  position: relative; z-index: 2;
  color: #000;
}

.vrs-progress-btn span#vrs-percent-text {
  font-size: 1.4rem;        /* bigger percentage */
  font-weight: 300;
  position: relative; z-index: 2;
  color: #000;
}

/* ── The green fill stays behind text ── */
.vrs-progress-btn #vrs-progress-fill-btn {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;                /* JS drives this */
  background: #4caf50;
  z-index: 1;
}

/* ── Circle-button row must never wrap ── */
#vrs-button-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;        /* prevent wrapping */
  overflow-x: auto;
  padding: 0 0.5rem;
}

/* ── Mobile override: tighten flex ratio so Stats stays visible ── */
@media (max-width: 600px) {
  .vrs-progress-btn {
    flex: 2 1 0;
  }
  .vrs-stats-btn {
    flex: 1 1 0;
  }
}
/* ─── Mobile: collapse “View All Stats” into a hamburger icon ─── */
@media (max-width: 600px) {
  #vrs-stats-btn {
    position: relative;
    padding: 0;              /* remove extra padding */
    width: 44px;             /* square like the others */
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* hide the text */
  #vrs-stats-btn::before,
  #vrs-stats-btn span {
    display: none;
  }
  /* insert hamburger icon */
  #vrs-stats-btn::after {
    content: "\2630";        /* Unicode hamburger */
    font-size: 1.4rem;
    color: #1976d2;
  }

  /* ─── Force all circle icons onto one line ─── */
  #vrs-button-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
  }
  .vrs-btn-circle {
    flex: 1 1 auto;          /* allow them to shrink equally */
    min-width: 0;
  }
}
/* ─── Bottom-panel tweaks ─── */
#vrs-bottom-panel .vrs-progress-button-wrapper {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

/* Add button = 75% */
#vrs-manual-add-btn {
  flex: 3;
  background: #90ee90;      /* green fill */
  color: #000;              /* black “+” and percentage */
  border: none;
  position: relative;
}
/* hide the legacy fill-bar element */
#vrs-manual-add-btn #vrs-progress-fill-btn {
  display: none !important;
}
/* ensure + & % are above everything */
#vrs-manual-add-btn #vrs-percent-text {
  position: relative;
  z-index: 2;
  font-size: 1.2rem;
  font-weight: medium;
}

/* Stats button = 25% */
#vrs-stats-btn {
  flex: 1;
  background: transparent;
  color: #4caf50;
  border: 2px solid #4caf50;
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

/* ─── Keep circle icons on one row ─── */
#vrs-button-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  padding-top: 1rem;
}
.vrs-btn-circle {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 4px !important;
  width: auto !important;
  height: auto !important;
}
/* ─── Bring bottom row up closer ─── */
#vrs-button-row {
  margin-top: 0.5rem !important;  /* shrink space above */
  gap: 0.5rem !important;         /* tighten gaps between buttons */
}

/* ─── Spread the 4 icons evenly full-width on mobile ─── */
@media (max-width: 600px) {
  #vrs-button-row {
    justify-content: space-between !important;
  }
  #vrs-button-row .vrs-btn-circle {
    flex: 1 1 0;       /* each button takes equal share */
    max-width: 25%;    /* no more than a quarter each */
    box-sizing: border-box;
  }
}
/* ─── Tighter bottom‐panel padding ─── */
#vrs-bottom-panel {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* ─── Pull the button row right up ─── */
#vrs-button-row {
  margin-top: 0.25rem !important;
  gap: 0.25rem !important;
}

/* ─── Equal‐width 4‐up on mobile ─── */
@media (max-width: 600px) {
  #vrs-button-row {
    justify-content: space-between !important;
  }
  #vrs-button-row .vrs-btn-circle {
    flex: 1 1 0 !important;
    max-width: 25% !important;
    margin: 0 !important;
  }
}
/* Waypoint-specific popup modal */
.vrs-waypoint-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 1.5rem;
  z-index: 1000;
}

/* Show only this modal when visible */
.vrs-waypoint-modal.visible {
  display: block;
}

/* Optional: content inside modal */
.vrs-waypoint-modal header h3 {
  margin-top: 0;
  font-size: 1.5rem;
}

.vrs-waypoint-modal .vrs-popup-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  float: right;
  cursor: pointer;
}
.vrs-waypoint-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 1.5rem;
  z-index: 1000;
}

.vrs-waypoint-modal.visible {
  display: block;
}
.vrs-quiz-block {
  margin-top: 1rem;
  background: #f9f9f9;
  border-radius: 6px;
  padding: 1rem;
}

.vrs-quiz-question {
  margin-bottom: 1rem;
}

.vrs-quiz-question ul {
  list-style: disc;
  margin-left: 1.5rem;
}
.vrs-embed-video {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  margin-bottom: 1rem;
  border-radius: 8px;
}

.vrs-embed-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
/* Fullscreen map */
#vrs-map-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}
#vrs-map {
  width: 100%;
  height: 100%;
}
.vrs-ui-overlay {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  height: 100vh;
  pointer-events: none; /* UI elements still clickable if they set pointer-events */
}

.vrs-stats-bar {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.95);
  pointer-events: auto;
}
.vrs-bottom-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #ddd;
  padding: 0.75rem 0;
  z-index: 20;
  pointer-events: auto;
}
.vrs-popup-modal {
  max-width: 90%;
  width: 500px;
  margin: 5vh auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  padding: 1rem;
  overflow: auto;
  z-index: 9999;
}

@media (max-width: 600px) {
  .vrs-popup-modal {
    width: 95%;
    margin: 2vh auto;
  }
}
/* Fullscreen map layout */
#vrs-map-container {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

#vrs-map {
  width: 100%;
  height: 100%;
}

/* Overlay elements */
.vrs-ui-overlay {
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.vrs-ui-overlay * {
  pointer-events: auto;
}

/* Sticky button row at bottom */
.vrs-bottom-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.75rem;
  border-top: 1px solid #ddd;
}
.vrs-bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid #ccc;
  z-index: 999;
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 1rem;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

/* Optional: buttons inside */
.vrs-bottom-panel button,
.vrs-bottom-panel .vrs-btn {
  flex: 1;
  margin: 0 0.25rem;
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background: #4caf50;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

/* Prevent content hiding behind panel */
body {
  padding-bottom: 80px;
}
/* Circle Buttons Row Styling */
#vrs-button-row {
  display: flex;
  justify-content: space-around;
  gap: 0.3rem;
  padding: 1rem;
  background: #fafafa;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

/* Circle Buttons */
.vrs-btn-circle {
  background: #ffffff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 0.5rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.vrs-btn-circle:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.vrs-btn-circle img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
@media (max-width: 480px) {
  #vrs-button-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }

  .vrs-btn-circle {
    width: 60px;
    height: 60px;
  }

  .vrs-btn-circle img {
    width: 40px;
    height: 40px;
  }
}
/* Ensure map is full screen behind UI */
#vrs-map {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* Bottom panel sticks and floats above map */
#vrs-bottom-panel {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  backdrop-filter: blur(10px);
}

/* Progress bar styling */
.vrs-progress-bar-wrapper {
  width: 100%;
}
.vrs-progress-btn {
  width: 100%;
  height: 24px;
  border: none;
  background: #e0e0e0;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}
#vrs-progress-fill-btn {
  height: 100%;
  background: #4caf50;
  width: 0%;
  transition: width 0.4s ease;
  position: absolute;
  left: 0;
  top: 0;
}
#vrs-percent-text {
  position: relative;
  z-index: 1;
  font-weight: bold;
  color: #222;
  padding-left: 0.75rem;
  font-size: 0.85rem;
}

/* Button row layout */
#vrs-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}
.vrs-button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
}
.vrs-btn-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vrs-btn-circle img {
  width: 30px;
  height: 30px;
}

.vrs-stats-btn {
  padding: 0.5rem 0.75rem;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
/* BUTTON ROW LAYOUT */
#vrs-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

/* Group of circle buttons */
.vrs-button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  flex: 1 1 60%;
}

/* Stats button */
.vrs-stats-btn {
  flex: 0 0 25%;
  padding: 0.65rem 0.75rem;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
}

/* Circle buttons */
.vrs-btn-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vrs-btn-circle img {
  width: 50px;
  height: 50px;
}

/* RESPONSIVE TWEAKS */
@media (min-width: 768px) {
  .vrs-stats-btn {
    flex: 0 0 auto;
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }

  .vrs-btn-circle {
    width: 50px;
    height: 50px;
  }

  .vrs-btn-circle img {
    width: 40px;
    height: 40px;
  }
}
/* Confirmation modal styling */
#vrs-popup-manual-confirm .vrs-manual-confirm-content {
  background: #fafafa;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
#vrs-popup-manual-confirm p {
  margin: 0.5rem 0;
}
#vrs-popup-manual-confirm .vrs-form-group button {
  margin-left: 0.5rem;
}
/* Toast container */
.vrs-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  opacity: 0;
  z-index: 9999;
  font-weight: 600;
  transition: opacity .2s ease-in-out;
}
/* Success (green) */
.vrs-toast.success {
  background: #4caf50;
}
/* Error (red) */
.vrs-toast.error {
  background: #e53e3e;
  color:      #fff;     /* force white text */
}
.vrs-dates-boxes {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.vrs-date-box {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  background: #eef7ff;
  color: #0366d6;
}
.vrs-date-start {
  border: 1px solid #70bfff;
}
.vrs-date-end {
  border: 1px solid #ff7070;
}
