/* ═══════════════════════════════════════════════
   AskMeBaby — Design System
   ═══════════════════════════════════════════════ */
:root {
  --bg:        #08080f;
  --surface:   #10101e;
  --surface2:  #18182e;
  --surface3:  #222240;
  --primary:   #e91e8c;
  --primary-d: #c4186e;
  --secondary: #7c3aed;
  --grad:      linear-gradient(135deg, #e91e8c, #7c3aed);
  --grad-r:    linear-gradient(135deg, #7c3aed, #e91e8c);
  --text:      #f0f0f8;
  --muted:     #7777a0;
  --border:    #25253a;
  --success:   #10b981;
  --danger:    #ef4444;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
  --glow-p:    0 0 24px rgba(233,30,140,0.4);
  --glow-s:    0 0 24px rgba(124,58,237,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Typography ─────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--glow-p);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 32px rgba(233,30,140,0.6); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface3); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: rgba(233,30,140,0.1); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
}
.btn-ghost:hover { color: var(--text); background: var(--surface2); }

.btn-lg { padding: 16px 36px; font-size: 17px; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-icon { padding: 10px; border-radius: 50%; width: 40px; height: 40px; justify-content: center; }

.btn-download {
  background: var(--grad);
  color: #fff;
  padding: 18px 48px;
  font-size: 18px;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 40px rgba(233,30,140,0.5), var(--glow-s);
  animation: pulse-glow 2s ease-in-out infinite;
}
.btn-download:hover { transform: translateY(-3px) scale(1.02); text-decoration: none; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(233,30,140,0.5), 0 0 40px rgba(124,58,237,0.3); }
  50%       { box-shadow: 0 0 60px rgba(233,30,140,0.7), 0 0 60px rgba(124,58,237,0.5); }
}

/* ── Forms ──────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-control {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,30,140,0.15);
}
.form-control::placeholder { color: var(--muted); }

select.form-control { cursor: pointer; }

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  margin-top: 2px;
}

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* ── Navbar ─────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,8,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-brand {
  font-size: 22px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--text);
  background: var(--surface2);
}
.navbar-nav a.active { color: var(--primary); }
.badge {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

/* ── Container ──────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 24px; }

/* ── Auth Pages ─────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, transparent 60%),
              radial-gradient(ellipse at 100% 100%, rgba(233,30,140,0.1) 0%, transparent 50%);
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-logo {
  font-size: 28px;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 32px; }
.auth-form { display: flex; flex-direction: column; gap: 20px; }
.auth-footer { text-align: center; margin-top: 24px; color: var(--muted); font-size: 14px; }

/* ── Landing ────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(233,30,140,0.2) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 70%, rgba(124,58,237,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; max-width: 720px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(233,30,140,0.15);
  border: 1px solid rgba(233,30,140,0.3);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 900; margin-bottom: 20px; }
.hero p { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--muted); margin-bottom: 40px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 60px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 13px; color: var(--muted); }

.section { padding: 80px 0; }
.section-title { font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: 16px; }
.section-sub { text-align: center; color: var(--muted); font-size: 1.1rem; margin-bottom: 60px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-icon {
  width: 56px; height: 56px;
  background: var(--grad);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.step { text-align: center; }
.step-num {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: var(--glow-p);
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 14px; }

.download-section {
  padding: 100px 0;
  text-align: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(233,30,140,0.12) 0%, transparent 70%);
}
.download-section h2 { font-size: 2.8rem; margin-bottom: 16px; }
.download-section p { color: var(--muted); font-size: 1.1rem; margin-bottom: 40px; }
.apk-meta { display: flex; gap: 24px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.apk-meta span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
footer strong { color: var(--primary); }

/* ── Profile Cards (Dashboard/Search) ───────────── */
.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.profile-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(233,30,140,0.15); }
.profile-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--surface2);
}
.profile-card-img.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--border);
}
.profile-card-body { padding: 16px; }
.profile-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.profile-card-meta { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.profile-card-bio { font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 12px; }
.profile-card-actions { display: flex; gap: 8px; }

.like-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.like-btn.liked {
  background: rgba(233,30,140,0.15);
  color: var(--primary);
  border: 1px solid rgba(233,30,140,0.3);
}
.like-btn.unliked {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.like-btn:hover { transform: scale(1.05); }

/* ── Filters ────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters-bar .form-group { flex: 1; min-width: 140px; }
.filters-bar .form-group label { font-size: 11px; }

/* ── Match/Chat Layout ──────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 64px);
  overflow: hidden;
}
.chat-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 700;
}
.match-list { overflow-y: auto; flex: 1; }
.match-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.match-item:hover, .match-item.active { background: var(--surface2); }
.match-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--muted);
  overflow: hidden;
}
.match-avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-info { flex: 1; overflow: hidden; }
.match-name { font-weight: 600; font-size: 15px; }
.match-last-msg { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-unread { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 14px;
}
.chat-header-info h3 { font-size: 16px; font-weight: 700; }
.chat-header-info span { font-size: 13px; color: var(--muted); }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.msg {
  display: flex;
  flex-direction: column;
  max-width: 65%;
}
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
}
.msg.mine .msg-bubble { background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs .msg-bubble { background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px; }
.msg-time { font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 4px; }
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  gap: 12px;
}
.chat-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.chat-input:focus { border-color: var(--primary); }
.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
  font-size: 16px;
}
.chat-empty-icon { font-size: 64px; }

/* ── Profile Page ───────────────────────────────── */
.profile-page { padding: 40px 24px; }
.profile-hero {
  display: flex;
  gap: 40px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.profile-avatar-wrap { position: relative; }
.profile-avatar {
  width: 160px; height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  border: 4px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 4px rgba(233,30,140,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--muted);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { flex: 1; }
.profile-name { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.profile-tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.tag.primary { background: rgba(233,30,140,0.15); border-color: rgba(233,30,140,0.3); color: var(--primary); }
.profile-bio { color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 20px; }
.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-top: 24px; }
.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface2);
  overflow: hidden;
  position: relative;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .delete-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239,68,68,0.8);
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}
.photo-thumb:hover .delete-photo { display: flex; }

/* ── Toast ──────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  max-width: 320px;
  animation: slideIn 0.3s ease;
  cursor: pointer;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--primary); color: #fff; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Match Popup ────────────────────────────────── */
.match-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.match-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 0 80px rgba(233,30,140,0.3);
}
.match-popup h2 { font-size: 2rem; margin-bottom: 8px; }
.match-popup p { color: var(--muted); margin-bottom: 32px; }
.match-popup-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Page header ────────────────────────────────── */
.page-header { padding: 32px 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.page-header h1 { font-size: 1.8rem; }

/* ── Empty state ────────────────────────────────── */
.empty-state { text-align: center; padding: 80px 24px; color: var(--muted); }
.empty-state-icon { font-size: 64px; margin-bottom: 20px; }
.empty-state h3 { font-size: 1.3rem; color: var(--text); margin-bottom: 10px; }
.empty-state p { font-size: 14px; margin-bottom: 24px; }

/* ── Spinner ────────────────────────────────────── */
.spinner { display: inline-block; width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; justify-content: center; padding: 60px; }

/* ── Divider ────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-sidebar.show { display: flex; }
  .auth-box { padding: 32px 24px; }
  .profile-hero { flex-direction: column; }
  .hero h1 { font-size: 2.2rem; }
}
