/* ================================================================
   K-Startup Calendar — Styles
   ================================================================ */

:root {
  --bg:      #05070e;
  --surface: #0c1120;
  --border:  #182840;
  --text:    #c0d4f0;
  --muted:   #48586a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', 'Noto Sans KR', system-ui, sans-serif;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-items: center;
  justify-items: center;
  height: 100vh;
  width: 100vw;
  padding: 14px 16px 8px;
}

/* ── Header ──────────────────────────────────────────────────── */
header { text-align: center; width: 100%; padding-bottom: 2px; }

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 24px);
  flex-wrap: wrap;
}
header h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(120deg, #60a5fa 0%, #34d399 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
header p {
  font-size: clamp(0.58rem, 1.1vw, 0.73rem);
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ── Year Navigation ─────────────────────────────────────────── */
.year-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 4px 10px;
  flex-shrink: 0;
}
.year-nav button {
  background: none;
  border: none;
  color: #60a5fa;
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
  cursor: pointer;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.year-nav button:hover  { background: rgba(96,165,250,0.15); }
.year-nav button:active { background: rgba(96,165,250,0.3); }
.year-nav button:disabled { color: var(--muted); cursor: default; }
.year-nav button:disabled:hover { background: none; }

#year-select {
  background: none;
  border: none;
  color: #e0f0ff;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  outline: none;
  text-align: center;
  width: clamp(52px, 6vw, 68px);
  appearance: none;
  -webkit-appearance: none;
}
#year-select option {
  background: #0c1120;
  color: #c0d4f0;
  font-weight: 600;
}

/* ── Status ──────────────────────────────────────────────────── */
#status {
  font-size: 0.68rem;
  padding: 3px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
  min-height: 22px;
  transition: all 0.3s;
  width: 100%;
  text-align: center;
}
#status.idle    { color: var(--muted); }
#status.loading { color: #60a5fa; border-color: #1a3a6a; background: #040c18; }
#status.success { color: #4ade80; border-color: #14532d; background: #021008; }
#status.error   { color: #f87171; border-color: #7f1d1d; background: #120408; }

/* ── Calendar ────────────────────────────────────────────────── */
#cal-wrap {
  width:  min(calc(100vh - 128px), calc(100vw - 32px));
  height: min(calc(100vh - 128px), calc(100vw - 32px));
  flex-shrink: 0;
  transition: opacity 0.25s ease;
}
#cal-wrap.fading { opacity: 0.25; }
#cal-wrap svg { width: 100%; height: 100%; display: block; }

/* ── Legend ──────────────────────────────────────────────────── */
#legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 10px;
  width: 100%;
  padding: 3px 0 2px;
}
.legend-item {
  display: flex; align-items: center; gap: 4px;
  font-size: clamp(0.52rem, 0.9vw, 0.65rem);
  color: var(--muted);
}
.legend-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ── Tooltip ─────────────────────────────────────────────────── */
#tip {
  position: fixed;
  z-index: 9000;
  background: rgba(5, 8, 18, 0.97);
  border: 1px solid #2a4875;
  border-radius: 9px;
  padding: 9px 13px;
  font-size: 0.73rem;
  line-height: 1.55;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  max-width: 190px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ── Modal ───────────────────────────────────────────────────── */
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(5px);
  z-index: 8000;
  align-items: center;
  justify-content: center;
}
#overlay.on { display: flex; }
#modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px;
  width: min(92vw, 520px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
#modal-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px; gap: 12px;
}
#modal-header h2 { font-size: 1rem; color: #7ab8ff; font-weight: 600; margin-bottom: 3px; }
#modal-date { font-size: 0.72rem; color: var(--muted); }
#modal-close {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 12px;
  font-size: 0.73rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
#modal-close:hover { border-color: #7ab8ff; color: #7ab8ff; }

.card {
  background: #08101c;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card:last-child { margin-bottom: 0; }
.card-title { font-size: 0.86rem; color: #d8e8fc; font-weight: 500; line-height: 1.45; margin-bottom: 8px; }
.card-meta  { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 5px; }
.badge      { background: #0e1e38; color: #60a5fa; border-radius: 4px; padding: 2px 9px; font-size: 0.68rem; font-weight: 600; }
.period     { font-size: 0.68rem; color: var(--muted); }
.link-btn {
  display: inline-block; margin-top: 7px;
  padding: 5px 15px;
  background: #0f2445; color: #7ab8ff;
  border: 1px solid #1e3a6a; border-radius: 7px;
  font-size: 0.72rem; text-decoration: none;
  transition: background 0.15s;
}
.link-btn:hover { background: #172f5a; }
.empty-msg  { color: var(--muted); font-size: 0.83rem; text-align: center; padding: 28px 0; }

/* No-data banner inside modal */
.no-data-banner {
  text-align: center;
  padding: 20px 16px;
}
.no-data-banner .icon { font-size: 2rem; margin-bottom: 10px; }
.no-data-banner p  { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }
.no-data-banner strong { color: #f59e0b; }

.day-seg { cursor: pointer; transition: filter 0.12s; }
.day-seg:hover { filter: brightness(2) saturate(1.4); }

/* ── Credit ──────────────────────────────────────────────────── */
#credit {
  position: fixed;
  bottom: 18px;
  right: 22px;
  z-index: 100;
}
#credit a {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #3a4e6a;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}
#credit a::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  transition: width 0.25s ease;
}
#credit a:hover {
  color: #7ab8ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#credit a:hover::before {
  width: 0;
}
