/* App shell styles — screens, nav, cards */

/* Loading spinner */
.app-loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.app-loading .proximity-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,107,53,0.18);
  animation: pulse-ring 2s ease-in-out infinite;
}

.app-loading .ring-1 { width: 180px; height: 180px; animation-delay: 0s; }
.app-loading .ring-2 { width: 110px; height: 110px; border-color: rgba(255,107,53,0.3); animation-delay: 0.3s; }
.app-loading .ring-3 { width: 50px; height: 50px; border-color: rgba(255,107,53,0.5); animation-delay: 0.6s; }

@keyframes pulse-ring {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

/* App wrapper */
#app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── NAV BAR ── */
.app-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7,9,12,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.02em;
  text-decoration: none;
  cursor: pointer;
}

.nav-brand span { color: var(--accent); }

.nav-tabs {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-tab:hover { color: var(--fg); background: var(--surface-alt); }
.nav-tab.active { color: var(--accent); background: var(--accent-dim); }

.nav-actions { display: flex; gap: 8px; }

/* ── SCREEN WRAPPER ── */
.screen {
  flex: 1;
  padding-top: 56px;
  min-height: 100vh;
}

/* ── AUTH SCREENS ── */
.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--fg-muted); }

textarea.form-input { resize: vertical; min-height: 80px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) { opacity: 0.88; }

.btn-secondary {
  background: var(--surface-alt);
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { background: #181d27; }

.btn-ghost {
  background: none;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.15); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

.auth-alt {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.auth-alt a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

.error-msg {
  color: #f87171;
  font-size: 0.85rem;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 6px;
}

/* ── AVAILABILITY SCREEN ── */
.avail-screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px;
}

.screen-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.screen-subtitle {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.window-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.window-option {
  background: var(--surface-alt);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.window-option:hover { border-color: rgba(255,107,53,0.35); }
.window-option.selected { border-color: var(--accent); background: var(--accent-dim); }

.window-icon { font-size: 1.6rem; margin-bottom: 8px; }

.window-label {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fg);
}

.window-desc {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 4px;
}

.active-post-banner {
  background: var(--accent-dim);
  border: 1px solid rgba(255,107,53,0.3);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.active-post-info { flex: 1; }

.active-post-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.active-post-text { font-size: 0.9rem; color: var(--fg); }

/* ── DISCOVER SCREEN ── */
.discover-screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px;
}

.discover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.discover-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}

/* Profile card */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  animation: card-in 0.25s ease;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-photo {
  width: 100%;
  height: 260px;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-placeholder {
  font-size: 4rem;
  opacity: 0.3;
}

.profile-distance {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(7,9,12,0.8);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.profile-window-badge {
  position: absolute;
  top: 12px; left: 12px;
  border-radius: 20px;
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.badge-now { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.badge-tonight { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.badge-week { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

.profile-body { padding: 24px; }

.profile-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.profile-bio {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

.profile-note {
  font-size: 0.85rem;
  color: var(--fg);
  font-style: italic;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  margin-bottom: 16px;
}

.swipe-actions {
  display: flex;
  gap: 16px;
  padding: 0 24px 24px;
}

.btn-pass {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 8px;
  padding: 14px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-pass:hover { border-color: #f87171; color: #f87171; }

.btn-like {
  flex: 2;
  background: var(--accent);
  border: none;
  color: #fff;
  border-radius: 8px;
  padding: 14px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: opacity 0.15s;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-like:hover { opacity: 0.85; }

.empty-discover {
  text-align: center;
  padding: 60px 24px;
}

.empty-discover .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-discover h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-discover p { color: var(--fg-muted); font-size: 0.9rem; }

/* ── MATCH NOTIFICATION ── */
.match-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,9,12,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.match-modal {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 48px 36px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: slide-up 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.match-icon { font-size: 3.5rem; margin-bottom: 16px; }

.match-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.match-subtitle { color: var(--fg-muted); font-size: 0.95rem; margin-bottom: 8px; }

.match-public-note {
  font-size: 0.85rem;
  color: var(--fg-muted);
  padding: 12px 16px;
  background: var(--accent-dim);
  border-radius: 8px;
  margin: 16px 0 24px;
  line-height: 1.5;
}

.match-public-note strong { color: var(--accent); }

/* ── MATCHES LIST SCREEN ── */
.matches-screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px;
}

.match-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.match-item:hover { border-color: rgba(255,107,53,0.3); background: var(--surface-alt); }

.match-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface-alt);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}

.match-avatar img { width: 100%; height: 100%; object-fit: cover; }

.match-info { flex: 1; min-width: 0; }

.match-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.match-meta {
  font-size: 0.82rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.met-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 10px;
  padding: 2px 8px;
  letter-spacing: 0.05em;
}

.empty-matches {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-matches h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 16px 0 8px;
  color: var(--fg);
}

/* ── CHAT SCREEN ── */
.chat-screen {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px);
  max-width: 700px;
  margin: 0 auto;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  flex-shrink: 0;
}

.chat-back {
  background: none;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}

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

.chat-user-info { flex: 1; }

.chat-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.chat-meta { font-size: 0.8rem; color: var(--fg-muted); }

.public-meetup-prompt {
  background: var(--accent-dim);
  border-bottom: 1px solid rgba(255,107,53,0.2);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--fg);
  flex-shrink: 0;
}

.public-meetup-prompt strong { color: var(--accent); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}

.msg-wrapper.me { align-self: flex-end; align-items: flex-end; }
.msg-wrapper.them { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

.msg-wrapper.me .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-wrapper.them .msg-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--fg-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 18px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus { border-color: rgba(255,107,53,0.5); }
.chat-input::placeholder { color: var(--fg-muted); }

.btn-send {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.btn-send:hover { opacity: 0.85; }

/* ── PROFILE SETUP SCREEN ── */
.profile-screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ── LOCATION PERMISSION ── */
.location-prompt {
  text-align: center;
  padding: 60px 24px;
  max-width: 400px;
  margin: 0 auto;
}

.location-icon { font-size: 3rem; margin-bottom: 20px; }

.location-prompt h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.location-prompt p {
  color: var(--fg-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 0.88rem;
  color: var(--fg);
  animation: toast-in 0.25s ease;
  max-width: 280px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast.toast-success { border-color: rgba(34,197,94,0.4); color: #4ade80; }
.toast.toast-error { border-color: rgba(248,113,113,0.4); color: #f87171; }

/* ── MISC ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .nav-tabs { gap: 4px; }
  .nav-tab { padding: 6px 10px; font-size: 0.65rem; }
  .window-options { grid-template-columns: 1fr; }
  .profile-photo { height: 220px; }
  .auth-card { padding: 28px 20px; }
  .match-modal { padding: 36px 24px; }
}
