/* ================================================================
   TRUCKAID MASTER STYLES v1.1 (MERGED / IMPROVED)
   Mobile-first, optimized for ~5.5" screens
   - Adds reusable Page Header system (brand + page title + subtitle)
   - Improves base reset + typography
   - Improves sticky nav w/ safe-area support
   - Reduces need for !important in nav row
================================================================ */

/* =============================
   0. DESIGN TOKENS
============================= */
:root {
  /* COLORS (Option C: Blue + Gold) */
  --gold: #ffb84d;
  --accent: #4aa3ff;        /* NEW: blue accent */
  --watch-red: #ff5c6c;     /* Softer red for saved/watch states (optional) */

  --bg: #0c111a;            /* Softer than pure black */
  --card: #141c28;          /* Used in a few places (main-card, etc.) */
  --muted: #a0aec0;
  --text: #f3f7ff;

  /* TYPOGRAPHY */
  --body-size: 1.08rem;
  --body-line: 1.66;

  /* SPACING */
  --s-1: .5rem;
  --s-2: .75rem;
  --s-3: 1rem;
  --s-4: 1.5rem;
  --s-5: 2rem;

  /* RADIUS */
  --r-1: 12px;  /* slightly rounder feels more “app” */
  --r-2: 18px;

  /* BORDERS */
  --border: rgba(255,255,255,0.12);
}

/* =============================
   1. CORE RESET / BASE
============================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  font-size: var(--body-size);
  line-height: var(--body-line);
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }

/* Utility helpers */
.text-center { text-align: center; }

/* =============================
   2. LAYOUT WRAPPERS
============================= */
.home-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--s-3);
}

/* =============================
   3. BRANDING & HEADERS
   - Old classes kept for compatibility
   - New "page-header" system added
============================ */

/* Backward compatibility */
.brand,
.title {
  color: var(--gold);
  font-weight: 900;
  text-align: center;
  letter-spacing: 1px;
}
.brand { font-size: 1.6rem; }

/* Reusable Page Header pattern (recommended) */
.page-header {
  text-align: center;
  padding: var(--s-4);
  margin-bottom: var(--s-3);
}
.page-brand {
  margin: 0 0 var(--s-1);
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.95rem;
  opacity: 0.95;
}
.page-title {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: var(--text);
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
}
.page-subtitle {
  margin: var(--s-2) 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Section titles (subheadings) */
.section-title {
  text-align: center;
  font-size: .85rem; /* slightly smaller than before */
  color: var(--muted);
  text-transform: uppercase;
  margin: var(--s-4) 0 var(--s-2);
  letter-spacing: 1px;
}

/* =============================
   (New) LIST META ROW (NO OVERLAP)
   Used for Q&A / Reviews / Lists
============================= */
.post-title{
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 10px 0;
  font-size: 1rem;
  line-height: 1.25;
}

.post-meta{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.badge-inline{
  background: rgba(74,163,255,0.15);
  color: var(--accent);
  border: 1px solid rgba(74,163,255,0.4);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

/* =============================
   4. STICKY NAVIGATION BAR
============================= */
.top-nav {
  position: sticky;
  top: env(safe-area-inset-top, 0);
  z-index: 1000;
  background: var(--bg);
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.button-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
}

/* Individual Buttons in the top row */
.btn-action {
  flex: 1;
  min-width: 0;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-1);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
  padding: 0 8px;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Nav Button Color Variants */
.bg-dark { background: #1a1a1a; color: #fff; border: 1px solid #333; }
.bg-gold { background: var(--gold); color: #000; border: 1px solid rgba(0,0,0,0.2); }
.bg-red  { background: #dc3545; color: #fff; border: none; }

.btn-action:active { transform: scale(0.96); opacity: 0.85; }

/* =============================
   5. STANDARD CARDS
============================= */
.card {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.05),
    rgba(255,255,255,0.015)
  );
  border: 1px solid var(--border);
  padding: var(--s-4);
  border-radius: var(--r-2);
  margin-bottom: var(--s-3);
}

/* =============================
   6. OPTIONAL: BRAND-TITLE CARD
   (If you're using <header class="card brand-title ...">)
============================= */
.brand-title {
  margin: 0 auto var(--s-3);
  text-align: center;
}

/* =============================
   7. OPTIONAL: REDUCE MOTION
============================= */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .btn-action:active { transform: none; }
}

/* =============================
   6. INPUTS & FORMS
============================= */
input, textarea, select {
  width: 100%;
  padding: 1rem;
  margin-bottom: var(--s-3);
  border-radius: 12px;
  border: 1px solid #333;
  background: #000;
  color: #fff;
  font-size: 16px; /* Prevents iOS auto-zoom */
}

/* Spam Check Box */
.security-box {
  background: rgba(255,179,0,0.08);
  padding: var(--s-4);
  border-radius: 14px;
  margin-bottom: var(--s-3);
}

.security-box label {
  color: var(--gold);
  font-weight: 900;
  margin-bottom: .5rem;
  display: block;
}

/* Big Gold Post Button */
.btn-post {
  display: block;
  width: 100%;
  background: var(--gold);
  color: #000;
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  font-weight: 900;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,179,0,0.25);
}

/* ================================================================
   7. FACILITY DETAIL PAGE (View Review / Add Intel)
   Forces +UPDATE, RATING, and SAVE into 3 equal columns
================================================================ */

.main-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: var(--s-4);
  margin-bottom: var(--s-4);
}

.cta-row {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px; /* Standardized gap for driver thumb-tapping */
  width: 100%;
  margin-bottom: var(--s-4);
}

/* THE EQUALIZER: This forces all 3 elements to stay exactly the same width */
.cta-row > .jump-btn, 
.cta-row > .rating-box, 
.cta-row > .watch-btn,
.cta-row > #followBtn {
  flex: 1 !important;   /* Overwrites the old 1.5 logic */
  min-width: 0 !important; 
  height: 58px;          /* Matching height for a professional look */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin: 0;
  padding: 5px;
  text-align: center;
  font-size: 0.75rem;    /* Clear but compact for 5.5" screens */
  font-weight: 900;
  text-transform: uppercase;
}

/* +UPDATE BUTTON (Gold) */
.jump-btn {
  background: var(--gold);
  color: #000;
}

/* RATING BOX (Subtle Gold) */
.rating-box {
  background: rgba(255,179,0,0.1);
  border: 1px solid rgba(255,179,0,0.35);
  color: var(--gold);
}
.rating-box .score { font-size: 1.1rem; line-height: 1; }
.rating-box .label { font-size: 0.6rem; opacity: 0.8; }

/* SAVE / WATCH BUTTON (Red) */
.watch-btn, #followBtn {
  background: rgba(255,59,59,0.12);
  border: 1px solid rgba(255,59,59,0.45);
  color: var(--watch-red);
  cursor: pointer;
}

/* When the stop is SAVED */
.watch-btn.on, #followBtn.on {
  background: var(--watch-red) !important;
  color: #000 !important;
}

/* =============================
   8. REPLIES & USER COMMENTS
============================= */
.reply-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  padding: var(--s-4);
  border-radius: 14px;
  margin-bottom: var(--s-3);
}

.latest-badge {
  background: var(--gold);
  color: #000;
  padding: .3rem .6rem;
  border-radius: 6px;
  font-weight: 900;
  font-size: .85rem;
  display: inline-block;
  margin-bottom: var(--s-2);
}

.comment {
  font-size: var(--body-size);
  line-height: var(--body-line);
}

.meta {
  font-size: .9rem;
  color: rgba(255,255,255,0.55);
}

/* =========================
 Q&A VIEW — CLEAN FLOW MODE
========================= */

.qa-view .qa-title {
  margin: 0 0 var(--s-4) 0;
  color: var(--gold);
  font-weight: 900;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1.25;
}

.qa-view .driver-part,
.qa-view .expert-body {
  font-size: 1.2rem;
  line-height: 1.5;
  font-weight: 700;
  color: var(--text);
}

.qa-view .expert-label {
  display: block;
  margin-bottom: var(--s-2);
  color: var(--gold);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-align: center;
}

.qa-view .post-date {
  margin-top: var(--s-4);
  padding-top: var(--s-2);
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
}

.qa-view .reply-box {
  background: transparent;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: var(--s-3) 0;
}

.qa-view .reply-text {
  font-size: 1.2rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.95);
  font-weight: 500;
}

.qa-view .reply-meta {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.qa-view .form-card h3 {
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .qa-view .driver-part,
  .qa-view .expert-body {
    font-size: 1.1rem;
  }
}

/* =============================
   9. WATCHLIST / MY STOPS
============================= */
.my-stops.card {
  border: 1px solid rgba(255,59,59,0.35);
}

.stop-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem .9rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,59,59,0.35);
  margin-bottom: .6rem;
}

/* =============================
   10. INTERACTIVE STAR SYSTEM
   (Special Fix for dots/labels)
============================= */
.star-rating {
  display: flex !important;
  flex-direction: row-reverse !important;
  justify-content: center;
  gap: 15px;
  background: rgba(255,255,255,0.03);
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.star-rating input {
  display: none !important; /* Hides original radio dots */
}

.star-rating label {
  font-size: 2.5rem;
  color: #333;
  cursor: pointer;
  line-height: 1;
}

/* Highlights stars when hovering or clicked */
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: var(--gold) !important;
}


/* =============================
   (new)INDEX LIST / SEARCH RESULTS (v2)
============================= */
.result-link { display: block; }

.post-title{
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 10px 0;
  font-size: 1rem;
  line-height: 1.25;
}

.post-meta{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.badge-inline{
  background: rgba(74,163,255,0.15);
  color: var(--accent);
  border: 1px solid rgba(74,163,255,0.4);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reply-count{
  color: var(--muted);
}

/* ================================================================
   END OF FILE
================================================================ 
*/