/* public/core.css */

/* ---------- Theme tokens ---------- */
:root{
  --bg:#0b0b0f;
  --panel:#141420;
  --panel2:#0f0f18;
  --border:#23233a;
  --border2:#2c2c46;

  --text:#ffffff;
  --muted:rgba(255,255,255,.72);
  --brand:#ffb3ae;

  --r-lg:16px;
  --r-md:12px;

  --pad:18px;
  --gap:12px;

  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* ---------- Reset / base ---------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% -10%, rgba(255,179,174,.08), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(120,150,255,.06), transparent 55%),
    var(--bg);
}

a{ color:var(--brand); text-decoration:none; }
a:hover{ text-decoration:underline; }

code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  padding:2px 6px;
  border-radius:10px;
}

h1,h2,h3{ letter-spacing:-.02em; }
h2{ font-size:22px; }

/* ---------- Layout helpers ---------- */
.wrap{ max-width:1100px; margin:0 auto; padding:28px; }
.wrap.narrow{ max-width:980px; }
.wrap.tiny{ max-width:520px; }

.row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:var(--gap);
  flex-wrap:wrap;
}

.top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:var(--gap);
}

/* ---------- Cards ---------- */
.card{
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 55%),
    var(--panel);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:var(--pad);
  box-shadow:var(--shadow);
}

/* ---------- Grid ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:var(--gap);
  margin-top:16px;
}

/* ---------- Typography bits ---------- */
.muted{ color:var(--muted); font-size:13px; line-height:1.3; }
.msg{ margin-top:10px; font-size:14px; opacity:.95; }
.ok{ color:#9dffb0; }
.err{ color:#ff8a8a; }

/* ---------- Buttons ---------- */
.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border2);
  background: rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  user-select:none;
}

.btn:hover{ filter:brightness(1.05); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:.55; cursor:not-allowed; transform:none; }

.smallbtn{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border2);
  background: rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.smallbtn:hover{ filter:brightness(1.05); }
.smallbtn:disabled{ opacity:.55; cursor:not-allowed; }

/* full-width button for login */
.btn.full{ width:100%; justify-content:center; font-weight:600; }

/* ---------- Inputs ---------- */
input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border2);
  background: var(--panel2);
  color:var(--text);
  outline:none;
}

input::placeholder, textarea::placeholder{
  color: rgba(255,255,255,.35);
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 3px rgba(255,179,174,.08);
}

textarea{
  min-height:520px;
  padding:12px;
  border-radius:14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height:1.4;
}

/* labels */
label{
  font-size:12px;
  color:var(--muted);
  display:block;
  margin-bottom:6px;
}

/* create/edit layout helpers */
.col{ flex:1; min-width:220px; }
.topbar{ display:flex; justify-content:space-between; align-items:center; gap:16px; }
.topbar h2{ margin:0; line-height:1.1; }
.topbar .left{ display:flex; flex-direction:column; gap:6px; }

/* ---------- Tables ---------- */
table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
}

th, td{
  border-bottom:1px solid var(--border);
  padding:10px;
  vertical-align:top;
}

th{
  text-align:left;
  color: rgba(255,255,255,.8);
  font-size:13px;
  font-weight:600;
}

/* ---------- Checkbox rows ---------- */
.checkrow{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
}

.checkrow label{
  display:flex;
  gap:8px;
  align-items:center;
  margin:0;
  opacity:1;
  color: var(--text);
  font-size:13px;
}

.checkrow input[type="checkbox"]{ width:auto; }

/* ---------- Ingredient row helper ---------- */
.ingredientRow{ align-items:flex-end; }
.ingredientRow .col{ min-width:160px; }

/* ---------- Profile dropdown ---------- */
.profileWrap{ position:relative; }
.profileBtn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 12px;
  border-radius:14px;
  border:1px solid var(--border2);
  background: rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
}

.profileName{ font-weight:600; }

.profileAvatar{
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid var(--border);
  background: var(--panel2);
  object-fit:cover;
}

.profileMenu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  min-width:160px;
  background: var(--panel);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px;
  display:none;
  z-index:50;
  box-shadow: var(--shadow);
}
.profileWrap.open .profileMenu{ display:block; }

.menuBtn{
  width:100%;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--border2);
  background: var(--panel2);
  color:var(--text);
  cursor:pointer;
  text-align:left;
}

/* ---------- Utilities ---------- */
.hidden{ display:none !important; } /* IMPORTANT for your toggle logic */

/* small spacing helpers */
.mt-6{ margin-top:6px; }
.mt-10{ margin-top:10px; }
.mt-12{ margin-top:12px; }
.mt-14{ margin-top:14px; }
.mt-16{ margin-top:16px; }

/* nicer “card title” text */
.cardTitle{ font-weight:700; }
/* ---- spacing fixes ---- */
.card{ margin-top:14px; }          /* gap between cards */
.row{ gap:12px; }                  /* gap between columns in a row */
.mt6{ margin-top:6px; }
.mt10{ margin-top:10px; }
.mt12{ margin-top:12px; }
.mt14{ margin-top:14px; }

/* ingredient list spacing */
#ingredientsList > [data-ing-row="1"]{ margin-top:12px; }

/* optional: make check rows not look crushed */
.checkrow{ gap:14px; flex-wrap:wrap; align-items:center; }
/* must be last */
.hidden { display: none !important; }