/*
  JAM Detailing UI stylesheet
  ---------------------------
  Design goals:
  - Clean, uncluttered interface
  - Strong readability on desktop and mobile
  - Clear status colors for admin order lifecycle
*/

/* Global theme tokens (colors + semantic status palette). */
:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1e2430;
  --muted: #5f6b80;
  --brand: #22407a;
  --brand-2: #2f63bf;
  --border: #d8deea;

  --s-new: #e7e7ea;
  --s-assigned: #1e90ff;
  --s-started: #7b4ddb;
  --s-complete: #2e9f55;
  --s-cancelled: #d14f4f;
  --s-closed: #64748b;
}

/* Base reset + typography defaults. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Main content wrapper and consistent page margins. */
.container {
  width: min(1920px, 92vw);
  margin: 2rem auto;
}

/* Hero layout for centered homepage content. */
.hero {
  display: grid;
  place-items: center;
  min-height: 72vh;
}

/* Card/panel primitive used for homepage, booking, and admin sections. */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(26, 40, 66, 0.06);
}

/* Typographic rhythm helpers. */
.hero-panel { text-align: center; max-width: 560px; }
h1, h2, h3 { margin: 0 0 0.75rem; }
p { margin: 0.25rem 0 1rem; }

/* Flex headers for page title/action areas. */
.page-head,
.orders-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.orders-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  background: #eef2fb;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
}

.orders-toggle input {
  width: auto;
  accent-color: var(--brand-2);
}

/* Generic 2-column form grid with optional compact variant. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Form label + field presentation. */
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.93rem;
  color: var(--muted);
}

/* Input typography inheritance and field chrome. */
input, select, textarea, button {
  font: inherit;
}

input, select {
  width: 100%;
  padding: 0.62rem 0.68rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

/* Utility: span full grid width. */
.full-width { grid-column: 1 / -1; }

/* Button primitives and variants. */
.btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  cursor: pointer;
  font-size: 24pt;
  font-weight: 600;
  background-color: orange;
}

/* Primary call-to-action style. */
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
}

/* Secondary/ghost button style. */
.btn-ghost {
  background: #eef2fb;
  color: var(--brand);
}

/* Subtle helper/caption text. */
.help-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.subheading { margin-bottom: 0.55rem; }

/* Booking option card grid + card interactions. */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.option-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

/* Clickable option header with title/meta and chevron column. */
.option-header {
  width: 100%;
  text-align: left;
  padding: 0.78rem;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  cursor: pointer;
}

/* Option text styling. */
.option-title { font-weight: 700; color: var(--text); }
.option-meta { color: var(--muted); font-size: 0.92rem; }
.chevron { color: var(--brand); font-size: 1.05rem; align-self: center; }

/* Expandable full-description body (hidden until expanded class is applied). */
.option-details {
  border-top: 1px solid var(--border);
  padding: 0.72rem;
  color: #314054;
  display: none;
}

/* Option state modifiers: expanded + selected. */
.option-card.expanded .option-details { display: block; }
.option-card.selected { border-color: var(--brand-2); box-shadow: 0 0 0 2px #d6e3ff inset; }

/* Admin order board grid. */
.orders-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0.8rem;
}

/* Order ticket/card base visual style. */
.order-card {
  border-radius: 12px;
  padding: 0.8rem;
  color: #fff;
  display: grid;
  gap: 0.5rem;
}

/* Status-based card color coding.
   NEW = unassigned light grey
   ASSIGNED = dodger blue
   STARTED = purple
   COMPLETE = green
  CANCELLED = red
  CLOSED = slate */
.order-card.NEW { background: var(--s-new); color: #1f2937; }
.order-card.ASSIGNED { background: var(--s-assigned); }
.order-card.STARTED { background: var(--s-started); }
.order-card.COMPLETE { background: var(--s-complete); }
.order-card.CANCELLED { background: var(--s-cancelled); }
.order-card.CLOSED { background: var(--s-closed); }

/* Top row in order cards: title and status badge. */
.order-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

/* Pill-style status badge. */
.badge {
  background: rgba(255,255,255,0.23);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 700;
}

/* Order action controls grid: assign/select + state transition buttons. */
.order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.order-actions select {
  grid-column: 1 / -1;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem;
}

.order-actions button {
  border: 0;
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 0.85rem;
}

.order-actions .close-btn {
  grid-column: 1 / -1;
}

/* Action button appearance in colored order cards. */
.order-actions button {
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  color: inherit;
}

.order-actions button:disabled {
  cursor: default;
  opacity: 0.65;
}

/* Thumbnail strip for attached vehicle images. */
.thumb-list {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.thumb-list img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.5);
  background: #fff;
}

/* Completion indicator shown at bottom of completed cards. */
.tick {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: right;
}

/* Utility class for toggled visibility. */
.hidden { display: none !important; }

/* Mobile breakpoint: collapse forms to one column and tighten margins. */
@media (max-width: 760px) {
  .form-grid,
  .form-grid.compact {
    grid-template-columns: 1fr;
  }

  .container {
    width: min(720px, 94vw);
    margin: 1rem auto;
  }
}
