/* ============================================================
   Conference deadline tracker  —  Wonyeong Lee
   Shares the visual language of the CV site (same variables).
   ============================================================ */

:root {
  --bg: #fdfdfc;
  --surface: #f4f4f2;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --accent: #2f5fd0;
  --border: #e6e6e2;
  --max-width: 820px;

  /* D-day urgency */
  --urgent: #d23f3f;
  --soon: #d0822f;
  --ok: #2f8f5f;
  --far: #6b6b70;
}

[data-theme="dark"] {
  --bg: #16181d;
  --surface: #20232a;
  --text: #e7e7ea;
  --muted: #9a9aa2;
  --accent: #7aa2ff;
  --border: #2c2f37;

  --urgent: #ff6b6b;
  --soon: #f0a45a;
  --ok: #5fc88a;
  --far: #9a9aa2;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
               Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 80px;
}

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

/* ---------- Theme toggle (same as CV) ---------- */
.theme-toggle {
  position: fixed;
  top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.2s ease, transform 0.15s ease;
  z-index: 10;
}
.theme-toggle:hover { transform: scale(1.08); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

/* ---------- Header ---------- */
.page-head { margin-bottom: 28px; }
.page-head h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.page-head .sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.page-head .sub a { white-space: nowrap; }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.search {
  flex: 1 1 200px;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
}
.search:focus { outline: none; border-color: var(--accent); }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.toggle input { cursor: pointer; }

/* BK mode toggle */
.bk-toggle {
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bk-toggle:hover { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.bk-toggle.active { background: var(--accent); color: #fff; }
[data-theme="dark"] .bk-toggle.active { color: #16181d; }

/* ---------- Category chips ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip:hover { color: var(--text); }
.chip .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--chip-color, var(--muted));
  flex-shrink: 0;
}
.chip.active {
  color: var(--text);
  border-color: var(--chip-color, var(--accent));
  background: color-mix(in srgb, var(--chip-color, var(--accent)) 14%, var(--surface));
}

/* ---------- Summary line ---------- */
.summary {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.summary strong { color: var(--text); }

/* ---------- Cards ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cat, var(--border));
  border-radius: 11px;
  padding: 14px 18px;
}
.card.passed { opacity: 0.55; }

/* D-day badge */
.dday {
  text-align: center;
  font-weight: 700;
  line-height: 1.1;
}
.dday .num { font-size: 1.45rem; letter-spacing: -0.02em; }
.dday .dday-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 3px;
}
.dd-urgent .num { color: var(--urgent); }
.dd-soon  .num { color: var(--soon); }
.dd-ok    .num { color: var(--ok); }
.dd-far   .num { color: var(--far); }
.dd-passed .num { color: var(--muted); font-size: 1rem; font-weight: 600; padding-top: 6px; }
.dd-tbd .num { color: var(--muted); font-size: 1rem; font-weight: 600; padding-top: 6px; }

/* Card body */
.card-body { min-width: 0; }
.card-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.card-name { margin: 0; font-size: 1.06rem; font-weight: 700; }
.cat-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--cat, var(--muted));
  background: color-mix(in srgb, var(--cat, var(--muted)) 14%, transparent);
  white-space: nowrap;
}
.est-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--soon);
  border: 1px solid color-mix(in srgb, var(--soon) 45%, transparent);
  border-radius: 5px;
  padding: 1px 6px;
  cursor: help;
}

/* BK21 score + KIISE grade badges */
.bk-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  color: #fff;
  letter-spacing: 0.02em;
  cursor: help;
}
.bk-4 { background: #c79a2f; }
.bk-3 { background: #cf7d3a; }
.bk-2 { background: #3f7fc0; }
.bk-1 { background: #9a9aa2; }
.kiise-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: help;
}
.kiise-badge.k-top {
  color: #a9780a;
  background: color-mix(in srgb, #d4a017 16%, transparent);
  border-color: color-mix(in srgb, #d4a017 42%, transparent);
}
.kiise-badge.k-good {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border-color: color-mix(in srgb, var(--muted) 32%, transparent);
}
[data-theme="dark"] .kiise-badge.k-top { color: #e6bf52; }

.card.tbd { opacity: 0.82; }
.tbd-text { color: var(--muted); font-style: italic; }

.card-full { margin: 3px 0 7px; color: var(--muted); font-size: 0.88rem; }

.card-meta { margin: 0 0 5px; font-size: 0.9rem; }
.card-meta .tz { color: var(--muted); font-size: 0.82rem; }
.card-meta .sub-passed { color: var(--muted); text-decoration: line-through; }
.dot-sep { color: var(--border); margin: 0 3px; }

.card-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.card-sub a { font-weight: 600; }
.card-note {
  margin: 7px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  line-height: 1.7;
}
footer p { margin: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  main { padding: 44px 16px 64px; }
  .card { grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 14px; }
  .dday .num { font-size: 1.2rem; }
  .page-head h1 { font-size: 1.6rem; }
}
