/* Schedular web dashboard — dark, Apollo-style theme.
   Served from /static/app.css by the Go binary. Plain CSS (no build step). */

:root {
  --bg: #0a0d13;
  --bg-2: #0e1219;
  --panel: #12161f;
  --panel-2: #161b26;
  --border: #1f2633;
  --text: #e8ebf2;
  --muted: #8a93a6;
  --accent: #f97316;       /* orange — create event / card accents */
  --brand: #8b5cf6;        /* purple — brand mark */
  --discord: #5865f2;      /* discord blurple */
  --teal: #0f3d3a;
  --teal-2: #0a2a28;
  --ok: #22c55e;
  --radius: 10px;
  --sidebar-w: 240px;

  /* Bold/vibrant palette extensions — secondary stops for gradients built
     from the existing accent (orange) and brand (purple) hues. */
  --accent-2: color-mix(in srgb, var(--accent) 75%, white);
  --brand-2: color-mix(in srgb, var(--brand) 75%, white);
  --duo-grad: linear-gradient(135deg, var(--accent), var(--brand));
  --duo-grad-text: linear-gradient(90deg, var(--accent-2), var(--brand-2));
  --duo-grad-soft: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--brand) 22%, transparent));

  /* Elevation — layered dark-mode shadows (soft, close, and ambient). */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.32), 0 10px 24px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.38), 0 24px 48px rgba(0, 0, 0, 0.4);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --ring-brand: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
  --ring-accent: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  --glow-duo: 0 4px 20px color-mix(in srgb, var(--accent) 35%, transparent), 0 4px 28px color-mix(in srgb, var(--brand) 30%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Visible keyboard focus everywhere, layered on top of native outline removal. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.nav-item:focus-visible,
.menu-item:focus-visible,
.chip input:focus-visible + .chip-box {
  outline: none;
  box-shadow: var(--ring-brand);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Login ---------- */

.login {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 10% -10%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
    radial-gradient(820px 520px at 108% 112%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    var(--bg);
}

.login-brand {
  width: 38%;
  background:
    radial-gradient(560px 420px at 18% -6%, color-mix(in srgb, var(--brand) 34%, transparent), transparent 60%),
    radial-gradient(520px 420px at 92% 108%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    linear-gradient(160deg, #160a2b, #0a0518);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06), var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.brand-orb {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, var(--accent-2), var(--accent) 44%, var(--brand) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 34px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 64px color-mix(in srgb, var(--brand) 45%, transparent);
  animation: orb-pulse 4s ease-in-out infinite;
}

.brand-name {
  margin: 0;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--duo-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--brand) 45%, transparent));
}

.brand-tag {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent);
}

.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: transparent;
}

.login-card { text-align: center; max-width: 420px; width: 100%; }

.login-title {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--duo-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-sub { margin: 0 0 28px; color: var(--muted); }

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--discord);
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(88, 101, 242, 0.35), 0 10px 34px color-mix(in srgb, var(--discord) 28%, transparent);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.login-btn:hover { background: #4752c4; box-shadow: var(--shadow-md), 0 0 0 1px rgba(88, 101, 242, 0.45); }
.login-btn:active { transform: translateY(1px); box-shadow: var(--shadow-xs); }

/* ---------- App shell (sidebar + main) ---------- */

.app {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(900px 620px at 88% -12%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%),
    radial-gradient(720px 520px at -6% 112%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    var(--bg);
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.logo-orb {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), var(--accent) 40%, var(--brand) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 16px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 26px color-mix(in srgb, var(--brand) 35%, transparent);
  flex-shrink: 0;
  animation: orb-pulse 4s ease-in-out infinite;
}

@keyframes orb-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.workspace-name {
  font-weight: 800;
  line-height: 1.2;
  background: var(--duo-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.workspace-sub { color: var(--muted); font-size: 12px; }

.nav { flex: 1; overflow-y: auto; padding: 10px; }

.nav-section {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 14px 10px 6px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.nav-section:first-child { border-top: none; margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-item:hover { background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs); }

.nav-item.active {
  background: var(--duo-grad-soft);
  color: #fdf2ff;
  box-shadow: inset 3px 0 0 0 var(--accent), var(--shadow-xs);
  position: relative;
}

.nav-item.active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  border-radius: 0 2px 2px 0;
}

.nav-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.nav-ico svg { width: 18px; height: 18px; }

.nav-item:hover .nav-ico, .nav-item.active .nav-ico { color: var(--text); }

.nav-item.premium .nav-ico { filter: saturate(1.2); }

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
}

.avatar.guest {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.profile-name { font-weight: 600; line-height: 1.2; }

.profile-tag { color: var(--muted); font-size: 12px; }

.profile-tag a:hover { color: var(--text); text-decoration: underline; }

.profile-chev {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.profile-chev svg { width: 16px; height: 16px; margin-right: 0; }

.profile-chev:hover { color: var(--text); }

/* ---------- Main content ---------- */

.main { flex: 1; padding: 28px 36px; max-width: 980px; }

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }

.month {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--duo-grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.topbar-actions { display: flex; gap: 10px; }

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.hint code {
  background: var(--panel-2);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--text);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #1c0d00;
  box-shadow: var(--shadow-sm), var(--glow-duo);
}

.btn.primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-md), var(--glow-duo); }
.btn.primary:active { transform: translateY(1px); box-shadow: var(--shadow-xs); }

.btn.ghost { background: var(--panel); color: var(--muted); border-color: var(--border); box-shadow: var(--shadow-inset); }

.btn.ghost:hover { color: var(--text); background: var(--panel-2); box-shadow: var(--shadow-xs), var(--shadow-inset); }
.btn.ghost:active { transform: translateY(1px); }

/* ---------- Event cards ---------- */

.day-group { margin-bottom: 20px; }

.day-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.event-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.event-card:hover {
  background: var(--panel-2);
  box-shadow: var(--shadow-md), var(--shadow-inset);
  transform: translateY(-1px);
}

.card-accent {
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent), var(--brand));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent);
}

.card-body { flex: 1; min-width: 0; }

.card-title { font-weight: 700; }

/* Inline icon sizing wherever the icon() helper is used next to text. */
.card-title svg, .card-count svg, .banner svg, .scout-hist-item svg,
.form-title svg, .form-sub svg, .menu svg, .profile-chev svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 2px;
}

.card-count, .card-title, .banner, .scout-hist-item, .form-sub {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.form-title { display: flex; align-items: center; gap: 8px; }
.form-title svg { width: 20px; height: 20px; margin-right: 0; }

.card-sub { color: var(--muted); font-size: 13px; }

.card-count { color: var(--muted); white-space: nowrap; }

.card-link {
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.card-link:hover { text-decoration: underline; }

.menu {
  background: none;
  border: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.menu svg { width: 18px; height: 18px; margin-right: 0; }

.menu:hover { color: var(--text); background: var(--panel-2); }

.card-actions { position: relative; display: flex; align-items: center; }

.card-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 130px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  box-shadow: var(--shadow-lg), var(--shadow-inset);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.menu-item svg { width: 14px; height: 14px; flex-shrink: 0; }

.menu-item:hover { background: var(--panel); }

.menu-item.danger { color: #f87171; }

.menu-item.danger:hover { background: rgba(248, 113, 113, 0.12); }

.table-panel { padding: 8px 0; }

.results-table { width: 100%; border-collapse: collapse; }

.results-table th, .results-table td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.results-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-table tbody tr:last-child td { border-bottom: none; }

.results-table tbody tr { transition: background 0.12s ease; }

.results-table tbody tr:hover { background: var(--panel-2); }

.scout-card { margin-bottom: 14px; }

.scout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.scout-updated { color: var(--muted); font-size: 12px; }

.scout-notes { white-space: pre-wrap; color: var(--text); }

.scout-history { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

.scout-hist-item { color: var(--muted); font-size: 13px; padding: 2px 0; }

textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}

textarea:focus { border-color: var(--brand); }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.cmd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  overflow-x: auto;
  margin: 14px 0;
}

.new-actions { margin-top: 18px; }

.stack { display: flex; flex-direction: column; }

select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

select:focus { border-color: var(--brand); }

.banner {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}

.banner.ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--ok);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.banner.err {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.color-row:last-of-type { border-bottom: none; }

.color-label { font-weight: 600; }

.color-desc { color: var(--muted); font-size: 13px; }

.color-input {
  width: 56px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
}

.section-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0 14px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
}

.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ---------- Poll form ---------- */

.shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 20px;
}

.back { color: var(--muted); font-size: 13px; }

.back:hover { color: var(--text); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 16px;
  box-shadow: var(--shadow-md), var(--shadow-inset);
}

.form-title { margin: 0 0 4px; font-size: 22px; }

.form-sub { color: var(--muted); }

.muted { color: var(--muted); }

.field-label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 13px; }

input[type="text"], input:not([type]) {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

input:focus { border-color: var(--brand); }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.chip { cursor: pointer; }

.chip input { display: none; }

.chip-box {
  display: block;
  text-align: center;
  padding: 10px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  user-select: none;
  box-shadow: var(--shadow-inset);
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.08s ease;
}

.chip-box:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }

.chip input:checked + .chip-box {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm), 0 0 0 1px color-mix(in srgb, var(--brand) 70%, transparent);
  transform: translateY(-1px);
}

.status { margin-top: 12px; font-weight: 600; min-height: 20px; }

.status.ok { color: var(--ok); }
.status.err { color: #f87171; }

.roster-list { display: flex; flex-direction: column; gap: 8px; }

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.roster-name { font-weight: 700; }
.roster-slots { color: var(--muted); font-size: 13px; }

@media (max-width: 720px) {
  .login { flex-direction: column; }
  .login-brand { width: 100%; min-height: 30vh; }
  .sidebar { width: 72px; box-shadow: 2px 0 16px rgba(0, 0, 0, 0.28); }

  /* Collapse to icon-only rail. Labels stay in the DOM for screen readers
     (via .sr-only below) instead of being shrunk to font-size: 0, which
     also collapsed the emoji icons themselves. */
  .workspace-name, .workspace-sub, .profile-meta, .profile-chev { display: none; }
  .nav-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

  .nav-section { border-top: none; padding: 8px 0; text-align: center; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .main { padding: 20px; }
}
