/*
  styles.css
  ==========
  Looks and layout. Designed phone-first: big text, big tap targets, one column.
  A few "CSS variables" up top hold the colors so you can re-theme in one place.
*/

:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #2563eb;       /* buttons */
  --go: #16a34a;           /* green  = GO    */
  --maybe: #f59e0b;        /* amber  = MAYBE */
  --no: #dc2626;           /* red    = NO    */
  --radius: 14px;
}

/* Reset some browser defaults so things line up predictably. */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* Comfortable reading width on big screens, full width on phones. */
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  padding: 12px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.app-header h1 { font-size: 1.4rem; margin: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.card h2 { margin-top: 0; }

/* Labels and inputs stack vertically with comfortable spacing. */
label {
  display: block;
  font-weight: 600;
  margin: 12px 0 4px;
}
input[type="number"],
select {
  width: 100%;
  padding: 12px;
  font-size: 1.05rem;       /* big enough that iOS won't zoom on focus */
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

/* The "goal" group with the two radio choices. */
.goal { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.goal legend { font-weight: 700; padding: 0 6px; }
.radio { font-weight: 500; margin-top: 8px; }
.radio input { width: auto; margin-right: 6px; }

/* A label + value on one row, e.g. "Estimated profit:  $12.34" */
.result-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 10px 0;
  font-size: 1.05rem;
}
.result-line strong { font-size: 1.2rem; }

/* The big verdict badge. The color class (go/maybe/no) is swapped by app.js. */
.verdict {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  padding: 18px;
  border-radius: var(--radius);
  margin: 14px 0;
}
.verdict-go { background: var(--go); }
.verdict-maybe { background: var(--maybe); }
.verdict-no { background: var(--no); }

.breakdown summary { cursor: pointer; color: var(--muted); }
.breakdown ul { padding-left: 18px; color: var(--muted); font-size: 0.9rem; }

/* Buttons */
button { font-family: inherit; }
.primary-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  padding: 6px;
}

/* Settings panel rows */
.platform-setting {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.platform-setting h4 { margin: 0 0 8px; }
.fee-row { display: flex; gap: 10px; }
.fee-row > div { flex: 1; }
.fee-row label { margin-top: 0; font-size: 0.8rem; }

.settings-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

/* Utility: hide an element. app.js toggles this class. */
.hidden { display: none; }

/* ---------- Phase A.5 additions ---------- */

/* Two inputs side by side (e.g. typical + conservative resale). */
.two-col { display: flex; gap: 12px; }
.two-col > div { flex: 1; }

/* The headline "Pay at most $X" line — bigger and boxed so it stands out. */
.hero-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 4px;
  font-size: 1.1rem;
  font-weight: 600;
}
.hero-line strong { font-size: 1.6rem; color: var(--accent); }

/* Smaller, greyer secondary result rows (upside, annualized ROI, etc.). */
.result-line.subtle { font-size: 0.95rem; color: var(--muted); }
.result-line.subtle strong { font-size: 1rem; }

/* The velocity block gets a faint divider above it. */
.velocity-block { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 6px; }

/* Inline grey note next to a label, e.g. "(optional)". */
.muted-inline { color: var(--muted); font-weight: 400; font-size: 0.85rem; }

/* Colored hint variations for the max-buy verdict and fee-verified note. */
.hint.success { color: var(--go); font-weight: 600; }
.hint.danger { color: var(--no); font-weight: 600; }
.hint.warn { color: #b45309; font-weight: 600; }

/* Three fee inputs per platform row need to wrap nicely on narrow phones. */
.fee-row { flex-wrap: wrap; }
.fee-row > div { min-width: 90px; }

/* ---------- Phase B+C: the AI "Identify an item" card ---------- */

textarea {
  width: 100%;
  padding: 12px;
  font-size: 1.05rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}

/* Row holding the Estimate button + Photo button. */
.ai-actions { display: flex; gap: 10px; margin-top: 10px; align-items: stretch; }
.ai-actions .primary-btn { flex: 1; }

/* The Photo button is a <label> styled to match, so tapping it opens the camera. */
.photo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 10px;
  padding: 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-result { margin-top: 14px; }
.ai-item { font-weight: 700; font-size: 1.05rem; margin-bottom: 10px; }

/* Low / Typical / High shown as three little stat boxes. */
.ai-range { display: flex; gap: 8px; text-align: center; }
.ai-range > div {
  flex: 1;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 4px;
}
.ai-range span { display: block; font-size: 0.75rem; color: var(--muted); }
.ai-range strong { font-size: 1.15rem; }
.ai-range > div:nth-child(2) strong { color: var(--accent); } /* highlight typical */

/* The three verify-price links, styled as tappable chips. */
.verify-row { display: flex; gap: 8px; }
.verify-btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 12px 6px;
  font-weight: 700;
  font-size: 0.95rem;
}
