/* ══════════════════════════════════════════
   Arcana @ Harvard — App Styles (Crimson Edition)
   ══════════════════════════════════════════ */

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

:root {
  --bg: #1a0a10;
  --surface: #1e1018;
  --surface-2: #281520;
  --surface-3: #351a2a;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #f0f0f5;
  --text-muted: #9a8a8e;
  --text-dim: #6a5a5e;
  --accent: #A51C30;
  --accent-2: #C4203A;
  --accent-3: #F0D6A7;
  --accent-glow: rgba(165,28,48,0.15);
  --harvard: #A51C30;
  --gradient: linear-gradient(135deg, #A51C30 0%, #C4203A 50%, #F0D6A7 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(165,28,48,0.08) 0%, rgba(240,214,167,0.08) 100%);
  --success: #34d399;
  --success-bg: rgba(52,211,153,0.1);
  --warning: #fbbf24;
  --danger: #f87171;
  --danger-bg: rgba(248,113,113,0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
  --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Ambient Background ── */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.ambient::before {
  content: '';
  position: absolute;
  width: 800px; height: 800px;
  top: -200px; right: -200px;
  background: radial-gradient(circle, rgba(165,28,48,0.06) 0%, transparent 70%);
  animation: drift 20s ease-in-out infinite alternate;
}
.ambient::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  bottom: -100px; left: -100px;
  background: radial-gradient(circle, rgba(240,214,167,0.05) 0%, transparent 70%);
  animation: drift 25s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}

/* ── App Layout ── */
.app-container {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── Top Nav ── */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(26,10,16,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}
.app-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%;
}
.app-logo {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.app-logo span { opacity: 0.5; font-weight: 400; -webkit-text-fill-color: var(--text-muted); }
.app-nav-tabs { display: flex; gap: 4px; }
.app-nav-tab {
  padding: 8px 16px; border-radius: 8px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all var(--transition);
  background: none; border: none; font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.app-nav-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.app-nav-tab.active { color: var(--accent); background: var(--accent-glow); }
.app-nav-tab .tab-icon { font-size: 1rem; }
.app-nav-user {
  display: flex; align-items: center; gap: 12px;
}
.app-nav-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700; color: #fff; cursor: pointer;
  transition: all var(--transition);
}
.app-nav-avatar:hover { transform: scale(1.05); box-shadow: 0 0 20px var(--accent-glow); }

/* ── Main Content ── */
.app-main {
  flex: 1; padding: 88px 24px 40px;
  max-width: 1200px; margin: 0 auto; width: 100%;
}

/* ── Views (tab content) ── */
.app-view { display: none; animation: fadeIn 0.3s ease; }
.app-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 50px; font-size: 0.9rem;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: all var(--transition); border: none; font-family: inherit;
  line-height: 1;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 4px 24px rgba(165,28,48,0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(165,28,48,0.35);
}
.btn-primary:disabled {
  opacity: 0.5; cursor: not-allowed; transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-hover);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); }
.btn-sm { padding: 8px 18px; font-size: 0.8rem; }
.btn-success { background: var(--success); color: #1a0a10; }
.btn-success:hover { background: #2dd4a0; transform: translateY(-1px); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 1.1rem; cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--text); border-color: var(--border-hover); background: var(--surface-3); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s ease;
}
.card:hover {
  border-color: rgba(165,28,48,0.12);
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.card-title { font-size: 1.15rem; font-weight: 600; }

/* ── Auth Screens ── */
.auth-container {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 64px); padding: 40px 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px;
  max-width: 460px; width: 100%;
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(165,28,48,0.03) 0%, rgba(240,214,167,0.03) 100%);
  pointer-events: none;
}
.auth-card > * { position: relative; }
.auth-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--gradient-subtle); border: 1px solid rgba(165,28,48,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin-bottom: 24px;
}
.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 700; margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.auth-subtitle {
  color: var(--text-muted); font-size: 0.95rem; margin-bottom: 32px;
  line-height: 1.6;
}
.auth-step-indicator {
  display: flex; gap: 8px; margin-bottom: 32px;
}
.auth-step-dot {
  width: 32px; height: 4px; border-radius: 2px;
  background: var(--surface-3); transition: all 0.3s;
}
.auth-step-dot.active { background: var(--accent); width: 48px; }
.auth-step-dot.done { background: var(--success); }

/* ── Form Elements ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.form-input {
  width: 100%; padding: 14px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text);
  font-family: inherit; font-size: 0.95rem;
  outline: none; transition: all var(--transition);
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus { border-color: rgba(165,28,48,0.4); background: rgba(255,255,255,0.06); }
.form-input.error { border-color: var(--danger); }
.form-hint {
  font-size: 0.78rem; color: var(--text-dim); margin-top: 6px;
}
.form-error {
  font-size: 0.78rem; color: var(--danger); margin-top: 6px;
  display: none;
}
.form-error.show { display: block; }
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-select {
  width: 100%; padding: 14px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text);
  font-family: inherit; font-size: 0.95rem;
  outline: none; transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10L6 8z' fill='%239a8a8e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.form-select:focus { border-color: rgba(165,28,48,0.4); }
.form-select option { background: var(--surface-2); color: var(--text); }

/* Verification code input */
.code-input-group {
  display: flex; gap: 10px; justify-content: center; margin: 24px 0;
}
.code-digit {
  width: 52px; height: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text); font-size: 1.5rem; font-weight: 700;
  text-align: center; outline: none;
  transition: all var(--transition);
  font-family: inherit;
}
.code-digit:focus { border-color: var(--accent); background: rgba(165,28,48,0.06); }

/* ── Chat Interface ── */
.chat-container {
  display: flex; flex-direction: column;
  height: calc(100vh - 128px);
  max-width: 720px; margin: 0 auto;
}
.chat-header {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.chat-agent-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.chat-agent-info h3 { font-size: 1rem; font-weight: 600; }
.chat-agent-info p { font-size: 0.8rem; color: var(--text-muted); }
.chat-status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--success);
  margin-right: 6px; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 0;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 2px; }

.chat-msg {
  display: flex; gap: 12px; max-width: 85%;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg.agent { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
}
.chat-msg.agent .chat-msg-avatar { background: var(--gradient); }
.chat-msg.user .chat-msg-avatar { background: var(--surface-3); }
.chat-msg-bubble {
  padding: 12px 18px; border-radius: 16px;
  font-size: 0.92rem; line-height: 1.6;
}
.chat-msg.agent .chat-msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-bubble {
  background: rgba(165,28,48,0.12);
  border: 1px solid rgba(165,28,48,0.2);
  border-bottom-right-radius: 4px;
}

.chat-typing {
  display: flex; gap: 12px; align-self: flex-start;
  max-width: 85%; animation: msgIn 0.3s ease;
}
.chat-typing .chat-msg-avatar { background: var(--gradient); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.chat-typing .typing-dots {
  padding: 14px 20px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex; gap: 5px; align-items: center;
}
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dim);
  animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-quick-replies {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 0; animation: msgIn 0.3s ease;
}
.chat-quick-reply {
  padding: 8px 16px; border-radius: 20px;
  border: 1px solid rgba(165,28,48,0.2);
  background: rgba(165,28,48,0.06);
  color: var(--accent); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.chat-quick-reply:hover {
  background: rgba(165,28,48,0.15);
  border-color: rgba(165,28,48,0.35);
  transform: translateY(-1px);
}

.chat-input-area {
  display: flex; gap: 12px; padding: 16px 0;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; padding: 14px 18px;
  border-radius: 24px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text); font-family: inherit; font-size: 0.92rem;
  outline: none; transition: all var(--transition);
  resize: none; min-height: 48px; max-height: 120px;
}
.chat-input::placeholder { color: var(--text-dim); }
.chat-input:focus { border-color: rgba(165,28,48,0.3); }
.chat-send {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gradient); border: none;
  color: #fff; font-size: 1.2rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.chat-send:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(165,28,48,0.3); }
.chat-send:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

/* ── Match Dashboard ── */
.matches-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 32px;
}
.matches-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; font-weight: 700;
}
.matches-week-label {
  font-size: 0.85rem; color: var(--text-muted);
  background: var(--surface-2); padding: 6px 14px;
  border-radius: 20px; border: 1px solid var(--border);
}
.matches-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 20px;
}
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
}
.match-card:hover {
  border-color: rgba(165,28,48,0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.match-card.accepted {
  border-color: rgba(52,211,153,0.3);
}
.match-card.passed {
  opacity: 0.5;
}
.match-card-inner {
  padding: 28px;
}
.match-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
.match-profile {
  display: flex; align-items: center; gap: 16px;
}
.match-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gradient-subtle); border: 2px solid rgba(165,28,48,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.match-name {
  font-size: 1.15rem; font-weight: 600;
}
.match-name.hidden {
  filter: blur(6px); user-select: none;
}
.match-dept {
  font-size: 0.82rem; color: var(--text-muted); margin-top: 2px;
}
.match-score {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.match-score-ring {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700;
  position: relative;
}
.match-score-ring svg {
  position: absolute; inset: 0;
  transform: rotate(-90deg);
}
.match-score-ring circle {
  fill: none; stroke-width: 3;
}
.match-score-ring .bg { stroke: var(--surface-3); }
.match-score-ring .fg {
  stroke: url(#scoreGradient);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.match-score-label {
  font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-reason {
  background: var(--gradient-subtle);
  border: 1px solid rgba(165,28,48,0.1);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}
.match-reason-title {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px;
}
.match-reason p {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.6;
}

.match-convo {
  margin-bottom: 20px;
}
.match-convo-title {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 12px;
}
.match-convo-exchange {
  display: flex; flex-direction: column; gap: 8px;
}
.match-convo-msg {
  padding: 10px 14px; border-radius: 12px;
  font-size: 0.82rem; line-height: 1.5; max-width: 80%;
}
.match-convo-msg.a {
  background: var(--surface-2); border: 1px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.match-convo-msg.b {
  background: rgba(240,214,167,0.08); border: 1px solid rgba(240,214,167,0.15);
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.match-convo-label {
  font-size: 0.68rem; color: var(--text-dim); margin-bottom: 3px;
  font-weight: 600;
}

.match-actions {
  display: flex; gap: 12px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.match-btn {
  flex: 1; padding: 12px; border-radius: 12px;
  border: none; font-family: inherit; font-size: 0.88rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.match-btn-accept {
  background: rgba(52,211,153,0.1); color: var(--success);
  border: 1px solid rgba(52,211,153,0.2);
}
.match-btn-accept:hover { background: rgba(52,211,153,0.18); transform: translateY(-1px); }
.match-btn-pass {
  background: rgba(255,255,255,0.04); color: var(--text-muted);
  border: 1px solid var(--border);
}
.match-btn-pass:hover { background: rgba(255,255,255,0.08); }
.match-btn-disabled {
  opacity: 0.5; cursor: not-allowed;
}

/* Match mutual accept reveal */
.match-reveal {
  background: rgba(52,211,153,0.06);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius-sm);
  padding: 20px; margin-top: 16px;
  text-align: center;
}
.match-reveal h4 {
  color: var(--success); font-size: 0.95rem; margin-bottom: 8px;
}
.match-reveal p { font-size: 0.85rem; color: var(--text-muted); }
.match-reveal .date-spot {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px; padding: 8px 16px;
  background: rgba(52,211,153,0.1); border-radius: 20px;
  font-size: 0.82rem; color: var(--success); font-weight: 500;
}

/* ── Empty States ── */
.empty-state {
  text-align: center; padding: 80px 24px;
}
.empty-icon {
  font-size: 3rem; margin-bottom: 16px; opacity: 0.6;
}
.empty-state h3 {
  font-size: 1.2rem; font-weight: 600; margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-muted); font-size: 0.9rem; max-width: 400px; margin: 0 auto;
}

/* ── Profile View ── */
.profile-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.profile-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.profile-card.full { grid-column: 1 / -1; }
.profile-card-title {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.profile-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.profile-tag {
  padding: 6px 14px; border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-muted);
}
.profile-tag.highlight {
  border-color: rgba(165,28,48,0.2);
  background: rgba(165,28,48,0.06);
  color: var(--accent);
}
.profile-stat {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.profile-stat:last-child { border-bottom: none; }
.profile-stat-label { font-size: 0.88rem; color: var(--text-muted); }
.profile-stat-value { font-size: 0.88rem; font-weight: 600; }

/* ── Settings ── */
.settings-section {
  margin-bottom: 32px;
}
.settings-section-title {
  font-size: 1.1rem; font-weight: 600; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.setting-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0;
}
.setting-item + .setting-item { border-top: 1px solid var(--border); }
.setting-info h4 { font-size: 0.95rem; font-weight: 500; }
.setting-info p { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Toggle Switch */
.toggle {
  width: 48px; height: 26px; border-radius: 13px;
  background: var(--surface-3); border: none;
  position: relative; cursor: pointer;
  transition: all var(--transition);
}
.toggle::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition);
}
.toggle.active { background: var(--accent); }
.toggle.active::after { left: 25px; background: #fff; }

/* ── Date Spots ── */
.spots-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px; margin-top: 24px;
}
.spot-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.3s ease;
}
.spot-card:hover {
  border-color: rgba(165,28,48,0.15);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.spot-image {
  height: 160px; background: var(--gradient-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.spot-info { padding: 20px; }
.spot-name { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.spot-type { font-size: 0.78rem; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.spot-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }
.spot-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.spot-tag {
  padding: 3px 10px; border-radius: 12px;
  background: var(--surface-2); font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── Modal / Overlay ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px;
  max-width: 500px; width: 100%;
  transform: scale(0.95); transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; }
.modal-text { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Toast Notification ── */
.toast-container {
  position: fixed; top: 80px; right: 24px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px;
  font-size: 0.88rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  max-width: 360px;
}
.toast.success { border-color: rgba(52,211,153,0.3); }
.toast.error { border-color: rgba(248,113,113,0.3); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(40px); } }

/* ── Loading Spinner ── */
.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress Bar ── */
.progress-bar {
  height: 4px; border-radius: 2px;
  background: var(--surface-3); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: var(--gradient);
  transition: width 0.5s ease;
}

/* ── SVG Defs (hidden) ── */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Light Theme ── */
[data-theme="light"] {
  --bg: #f5f0f2;
  --surface: #ffffff;
  --surface-2: #f0eaed;
  --surface-3: #e5dce0;
  --border: rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.15);
  --text: #1a0a10;
  --text-muted: #6a5a5e;
  --text-dim: #9a8a8e;
  --accent-glow: rgba(165,28,48,0.08);
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}
[data-theme="light"] body { background: var(--bg); color: var(--text); }
[data-theme="light"] .ambient::before { background: radial-gradient(circle, rgba(165,28,48,0.04) 0%, transparent 70%); }
[data-theme="light"] .ambient::after { background: radial-gradient(circle, rgba(240,214,167,0.06) 0%, transparent 70%); }
[data-theme="light"] .app-nav { background: rgba(245,240,242,0.9); }
[data-theme="light"] .mobile-nav { background: rgba(245,240,242,0.95); }
[data-theme="light"] .toast { background: var(--surface); }
[data-theme="light"] .chat-msg.agent .chat-msg-bubble { background: var(--surface-2); color: var(--text); }
[data-theme="light"] .chat-msg.user .chat-msg-bubble { background: rgba(165,28,48,0.08); color: var(--text); }

/* ── Theme Toggle ── */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer; transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--surface-3); transform: scale(1.1); }

/* ── Avatar Camera Overlay ── */
.avatar-camera-overlay {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; border: 2px solid var(--surface);
  opacity: 0; transition: opacity 0.2s;
}
.avatar-photo:hover .avatar-camera-overlay,
div[onclick="triggerPhotoUpload()"]:hover .avatar-camera-overlay {
  opacity: 1;
}

/* ── Conversation Toggle ── */
.convo-collapsed {
  max-height: 90px; overflow: hidden; position: relative;
  transition: max-height 0.4s ease;
}
.convo-collapsed::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 40px;
  background: linear-gradient(transparent, var(--surface));
  pointer-events: none;
}
.convo-expanded {
  max-height: 2000px; overflow: visible;
  transition: max-height 0.4s ease;
}
.convo-expanded::after { display: none; }
.convo-toggle-btn {
  display: block; width: 100%; margin-top: 8px; padding: 8px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--accent); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.convo-toggle-btn:hover { background: rgba(165,28,48,0.06); border-color: rgba(165,28,48,0.2); }

/* ── Match Filter Bar ── */
.match-filter-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  padding: 6px 16px; border-radius: 20px; font-size: 0.82rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.filter-tab:hover { color: var(--text); border-color: var(--border-hover); }
.filter-tab.active { background: rgba(165,28,48,0.12); border-color: rgba(165,28,48,0.3); color: var(--accent); }
.sort-options { display: flex; gap: 4px; }
.sort-option {
  padding: 6px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 500;
  background: none; border: 1px solid transparent;
  color: var(--text-dim); cursor: pointer; transition: all var(--transition);
  font-family: inherit;
}
.sort-option:hover { color: var(--text-muted); }
.sort-option.active { color: var(--text-muted); border-color: var(--border); }

/* ── Match Card Staggered Animation ── */
.match-card-animate {
  opacity: 0;
  transform: translateY(20px);
  animation: matchCardIn 0.5s ease forwards;
}
@keyframes matchCardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-nav-tabs { display: none; }
  .app-main { padding-top: 80px; }
  .auth-card { padding: 32px 24px; }
  .match-top { flex-direction: column; gap: 16px; }
  .match-actions { flex-direction: column; }
  .profile-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .chat-container { height: calc(100vh - 100px); }
  .spots-grid { grid-template-columns: 1fr; }
  .match-filter-bar { flex-direction: column; align-items: flex-start; }
  .filter-tabs { flex-wrap: wrap; }
}

/* ── Mobile Bottom Nav ── */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(26,10,16,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  z-index: 100; padding: 8px 0;
  padding-bottom: env(safe-area-inset-bottom, 8px);
}
.mobile-nav-inner {
  display: flex; justify-content: space-around; align-items: center;
}
.mobile-nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 8px 12px;
  color: var(--text-dim); font-size: 0.65rem; font-weight: 500;
  cursor: pointer; transition: color var(--transition);
  background: none; border: none; font-family: inherit;
}
.mobile-nav-item .nav-icon { font-size: 1.2rem; }
.mobile-nav-item.active { color: var(--accent); }

@media (max-width: 768px) {
  .mobile-nav { display: block; }
  .app-main { padding-bottom: 100px; }
}
