/* ============================================================
   Scare Me - stylesheet
   Visuele identiteit: theatraal horror. Eén dramatisch licht in
   het donker; inhoud komt uit de schaduw. Bloedrood accent,
   bot-wit op houtskool-zwart.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,900&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg:            #0d0b0e;
  --bg-raised:     #16131a;
  --bg-input:      #1e1a22;
  --ink:           #e8e3d9;   /* bone / parchment */
  --ink-dim:       #9a938c;
  --ink-faint:     #6a635f;
  --blood:         #b3121f;
  --blood-bright:  #e11d2a;
  --amber:         #d98a2b;
  --green:         #4a9d5b;
  --line:          #2a2530;
  --line-bright:   #3d3547;

  --display: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, sans-serif;

  --radius: 4px;
  --shadow: 0 10px 40px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  /* single dramatic light from top */
  background-image: radial-gradient(120% 80% at 50% -10%, rgba(179,18,31,0.10) 0%, rgba(13,11,14,0) 55%);
  background-attachment: fixed;
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.05; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

.eyebrow {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blood-bright);
}

a { color: var(--amber); }

/* ---------- Layout shells ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(13,11,14,0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: baseline; gap: 0.6rem; }
.brand-mark { font-family: var(--display); font-weight: 900; font-size: 1.5rem; letter-spacing: -0.02em; }
.brand-mark .scare { color: var(--ink); }
.brand-mark .me { color: var(--blood-bright); }
.brand-tag { font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint); }

.topbar-actions { display: flex; align-items: center; gap: 1rem; }
.who { font-size: 0.85rem; color: var(--ink-dim); }
.who strong { color: var(--ink); font-weight: 600; }

/* ---------- Tabs / nav ---------- */
.tabs {
  display: flex; gap: 0.25rem; padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto; background: var(--bg);
}
.tab {
  appearance: none; border: 0; background: none;
  font-family: var(--body); font-size: 0.9rem; font-weight: 500;
  color: var(--ink-dim); padding: 0.9rem 1rem; cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--blood-bright); }
.tab.admin-only { display: none; }
body.is-admin .tab.admin-only { display: block; }

/* ---------- Main content ---------- */
main { flex: 1; padding: 2rem 1.5rem 4rem; max-width: 1200px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-head { margin-bottom: 1.5rem; }
.view-head p { color: var(--ink-dim); margin-top: 0.35rem; max-width: 60ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; font-family: var(--body); font-size: 0.9rem; font-weight: 600;
  padding: 0.6rem 1.1rem; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line-bright); background: var(--bg-input); color: var(--ink);
  transition: all 0.15s; display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn:hover { border-color: var(--ink-faint); }
.btn-primary { background: var(--blood); border-color: var(--blood); color: #fff; }
.btn-primary:hover { background: var(--blood-bright); border-color: var(--blood-bright); }
.btn-ghost { background: none; border-color: transparent; color: var(--ink-dim); }
.btn-ghost:hover { color: var(--ink); background: var(--bg-input); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--ink-dim); margin-bottom: 0.35rem; }
input, select, textarea {
  width: 100%; font-family: var(--body); font-size: 0.92rem;
  padding: 0.6rem 0.75rem; background: var(--bg-input); color: var(--ink);
  border: 1px solid var(--line-bright); border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blood); outline-offset: -1px; }
.field { margin-bottom: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.6rem 0.8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--bg-input); font-weight: 600; color: var(--ink-dim); font-size: 0.78rem; letter-spacing: 0.03em; text-transform: uppercase; position: sticky; top: 0; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
td .cell-actions { display: flex; gap: 0.4rem; }

/* ---------- Status pills ---------- */
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.pill-ja       { background: rgba(74,157,91,0.15);  color: #6cc47d; }
.pill-nee      { background: rgba(179,18,31,0.15);  color: #e56571; }
.pill-onbekend { background: rgba(217,138,43,0.15); color: var(--amber); }

/* ---------- Availability pivot ---------- */
.pivot th.date-col { text-align: center; }
.pivot td.date-cell { text-align: center; cursor: default; }
.pivot .yes { color: #6cc47d; font-weight: 600; }
.pivot .no  { color: var(--ink-faint); }
.pivot .unk { color: var(--amber); }
.pivot td.name-cell { font-weight: 600; position: sticky; left: 0; background: var(--bg-raised); }
.pivot .time { display: block; font-size: 0.72rem; color: var(--ink-dim); font-weight: 400; }

/* ---------- Availability form (actor) ---------- */
.day-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.day-row:last-child { border-bottom: 0; }
.day-date { font-weight: 600; }
.day-date .sub { display: block; font-size: 0.78rem; color: var(--ink-dim); font-weight: 400; }
.seg { display: inline-flex; border: 1px solid var(--line-bright); border-radius: var(--radius); overflow: hidden; }
.seg button {
  appearance: none; border: 0; background: var(--bg-input); color: var(--ink-dim);
  padding: 0.45rem 0.8rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; font-family: var(--body);
  border-right: 1px solid var(--line-bright);
}
.seg button:last-child { border-right: 0; }
.seg button.sel-ja  { background: var(--green); color: #fff; }
.seg button.sel-nee { background: var(--blood); color: #fff; }
.seg button.sel-onbekend { background: var(--amber); color: #1a1a1a; }
.day-time input { width: 130px; }
.day-time.hidden { visibility: hidden; }

@media (max-width: 640px) {
  .day-row { grid-template-columns: 1fr; gap: 0.6rem; }
  .field-row { grid-template-columns: 1fr; }
  .day-time input { width: 100%; }
  .topbar { padding: 0.75rem 1rem; }
  .brand-tag { display: none; }
  .who { font-size: 0.78rem; }
  .topbar-actions { gap: 0.6rem; }
}

/* ---------- Auth / login screen ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; text-align: center; }
.auth-card .brand-mark { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.auth-card p { color: var(--ink-dim); margin-bottom: 1.5rem; }
.auth-card .field { text-align: left; }
.auth-note { font-size: 0.8rem; color: var(--ink-faint); margin-top: 1rem; }

/* ---------- Toast ---------- */
#toast-host { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--bg-raised); border: 1px solid var(--line-bright); border-left: 3px solid var(--blood-bright);
  color: var(--ink); padding: 0.8rem 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 0.88rem; animation: rise 0.25s ease both; max-width: 90vw;
}
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--blood-bright); }

/* ---------- Utility ---------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--ink-dim); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-faint); }
.empty h3 { color: var(--ink-dim); margin-bottom: 0.5rem; }
.loading { text-align: center; padding: 3rem; color: var(--ink-dim); }
.toolbar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 180px; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: grid; place-items: center; z-index: 90; padding: 1.5rem; }
.modal { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
