@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@300;400;500&display=swap');

/* -------- RESET -------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* -------- TOKENS -------- */
:root {
  --bg:      #0f0f0f;
  --surface: #1a1a1a;
  --surface2:#242424;
  --border:  rgba(255,255,255,0.08);
  --text:    #f0f0f0;
  --muted:   #888;
  --accent:  #4A9EFF;
  --accent2: #52C97A;
  --warm:    #FF9F4A;
  --warn:    #FF6B4A;
  --danger:  #b30000;
  --radius:  12px;
}

/* -------- BASE -------- */
html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 48px;
}

/* -------- PAGE HEADER (full-width top bar like the timer) -------- */
.page-header {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.page-header h1,
.page-title {
  font-size: 13px;
  font-family: 'DM Mono', monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 400;
  margin: 0;
}

/* -------- CARD CONTAINER -------- */
/* Mobile-first: full bleed with padding */
.container, .card-container {
  background: var(--surface);
  width: 100%;
  padding: 20px 16px;
  text-align: center;
}

/* On wider screens: float as a card */
@media (min-width: 600px) {
  .container, .card-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 520px;
    padding: 28px 24px;
    margin-top: 8px;
  }
}

/* Wide variant — for admin tables, meal plan, etc */
.container.wide {
  max-width: 960px;
}

/* -------- HEADINGS -------- */
h1, h2 {
  color: var(--warm);
  margin-bottom: 1.2rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}
h1 { font-size: clamp(1.2rem, 5vw, 1.8rem); }
h2 { font-size: clamp(1.1rem, 4vw, 1.5rem); }
h3 { font-size: 15px; color: var(--accent); margin-bottom: 0.6rem; font-weight: 500; }
p  { color: var(--muted); margin-bottom: 0.5rem; }
p strong { color: var(--text); }

/* -------- LABELS -------- */
label {
  font-size: 12px;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  text-align: left;
}

/* -------- INPUTS -------- */
input, textarea, select {
  width: 100%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  /* prevents zoom on focus on iOS */
  font-size: max(16px, 1rem);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
select option { background: var(--surface2); }

/* -------- BUTTONS -------- */
button, .btn, .btn-link {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s, transform 0.1s;
  /* easier tap targets on mobile */
  min-height: 44px;
}
button:hover, .btn:hover { opacity: 0.85; }
button:active, .btn:active { transform: scale(0.98); opacity: 0.7; }

.btn-delete   { background: var(--danger) !important; color: #fff !important; }
.btn-secondary{ background: var(--surface2); color: var(--text); border: 1px solid var(--border); margin-top: 0.75rem; }
.btn-secondary:hover { border-color: var(--accent); }
.btn-small    { padding: 0.4rem 0.85rem; font-size: 0.85rem; min-height: 36px; }
.print-btn    { background: var(--accent2); color: #000; padding: 0.4rem 0.85rem; font-size: 0.85rem; border-radius: 8px; margin-top: 0.75rem; cursor: pointer; }
.remove-stock { background: var(--danger); color: #fff; border: none; padding: 3px 8px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; }

/* Full-width button utility */
.btn-full { width: 100%; }

/* -------- NAV LINKS -------- */
.admin-link, .back-link {
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1.2rem;
}
.admin-button {
  background: var(--surface2);
  color: var(--accent);
  border: 1px solid rgba(74,158,255,0.3);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 1.2rem;
  transition: border-color 0.2s;
}
.admin-button:hover { border-color: var(--accent); }

.home {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  font-size: 0.85rem;
  margin-top: 1.2rem;
  font-family: 'DM Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s, border-color 0.2s;
}
.home:hover { color: var(--text); border-color: var(--muted); }

/* -------- LAYOUT HELPERS -------- */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 1rem;
}
@media (max-width: 400px) {
  .two-columns { grid-template-columns: 1fr; }
}

.section-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  color: var(--text);
  text-align: left;
}
.section-header {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--warm);
  text-align: center;
  margin-bottom: 0.7rem;
  font-weight: 500;
}

/* -------- ADMIN TABLE -------- */
.admin-table-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1.5rem;
  width: 100%;
  text-align: left;
  overflow-x: auto;          /* scroll on small screens */
}
@media (min-width: 600px) {
  .admin-table-panel { padding: 1.5rem; }
}
.admin-table-panel h3 { color: var(--warm); margin-bottom: 0.6rem; }
.admin-table-panel table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 480px; }
.admin-table-panel thead { position: sticky; top: 0; background: var(--surface); z-index: 5; }
.admin-table-panel tbody { display: block; max-height: 50vh; overflow-y: scroll; }
.admin-table-panel thead tr,
.admin-table-panel tbody tr { display: table; width: 100%; table-layout: fixed; }
.admin-table-panel td,
.admin-table-panel th { padding: 0.5rem; border: 1px solid var(--border); color: var(--text); font-size: 0.9rem; }
.admin-table-panel th { color: var(--muted); font-family: 'DM Mono', monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.admin-table-panel tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* -------- INGREDIENT ROW -------- */
.ingredient-row { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.remove-ing { background: var(--danger); color: #fff; border: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-weight: 500; }

/* -------- RESULTS -------- */
.result-box, #results p {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  margin: 0.4rem 0;
  color: var(--text);
  text-align: left;
}
#results strong { color: var(--accent); }
#results h3 { margin-top: 1rem; }

/* -------- MISC -------- */
.list-block li { margin-bottom: 10px; color: var(--muted); }

/* -------- PRINT -------- */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
