/* Components shared by the app shell (index.html) and the static per-park
   pages (/park/*.html): the sign-in button and user menu, star ratings, the
   weather strip, and the modal + comment thread. Both stylesheets are built
   on the same custom properties, so these rules work under either.

   Loaded BEFORE the page's own stylesheet, so page-specific rules win. */

.auth-btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.auth-btn:hover {
  border-color: var(--accent);
  background: var(--panel);
  transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }

.user-menu {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 1200;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-menu-name {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-item {
  background: none;
  border: none;
  text-align: left;
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--panel-2); }

/* Star ratings */
.rating { display: flex; align-items: center; gap: 3px; margin: 6px 0 2px; }
.rating-star {
  color: var(--border);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.1s ease, transform 0.1s ease;
}
.rating-star.on { color: #fbbf24; }
.rating-star:hover { transform: scale(1.15); }
.rating-star.mine.on { color: var(--accent-2); }
.rating-meta { margin-left: 6px; font-size: 12px; color: var(--text-dim); }

/* Weather strip (3-day forecast in popups) */
.weather {
  display: flex;
  gap: 6px;
  margin: 8px 0 4px;
}
.weather:empty { display: none; }
.wx-loading { color: var(--text-dim); font-size: 12px; }
.wx-day {
  flex: 1;
  text-align: center;
  padding: 6px 2px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.wx-dow { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.3px; }
.wx-ico { font-size: 18px; line-height: 1.4; }
.wx-temp { font-size: 12px; font-weight: 600; }
.wx-min { color: var(--text-dim); font-weight: 400; }
.wx-pp { font-size: 10.5px; color: #60a5fa; }

/* Rider condition reports */
.cond {
  margin: 8px 0 4px;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  font-size: 12.5px;
}
.cond-good   { border-left-color: #22c55e; }
.cond-wet    { border-left-color: #60a5fa; }
.cond-muddy  { border-left-color: #a16207; }
.cond-dusty  { border-left-color: #eab308; }
.cond-closed { border-left-color: #ef4444; }
.cond-note { margin-top: 3px; color: var(--text-dim); line-height: 1.45; }
.cond-badge { color: var(--text-dim) !important; }

.cond-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cond-btn:hover { text-decoration: underline; }

.cond-picker { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.cond-opt {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
}
.cond-opt:hover { border-color: var(--accent); }
.cond-opt.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Modal + comments */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}
.modal-overlay[hidden] { display: none; }

.modal {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 22px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-title { margin: 0 26px 4px 0; font-size: 19px; font-family: var(--font-display); }
.cmt-heading { margin: 14px 0 10px; font-size: 14px; color: var(--text-dim); font-weight: 600; }

.cmt-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cmt-empty { color: var(--text-dim); font-size: 14px; padding: 6px 0; }

.cmt {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
}
.cmt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.cmt-author { font-weight: 600; font-size: 13px; }
.cmt-date { color: var(--text-dim); font-size: 11.5px; }
.cmt-del { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 13px; opacity: 0.6; }
.cmt-del:hover { opacity: 1; }
.cmt-body { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

.cmt-form { display: flex; flex-direction: column; gap: 10px; }
.cmt-textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.cmt-textarea:focus { border-color: var(--accent-dim); }

.btn-primary {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hi) 100%);
  color: var(--on-accent);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(249, 115, 22, 0.3);
  transition: transform 0.1s ease, box-shadow 0.12s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(249, 115, 22, 0.4); }
.btn-primary:active { transform: translateY(0); }

.cmt-status { font-size: 13px; color: var(--text-dim); margin-top: 8px; }

.cmt-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cmt-btn:hover { text-decoration: underline; }

.modal-lg { max-width: 620px; }

/* Buttons */
.btn-ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--panel); }
.cmt-form-actions { display: flex; gap: 8px; align-items: center; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12.5px; color: var(--text-dim); }
