/**
 * GoFlora Transport — Shared Component Primitives
 * Inline-friendly classes (used by copy-inline, never parameterized #import).
 * Depends on tokens from design-system.css. Mobile-first, 48px touch targets.
 */

/* ============================================
   48px TOUCH CONTROLS
   ============================================ */
.gf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch-target);
  padding: 0 1.25rem;
  border-radius: var(--radius-lg);
  font: 600 0.95rem/1 var(--font-family-base);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.gf-btn:active { transform: translateY(1px); }
.gf-btn--primary { background: var(--color-primary-600); color: #fff; }
.gf-btn--primary:hover { background: var(--color-primary-700); }
.gf-btn--accept { background: var(--color-primary-600); color: #fff; box-shadow: var(--shadow-md); }
.gf-btn--accept:hover { background: var(--color-primary-700); }
.gf-btn--ghost { background: transparent; color: var(--color-text-secondary); border-color: var(--color-border); }
.gf-btn--ghost:hover { background: var(--color-slate-50); }
/* Tonal: a secondary action that is still affirmative (Reactivate, Update), where an outline button
   reads as too neutral and a filled one competes with the page's primary action. Added for GF-29 —
   the partner portal had hand-rolled it as `bg-emerald-100 text-emerald-700` in three places. */
.gf-btn--soft { background: var(--color-primary-50); color: var(--color-primary-700); }
.gf-btn--soft:hover { background: var(--color-primary-100); }
.gf-btn--danger { background: var(--color-error); color: #fff; }
.gf-btn[disabled], .gf-btn--disabled { opacity: 0.5; pointer-events: none; }
.gf-btn--full { width: 100%; }
/* Icon-only tap target */
.gf-tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  min-width: var(--touch-target);
}

/* ============================================
   CARD
   ============================================ */
.gf-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.gf-card--interactive {
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: pointer;
}
.gf-card--interactive:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ============================================
   ROUTE DISPLAY (origin -> destination)
   ============================================ */
.gf-route {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  align-items: start;
}
.gf-route__dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-top: 0.35rem;
}
.gf-route__dot--origin { background: var(--color-primary-500); }
.gf-route__dot--dest { background: var(--color-bid-500); }
.gf-route__line {
  grid-column: 1;
  justify-self: center;
  width: 2px;
  height: 100%;
  min-height: 1.25rem;
  background: var(--color-border);
  border-radius: 2px;
}
.gf-route__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
}
.gf-route__value {
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ============================================
   DUAL CURRENCY
   ============================================ */
.gf-price {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.gf-price__primary { font-weight: 800; color: var(--color-text-primary); }
.gf-price__secondary { font-size: 0.8em; color: var(--color-text-tertiary); }
.gf-price__secondary:empty { display: none; }

/* ============================================
   RIDE-STATE BANNER
   ============================================ */
.gf-state {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.gf-state__icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
}
.gf-state__body { min-width: 0; }
.gf-state__title { font-weight: 700; color: var(--color-text-primary); }
.gf-state__sub { font-size: 0.85rem; color: var(--color-text-secondary); }
.gf-state--searching { background: var(--color-bid-50); border-color: var(--color-bid-100); }
.gf-state--searching .gf-state__icon { background: var(--color-bid-100); color: var(--color-bid-700); }
.gf-state--accepted { background: var(--color-primary-50); border-color: var(--color-primary-100); }
.gf-state--accepted .gf-state__icon { background: var(--color-primary-100); color: var(--color-primary-700); }
.gf-state--enroute { background: #e0f2fe; border-color: #bae6fd; }
.gf-state--enroute .gf-state__icon { background: #bae6fd; color: #075985; }
@keyframes gf-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.gf-state--searching .gf-state__icon i { animation: gf-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .gf-state--searching .gf-state__icon i { animation: none; }
}

/* ============================================
   BID / OFFER CARD
   ============================================ */
.gf-bid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.gf-bid__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-slate-100);
  display: grid;
  place-items: center;
  color: var(--color-slate-400);
}
.gf-bid__name { font-weight: 700; color: var(--color-text-primary); }
.gf-bid__meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  align-items: center;
}
.gf-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.gf-badge--cash { background: var(--color-primary-50); color: var(--color-primary-700); }
.gf-badge--nocash { background: var(--color-slate-100); color: var(--color-slate-600); }
.gf-bid__price { grid-column: 3; text-align: right; }
.gf-bid__cta { grid-column: 1 / -1; }
@media (min-width: 640px) {
  .gf-bid__cta { grid-column: 3; width: auto; }
}

/* ============================================
   TRACKING CARD
   ============================================ */
.gf-track__plate {
  display: inline-block;
  font-family: var(--font-family-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.6rem;
  border: 2px solid var(--color-slate-800);
  border-radius: 0.4rem;
  background: #fff;
  color: var(--color-slate-900);
}
.gf-eta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Reserved slot for the upcoming floating chat/voice widget */
.gf-comms-slot {
  position: sticky;
  bottom: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}
.gf-comms-slot .gf-btn {
  pointer-events: auto;
  border-radius: 9999px;
  box-shadow: var(--shadow-lg);
}

/* Partner sign-in controls use explicit colors so typed text remains visible when the shell is dark. */
.gf-partner-auth__input {
  color: #0f172a;
  background-color: #ffffff;
  caret-color: var(--color-primary-600, #059669);
}

.gf-partner-auth__input::placeholder {
  color: #64748b;
  opacity: 1;
}

[data-theme="dark"] .gf-partner-auth {
  color: #f8fafc;
}

[data-theme="dark"] .gf-partner-auth__form {
  background-color: #18181b;
  border-color: #3f3f46;
}

[data-theme="dark"] .gf-partner-auth__input {
  color: #f8fafc;
  background-color: #27272a;
  border-color: #52525b;
  caret-color: #6ee7b7;
}

[data-theme="dark"] .gf-partner-auth__input::placeholder {
  color: #a1a1aa;
}

/* ============================================
   SIDE NAV  (partner portal, desktop only)
   ============================================
   Added for GF-31. The partner portal was a single column at every breakpoint: on a 1440px screen its
   five nav items sat in a horizontal strip above a 1152px column of content, with the rest of the
   viewport empty. A persistent rail is the conventional shape for a back-office tool and gives the
   content the full height back.

   The rail itself is laid out with Tailwind utilities in partner-base.leaf under `lg:`; these classes
   are only the parts that need tokens and state, which utilities express badly. */
.gf-side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gf-side-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--touch-target);
  padding: 0 0.85rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.gf-side-nav__link:hover {
  background: var(--color-slate-50);
  color: var(--color-text-primary);
}

/* Set by partner-nav.js from location.pathname. Without JS the rail still works, it just has no
   current-page indicator — which is why the indicator is not the only affordance. */
.gf-side-nav__link.is-active {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

.gf-side-nav__link.is-active .gf-side-nav__icon {
  color: var(--color-primary-600);
}

.gf-side-nav__icon {
  flex: none;
  width: 1.25rem;
  text-align: center;
  color: var(--color-slate-400);
}

.gf-side-nav__label { min-width: 0; }

/* ============================================
   MARKETPLACE REQUEST ROW (partner)
   ============================================ */
.gf-req {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.gf-req__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* ============================================
   PAGINATION (GF-58)
   ============================================
   `.pagination__btn` was referenced by my-trips-v2 and Components/Transport/pagination.leaf
   but defined in no shared stylesheet — only an inline block on one page. */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding-left: 0;
  list-style: none;
}

.pagination__btn {
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.pagination__btn:hover:not(:disabled) {
  background: var(--color-primary-600);
  border-color: var(--color-primary-600);
  color: #fff;
}

.pagination__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Caret for the account dropdown in gofloratransportbase — was Bootstrap's
   `.dropdown-toggle::after`. The JS still keys off the class name. */
.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.255em;
  vertical-align: 0.255em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}
