/* ============================================================
   LoveRush – Design System
   Dark modern dating-app theme
   ============================================================ */

/* ---- Variables ------------------------------------------- */
:root {
  --bg-base:        #0d0d0f;
  --bg-surface:     #16161a;
  --bg-card:        #1e1e24;
  --bg-input:       #252530;
  --border:         #2e2e3a;
  --border-focus:   #e0306a;

  --accent:         #e0306a;
  --accent-hover:   #c42558;
  --accent-light:   rgba(224, 48, 106, 0.15);

  --like-color:     #e0306a;
  --skip-color:     #4a4a5a;

  --text-primary:   #f0f0f5;
  --text-secondary: #9090a8;
  --text-muted:     #5a5a72;

  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      22px;
  --radius-full:    9999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,.35);
  --shadow-md:  0 6px 24px rgba(0,0,0,.5);
  --shadow-lg:  0 12px 48px rgba(0,0,0,.65);

  --transition: 0.18s ease;
  --font:       'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Reset ------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ---- Layout ---------------------------------------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  display: none;
  flex: 1;
  padding: 0 0 80px;
}
.page.active { display: flex; flex-direction: column; }

/* ---- Navigation ------------------------------------------ */
.nav-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding: 0 8px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  transition: color var(--transition);
  min-width: 56px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active, .nav-item:hover { color: var(--accent); }

/* ---- Top Header ------------------------------------------ */
.top-header {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.logo-text { color: var(--accent); }

/* ---- Auth Pages ------------------------------------------ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1px;
}
.auth-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

/* ---- Form Elements --------------------------------------- */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 14px;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; }

/* ---- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  border: none;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 14px;
}
.btn-ghost:hover { color: var(--text-primary); }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ---- Alert / Error --------------------------------------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-error   { background: rgba(224,48,106,.12); border: 1px solid rgba(224,48,106,.3); color: #ff6b9d; }
.alert-success { background: rgba(34,197,94,.12);  border: 1px solid rgba(34,197,94,.3);  color: #4ade80; }

/* ---- Swipe Card ------------------------------------------ */
.swipe-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 20px;
  gap: 20px;
}
.swipe-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
  aspect-ratio: 3/4;
  user-select: none;
}
.swipe-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.swipe-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 64px;
}
.swipe-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
}
.swipe-card-name {
  font-size: 22px;
  font-weight: 700;
}
.swipe-card-meta {
  font-size: 14px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
}
.swipe-card-bio {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Swipe action overlay */
.swipe-overlay {
  position: absolute;
  top: 20px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}
.swipe-overlay.like  { left: 20px;  border: 3px solid #4ade80; color: #4ade80; }
.swipe-overlay.skip  { right: 20px; border: 3px solid #f87171; color: #f87171; }

/* Swipe buttons */
.swipe-actions {
  display: flex;
  gap: 24px;
  align-items: center;
}
.swipe-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.swipe-btn:active { transform: scale(.9); }
.swipe-btn-skip  { background: var(--bg-card); color: #f87171; }
.swipe-btn-like  { background: var(--accent); color: #fff; width: 72px; height: 72px; font-size: 30px; }
.swipe-btn-skip:hover  { box-shadow: 0 0 0 3px rgba(248,113,113,.3); }
.swipe-btn-like:hover  { box-shadow: 0 0 0 3px var(--accent-light); }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state .icon { font-size: 52px; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); }
.empty-state p  { font-size: 14px; }

/* ---- Match notification ---------------------------------- */
.match-toast {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.match-toast.show { opacity: 1; pointer-events: all; }
.match-toast-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  max-width: 340px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.match-toast-icon { font-size: 52px; margin-bottom: 12px; }
.match-toast h2   { font-size: 26px; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.match-toast p    { color: var(--text-secondary); font-size: 15px; margin-bottom: 24px; }

/* ---- Matches List ---------------------------------------- */
.matches-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.match-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.match-card:hover { border-color: var(--accent); }
.match-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-input);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-muted);
  overflow: hidden;
}
.match-avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-info { flex: 1; min-width: 0; }
.match-name { font-weight: 600; font-size: 15px; }
.match-sub  { font-size: 13px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* ---- Chat / Messages ------------------------------------- */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.chat-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  padding: 4px;
}
.chat-back:hover { color: var(--text-primary); }
.chat-title { font-weight: 600; font-size: 16px; }

.chat-messages {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.chat-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.outbound {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.inbound {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}
.chat-bubble-time {
  font-size: 11px;
  opacity: .6;
  margin-top: 4px;
  text-align: right;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  bottom: 64px;
}
.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  padding: 10px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--border-focus); }
.chat-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.chat-send-btn:hover { background: var(--accent-hover); }

/* ---- Profile Page ---------------------------------------- */
.profile-page {
  padding: 20px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.profile-avatar-wrap {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  color: #fff;
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-sub  { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.profile-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.profile-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 14px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: var(--bg-input);
  cursor: pointer;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb-add {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-muted);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.photo-thumb-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-primary-badge {
  position: absolute;
  bottom: 4px; left: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ---- Coins Page ------------------------------------------ */
.coins-page {
  padding: 20px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}
.coins-balance {
  background: linear-gradient(135deg, var(--accent) 0%, #8b1a4a 100%);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 24px;
}
.coins-balance-amount {
  font-size: 48px;
  font-weight: 800;
  color: #fff;
}
.coins-balance-label {
  font-size: 14px;
  color: rgba(255,255,255,.75);
  margin-top: 4px;
}
.packages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.package-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition);
}
.package-card:hover { border-color: var(--accent); }
.package-coins { font-size: 28px; font-weight: 800; color: var(--accent); }
.package-name  { font-size: 13px; color: var(--text-secondary); margin: 4px 0; }
.package-price { font-size: 15px; font-weight: 600; }

/* ---- Spinner --------------------------------------------- */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utility --------------------------------------------- */
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ---- Responsive ------------------------------------------ */
@media (min-width: 480px) {
  .swipe-card { max-width: 420px; }
}
@media (min-width: 768px) {
  .nav-bar { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .page { max-width: 480px; margin: 0 auto; }
}
