/* ===== ScrimVault — Agenda v2 (Weekly Calendar) =====
   Visual layer for the scrim agenda — calendar grid (Mon–Sun × hours),
   slot blocks, host vs visitor flows, and the public /a/<slug> page.
   Tokens default-fallback so the page never renders unstyled.
*/

:root {
  --sched-bg: #0b0e15;
  --sched-bg-card: #161b25;
  --sched-bg-card-hi: #1d2330;
  --sched-bg-grid: #11151e;
  --sched-bg-cell: #0d1119;
  --sched-bg-cell-hi: #161b25;
  --sched-border: #252d3a;
  --sched-border-hi: #353d4f;
  --sched-text: #e2e8f0;
  --sched-text-mute: #94a3b8;
  --sched-text-faint: #64748b;
  --sched-accent: #00e5ff;
  --sched-accent-glow: rgba(0, 229, 255, 0.15);
  --sched-amber: #f59e0b;
  --sched-green: #22c55e;
  --sched-red: #e63946;
  --sched-rose: #fb7185;
  --sched-violet: #a78bfa;
  --sched-radius: 10px;
}

/* ===== Sub-tabs (host view) ===== */
.schedule-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--sched-bg-card);
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-radius);
  padding: 0.25rem;
}
.schedule-tab {
  border: none;
  background: transparent;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sched-text-mute);
  border-radius: 7px;
  transition: all 0.18s ease;
}
.schedule-tab:hover { color: var(--sched-text); background: rgba(255, 255, 255, 0.03); }
.schedule-tab.active {
  background: var(--sched-accent);
  color: #0a0a0a;
  box-shadow: 0 0 12px var(--sched-accent-glow);
}

/* ===== Top bar (week nav, share, profile) ===== */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--sched-bg-card);
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-radius);
}
.cal-week-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--sched-bg-grid);
  border-radius: 7px;
  padding: 0.2rem;
}
.cal-week-nav button {
  border: none;
  background: transparent;
  color: var(--sched-text-mute);
  padding: 0.4rem 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 5px;
  line-height: 1;
}
.cal-week-nav button:hover { color: var(--sched-text); background: rgba(255, 255, 255, 0.04); }
.cal-week-label {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sched-text);
  padding: 0 0.6rem;
}
.cal-toolbar-spacer { flex: 1; }
.cal-share-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  color: var(--sched-text-mute);
  background: var(--sched-bg-grid);
  border: 1px solid var(--sched-border);
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-share-link:hover { color: var(--sched-accent); border-color: var(--sched-accent); }
.cal-share-link .icon { font-size: 0.9rem; }

/* ===== Calendar grid ===== */
.cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  grid-auto-rows: 38px;
  background: var(--sched-bg-grid);
  border: 1px solid var(--sched-border);
  border-radius: var(--sched-radius);
  overflow: hidden;
  position: relative;
}

/* Sticky day-header row */
.cal-day-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--sched-bg-card);
  border-bottom: 1px solid var(--sched-border-hi);
  padding: 0.55rem 0.5rem;
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sched-text-mute);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  align-items: center;
  justify-content: center;
}
.cal-day-head.is-today { color: var(--sched-accent); }
.cal-day-head .day-num {
  font-size: 1.05rem;
  color: var(--sched-text);
  font-weight: 800;
}
.cal-day-head.is-today .day-num { color: var(--sched-accent); }
.cal-corner {
  position: sticky;
  top: 0; left: 0;
  z-index: 4;
  background: var(--sched-bg-card);
  border-bottom: 1px solid var(--sched-border-hi);
  border-right: 1px solid var(--sched-border);
}

/* Hour-label column */
.cal-hour-label {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--sched-bg-grid);
  border-right: 1px solid var(--sched-border);
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: var(--sched-text-faint);
  text-align: right;
  padding: 0 0.45rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 0.15rem;
}

/* Empty cell — clickable for host */
.cal-cell {
  border-right: 1px solid var(--sched-border);
  border-bottom: 1px solid var(--sched-border);
  background: var(--sched-bg-cell);
  position: relative;
  cursor: default;
  transition: background 0.12s ease;
}
.cal-cell:nth-last-child(-n+7) { border-bottom: none; }
.cal-cell.is-host:hover { background: var(--sched-bg-cell-hi); cursor: pointer; }
.cal-cell.is-host:hover::after {
  content: "+ slot";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--sched-accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.cal-cell.is-past { background: rgba(0, 0, 0, 0.25); cursor: not-allowed; }

/* Slot block — absolutely positioned over cells */
.cal-slot {
  position: absolute;
  left: 3px;
  right: 3px;
  background: linear-gradient(140deg, rgba(0, 229, 255, 0.12) 0%, rgba(0, 229, 255, 0.06) 100%);
  border: 1px solid rgba(0, 229, 255, 0.45);
  border-left: 3px solid var(--sched-accent);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cal-slot:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 229, 255, 0.18);
  z-index: 2;
}
.cal-slot.is-pending {
  background: linear-gradient(140deg, rgba(245, 158, 11, 0.14) 0%, rgba(245, 158, 11, 0.06) 100%);
  border-color: rgba(245, 158, 11, 0.5);
  border-left-color: var(--sched-amber);
}
.cal-slot.is-confirmed {
  background: linear-gradient(140deg, rgba(34, 197, 94, 0.14) 0%, rgba(34, 197, 94, 0.06) 100%);
  border-color: rgba(34, 197, 94, 0.5);
  border-left-color: var(--sched-green);
}
.cal-slot.is-cancelled, .cal-slot.is-completed {
  background: rgba(100, 116, 139, 0.08);
  border-color: rgba(100, 116, 139, 0.3);
  border-left-color: var(--sched-text-faint);
  opacity: 0.6;
  cursor: default;
}
.cal-slot-time {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sched-text);
  letter-spacing: 0.02em;
}
.cal-slot-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sched-text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.cal-slot-meta {
  font-size: 0.65rem;
  color: var(--sched-text-mute);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-slot-pending-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sched-amber);
  margin-right: 0.3rem;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.7);
}

/* "Now" red line */
.cal-now-line {
  position: absolute;
  left: 60px;
  right: 0;
  height: 2px;
  background: var(--sched-rose);
  z-index: 5;
  pointer-events: none;
}
.cal-now-line::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sched-rose);
}

/* ===== Buttons ===== */
.btn {
  border: 1px solid var(--sched-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sched-text);
  padding: 0.5rem 0.9rem;
  border-radius: 7px;
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--sched-border-hi); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--sched-accent); border-color: var(--sched-accent); color: #0a0a0a; }
.btn-primary:hover { background: #00f5ff; border-color: #00f5ff; box-shadow: 0 0 14px var(--sched-accent-glow); }
.btn-secondary { background: transparent; border-color: var(--sched-border-hi); color: var(--sched-text-mute); }
.btn-secondary:hover { color: var(--sched-text); border-color: var(--sched-text-mute); }
.btn-danger { background: transparent; border-color: rgba(230, 57, 70, 0.4); color: var(--sched-red); }
.btn-danger:hover { background: rgba(230, 57, 70, 0.08); border-color: var(--sched-red); }
.btn-success {
  background: linear-gradient(140deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}
.btn-success:hover { box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--sched-text-mute); }
.btn-ghost:hover { color: var(--sched-text); background: rgba(255, 255, 255, 0.04); }

/* ===== Modal ===== */
.sv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.18s ease;
  padding: 1rem;
}
.sv-modal-backdrop.is-open { opacity: 1; }
.sv-modal {
  background: var(--sched-bg-card-hi);
  border: 1px solid var(--sched-border-hi);
  border-radius: 12px;
  padding: 1.4rem 1.5rem 1.3rem;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(0, 229, 255, 0.05);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}
.sv-modal-backdrop.is-open .sv-modal { transform: translateY(0) scale(1); }
.sv-modal-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--sched-text);
}
.sv-modal-subtitle {
  font-size: 0.82rem;
  color: var(--sched-text-mute);
  margin-bottom: 1rem;
  line-height: 1.45;
}
.sv-modal-context {
  font-size: 0.8rem;
  color: var(--sched-text);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.85rem;
  line-height: 1.45;
}
.sv-modal-body { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.2rem; }
.sv-modal-body label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--sched-text-mute);
}
.sv-modal-body label .req { color: var(--sched-rose); margin-left: 0.2rem; }
.sv-modal-body label .opt { color: var(--sched-text-faint); margin-left: 0.2rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
.sv-modal-body input,
.sv-modal-body textarea,
.sv-modal-body select {
  background: #0a0e15;
  color: var(--sched-text);
  border: 1px solid var(--sched-border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  font-family: var(--font-mono, monospace);
  width: 100%;
  color-scheme: dark;
}
.sv-modal-body input:focus,
.sv-modal-body textarea:focus,
.sv-modal-body select:focus {
  outline: none;
  border-color: var(--sched-accent);
  box-shadow: 0 0 0 3px var(--sched-accent-glow);
}
.sv-modal-body input.is-invalid,
.sv-modal-body textarea.is-invalid {
  border-color: var(--sched-red);
}
.sv-modal-body .field-hint {
  font-size: 0.7rem;
  color: var(--sched-text-faint);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.sv-modal-body textarea { resize: vertical; min-height: 70px; }
.sv-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ===== Slot details modal — request list ===== */
.req-list { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1rem; }
.req-card {
  background: var(--sched-bg-card);
  border: 1px solid var(--sched-border);
  border-left: 3px solid var(--sched-amber);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
}
.req-card.is-accepted { border-left-color: var(--sched-green); }
.req-card.is-declined { border-left-color: var(--sched-red); opacity: 0.55; }
.req-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.35rem;
}
.req-team {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--sched-text);
}
.req-meta {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  font-size: 0.72rem; color: var(--sched-text-mute);
  margin-bottom: 0.4rem;
}
.req-meta .chip {
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.62rem;
}
.req-msg {
  font-size: 0.82rem;
  color: var(--sched-text-mute);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--sched-border-hi);
}
.req-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.req-whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--sched-green);
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 600;
}
.req-whatsapp-link:hover { text-decoration: underline; }

/* ===== Status badges (used in tooltips, lists) ===== */
.status-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sched-border);
  color: var(--sched-text-mute);
}
.status-badge.status-open { background: rgba(0, 229, 255, 0.1); color: var(--sched-accent); border-color: rgba(0, 229, 255, 0.35); }
.status-badge.status-pending,
.status-badge.status-requested { background: rgba(245, 158, 11, 0.1); color: var(--sched-amber); border-color: rgba(245, 158, 11, 0.35); }
.status-badge.status-confirmed,
.status-badge.status-accepted { background: rgba(34, 197, 94, 0.1); color: var(--sched-green); border-color: rgba(34, 197, 94, 0.35); }
.status-badge.status-declined,
.status-badge.status-cancelled { background: rgba(230, 57, 70, 0.08); color: var(--sched-red); border-color: rgba(230, 57, 70, 0.3); }

/* ===== Empty / error state ===== */
.sv-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--sched-bg-card);
  border: 1px dashed var(--sched-border);
  border-radius: var(--sched-radius);
}
.sv-empty-icon { font-size: 2.5rem; margin-bottom: 0.6rem; opacity: 0.85; }
.sv-empty-title {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sched-text);
  margin-bottom: 0.35rem;
}
.sv-empty-desc { font-size: 0.85rem; color: var(--sched-text-mute); max-width: 380px; margin: 0 auto 1.1rem; line-height: 1.5; }
.sv-empty-cta {
  background: var(--sched-accent);
  color: #0a0a0a;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 7px;
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ===== Public agenda page (/a/<slug>) ===== */
.public-agenda {
  min-height: 100vh;
  background: var(--sched-bg);
  color: var(--sched-text);
  font-family: var(--font-ui, 'Inter', sans-serif);
  padding: 0;
  margin: 0;
}
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sched-border);
  flex-wrap: wrap;
}
.public-team-name {
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sched-text);
}
.public-team-tagline {
  font-size: 0.78rem;
  color: var(--sched-text-mute);
  margin-top: 0.15rem;
}
.public-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading, 'Barlow Condensed', sans-serif);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sched-text-faint);
  text-decoration: none;
}
.public-brand:hover { color: var(--sched-accent); }
.public-brand .brand-accent { color: var(--sched-rose); }

.public-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}
.public-cta-banner {
  background: linear-gradient(140deg, rgba(0, 229, 255, 0.08) 0%, rgba(251, 113, 133, 0.06) 100%);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--sched-radius);
  padding: 0.85rem 1rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.public-cta-text {
  font-size: 0.88rem;
  color: var(--sched-text);
  line-height: 1.45;
}
.public-cta-text strong { color: var(--sched-accent); }

/* Mobile tweaks */
@media (max-width: 760px) {
  .cal-grid { grid-auto-rows: 32px; grid-template-columns: 50px repeat(7, 1fr); }
  .cal-day-head { font-size: 0.66rem; }
  .cal-day-head .day-num { font-size: 0.92rem; }
  .cal-slot { padding: 0.2rem 0.35rem; }
  .cal-slot-title { font-size: 0.72rem; }
  .cal-slot-time { font-size: 0.62rem; }
  .cal-slot-meta { display: none; }
  .cal-toolbar { padding: 0.55rem 0.65rem; }
  .cal-share-link { font-size: 0.7rem; padding: 0.35rem 0.55rem; }
}
