/* ============================================================
   SPARK DATING APP — dating.css
   Dark theme, mobile-first, Tantan-inspired
   ============================================================ */

/* ── Custom Properties ───────────────────────────────────── */
:root {
  --pink:           #FD297B;
  --coral:          #FF655B;
  --gradient:       linear-gradient(135deg, #FD297B 0%, #FF655B 100%);
  --gradient-rev:   linear-gradient(135deg, #FF655B 0%, #FD297B 100%);
  --bg:             #0F0F1A;
  --bg-card:        #1A1A2E;
  --bg-surface:     #252540;
  --bg-input:       #1E1E35;
  --border:         rgba(255,255,255,0.08);
  --text:           #FFFFFF;
  --text-secondary: #A0A0C0;
  --text-muted:     #606080;
  --like:           #2ECC71;
  --nope:           #E74C3C;
  --super:          #F39C12;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.5);
  --shadow-pink:    0 4px 24px rgba(253,41,123,0.35);
  --radius-sm:      8px;
  --radius-md:      16px;
  --radius-lg:      24px;
  --radius-xl:      32px;
  --radius-full:    9999px;
  --nav-height:     64px;
  --nav-width:      220px;
  --header-height:  60px;
  --transition:     0.2s ease;
  --transition-slow: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-surface);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── App Shell ───────────────────────────────────────────── */
.app-shell {
  position: relative;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

.page-content.no-nav {
  padding-bottom: 0;
}

/* ── App Header ──────────────────────────────────────────── */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header .logo {
  font-size: 22px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.app-header .header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
}

.icon-btn:hover, .icon-btn:active {
  background: var(--bg-card);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Page Header (Matches, Inbox) ────────────────────────── */
.page-header {
  padding: 20px 20px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-header .count-badge {
  background: var(--gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 24px;
  text-align: center;
}

/* ── Bottom Navigation (mobile) ──────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 0;
  gap: 4px;
  flex: 1;
  position: relative;
  color: var(--text-muted);
  transition: color var(--transition);
  min-height: var(--nav-height);
}

.nav-item svg {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-slow);
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-item.active {
  color: var(--pink);
}

.nav-item.active svg {
  transform: scale(1.15);
}

.nav-item .nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  background: var(--pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Left Sidebar (desktop) ──────────────────────────────── */
.sidebar-nav {
  display: none;
}

@media (min-width: 768px) {
  .app-shell {
    margin-left: var(--nav-width);
    max-width: 480px;
  }

  .bottom-nav {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--nav-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 28px 16px;
    z-index: 100;
    gap: 4px;
  }

  .sidebar-nav .sidebar-logo {
    font-size: 26px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 28px;
    padding: 0 8px;
    letter-spacing: -0.5px;
  }

  .sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
  }

  .sidebar-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .sidebar-item:hover {
    background: var(--bg-surface);
    color: var(--text);
  }

  .sidebar-item.active {
    background: rgba(253, 41, 123, 0.12);
    color: var(--pink);
  }

  .page-content {
    padding-bottom: 20px;
  }
}

/* ── Auth Page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px 16px;
}

.auth-blob {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  animation: blobPulse 8s ease-in-out infinite;
}

.auth-blob-1 {
  width: 360px;
  height: 360px;
  background: var(--pink);
  top: -80px;
  right: -80px;
}

.auth-blob-2 {
  width: 280px;
  height: 280px;
  background: var(--coral);
  bottom: -60px;
  left: -60px;
  animation-delay: -4s;
}

@keyframes blobPulse {
  0%, 100% { transform: scale(1) translate(0, 0); }
  33%       { transform: scale(1.1) translate(10px, -10px); }
  66%       { transform: scale(0.95) translate(-10px, 10px); }
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 28px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand .brand-logo {
  font-size: 40px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.auth-brand .brand-tagline {
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-tabs {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.auth-tab.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-pink);
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.active {
  display: flex;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(253, 41, 123, 0.15);
}

.gender-toggle {
  display: flex;
  gap: 10px;
}

.gender-btn {
  flex: 1;
  padding: 11px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}

.gender-btn.active,
.gender-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(253, 41, 123, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-pink);
  transition: opacity var(--transition), transform var(--transition);
  margin-top: 4px;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-primary:active {
  opacity: 0.85;
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-error {
  display: none;
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #ff6b6b;
  text-align: center;
}

.auth-error.show {
  display: block;
}

/* ── Discover / Swipe Page ───────────────────────────────── */
.discover-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.discover-page .app-header {
  flex-shrink: 0;
}

.card-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 8px;
  min-height: 0;
}

#card-stack {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 480px;
}

@media (max-height: 700px) {
  #card-stack {
    height: 380px;
  }
}

/* Profile card */
.profile-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  transform-origin: bottom center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.12s ease;
}

.profile-card:nth-child(2) {
  transform: scale(0.95) translateY(10px);
  z-index: 1;
}

.profile-card:nth-child(3) {
  transform: scale(0.90) translateY(20px);
  z-index: 0;
}

.profile-card:first-child {
  z-index: 3;
  transition: none;
}

.profile-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.profile-card.fly-right {
  animation: flyRight 0.5s ease-in forwards;
}

.profile-card.fly-left {
  animation: flyLeft 0.5s ease-in forwards;
}

.profile-card.snap-back {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translate(0, 0) rotate(0deg) !important;
}

.card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.card-photo-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-photo-placeholder svg {
  width: 80px;
  height: 80px;
  opacity: 0.3;
}

.card-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65%;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
  pointer-events: none;
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  pointer-events: none;
}

.card-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card-name .age {
  font-weight: 500;
  font-size: 22px;
}

.card-city {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tag {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}

/* Like / Nope indicators */
.card-indicator {
  position: absolute;
  top: 28px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border-width: 3px;
  border-style: solid;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
  opacity: 0;
  pointer-events: none;
  transform: rotate(-15deg);
  transition: opacity 0.1s ease;
}

.card-indicator.like {
  left: 20px;
  color: var(--like);
  border-color: var(--like);
  transform: rotate(-15deg);
}

.card-indicator.nope {
  right: 20px;
  color: var(--nope);
  border-color: var(--nope);
  transform: rotate(15deg);
}

.card-indicator.super {
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
  bottom: 100px;
  top: auto;
  color: var(--super);
  border-color: var(--super);
}

/* Action buttons */
.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px 16px;
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-slow), box-shadow var(--transition);
}

.action-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-lg);
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.action-btn svg {
  display: block;
}

#btn-rewind {
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--super);
}

#btn-rewind svg { width: 22px; height: 22px; }

#btn-nope {
  width: 64px;
  height: 64px;
  background: var(--bg-card);
  border: 2px solid rgba(231, 76, 60, 0.3);
  color: var(--nope);
}

#btn-nope svg { width: 28px; height: 28px; }

#btn-like {
  width: 64px;
  height: 64px;
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-pink);
}

#btn-like svg { width: 28px; height: 28px; }

#btn-super {
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border: 2px solid rgba(243, 156, 18, 0.3);
  color: var(--super);
}

#btn-super svg { width: 22px; height: 22px; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: var(--text-muted);
  text-align: center;
  padding: 32px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 14px;
  max-width: 240px;
}

/* ── Card Swipe Animations ───────────────────────────────── */
@keyframes flyRight {
  0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(150vw, -40px) rotate(30deg); opacity: 0; }
}

@keyframes flyLeft {
  0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(-150vw, -40px) rotate(-30deg); opacity: 0; }
}

@keyframes flyUp {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(0, -100vh) scale(0.8); opacity: 0; }
}

/* ── Match Overlay ───────────────────────────────────────── */
#match-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#match-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.match-title {
  font-size: 36px;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 8px;
  animation: matchTitlePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.match-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 36px;
}

.match-avatars {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 36px;
}

.match-avatar {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-full);
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--bg-surface);
  animation: matchAvatarBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.match-avatar:first-child {
  transform: translateX(20px);
  z-index: 1;
  animation-delay: 0.1s;
}

.match-avatar:last-child {
  transform: translateX(-20px);
  animation-delay: 0.2s;
}

.match-heart {
  position: absolute;
  font-size: 32px;
  animation: heartPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
  z-index: 2;
}

@keyframes matchTitlePop {
  0%   { transform: scale(0.5) translateY(30px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@keyframes matchAvatarBounce {
  0%   { transform: scale(0) translateX(0); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.match-avatar:first-child {
  animation-name: matchAvatarLeft;
}

.match-avatar:last-child {
  animation-name: matchAvatarRight;
}

@keyframes matchAvatarLeft {
  0%   { transform: translateX(-60px) scale(0); opacity: 0; }
  60%  { transform: translateX(22px) scale(1.05); opacity: 1; }
  100% { transform: translateX(20px) scale(1); opacity: 1; }
}

@keyframes matchAvatarRight {
  0%   { transform: translateX(60px) scale(0); opacity: 0; }
  60%  { transform: translateX(-22px) scale(1.05); opacity: 1; }
  100% { transform: translateX(-20px) scale(1); opacity: 1; }
}

@keyframes heartPop {
  0%   { transform: scale(0); opacity: 0; }
  80%  { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.match-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.btn-match-message {
  width: 100%;
  padding: 16px;
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-pink);
  transition: opacity var(--transition), transform var(--transition);
}

.btn-match-message:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-keep-swiping {
  width: 100%;
  padding: 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}

.btn-keep-swiping:hover {
  background: var(--bg-surface);
  color: var(--text);
}

/* ── Matches Page ────────────────────────────────────────── */
.matches-page .page-content {
  padding: 0 12px calc(var(--nav-height) + env(safe-area-inset-bottom) + 12px);
}

#matches-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 8px 0;
}

@media (min-width: 400px) {
  #matches-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.match-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  aspect-ratio: 3/4;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.match-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.match-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.match-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
}

.match-card-name {
  font-size: 14px;
  font-weight: 700;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-card-age {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.online-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: var(--like);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-card);
}

.match-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-card));
}

.match-card-placeholder svg {
  width: 40px;
  height: 40px;
  opacity: 0.3;
}

/* ── Inbox / Messages List ───────────────────────────────── */
.search-bar {
  margin: 0 16px 12px;
  position: relative;
}

.search-bar input {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 11px 16px 11px 42px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar input:focus {
  border-color: var(--pink);
}

.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

#inbox-list {
  display: flex;
  flex-direction: column;
}

.convo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.convo-item:hover {
  background: var(--bg-surface);
}

.convo-avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
  position: relative;
}

.convo-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.convo-avatar-wrap .online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg);
  top: auto;
  left: auto;
  right: 1px;
  bottom: 1px;
}

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

.convo-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.convo-last-msg {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.convo-last-msg.unread {
  color: var(--text-secondary);
  font-weight: 600;
}

.convo-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.convo-time {
  font-size: 11px;
  color: var(--text-muted);
}

.unread-badge {
  background: var(--gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── Chat Page ───────────────────────────────────────────── */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

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

.chat-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background var(--transition);
  flex-shrink: 0;
}

.chat-back-btn:hover {
  background: var(--bg-surface);
}

.chat-back-btn svg {
  width: 20px;
  height: 20px;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.chat-user-text {}

.chat-user-name {
  font-size: 15px;
  font-weight: 700;
  display: block;
}

.chat-user-status {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.chat-user-status.online {
  color: var(--like);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-break: break-word;
}

.msg-bubble.mine {
  align-self: flex-end;
  background: var(--gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-time {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.65;
  text-align: right;
}

.msg-bubble.theirs .msg-time {
  text-align: left;
}

.msg-date-divider {
  align-self: center;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin: 4px 0;
}

.chat-input-area {
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.chat-textarea {
  flex: 1;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 11px 16px;
  font-size: 14px;
  color: var(--text);
  resize: none;
  outline: none;
  max-height: 120px;
  min-height: 44px;
  transition: border-color var(--transition);
  line-height: 1.5;
}

.chat-textarea::placeholder {
  color: var(--text-muted);
}

.chat-textarea:focus {
  border-color: var(--pink);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  background: var(--gradient);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-pink);
  transition: opacity var(--transition), transform var(--transition);
}

.chat-send-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Profile Page ────────────────────────────────────────── */
.profile-cover {
  position: relative;
  height: 260px;
  background: var(--bg-card);
  overflow: hidden;
}

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

.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, var(--bg) 100%);
}

.profile-avatar-wrap {
  position: absolute;
  bottom: -44px;
  left: 20px;
  z-index: 2;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--bg-surface);
}

.edit-avatar-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: var(--gradient);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.edit-avatar-btn svg {
  width: 14px;
  height: 14px;
}

.profile-info-section {
  padding: 56px 20px 20px;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.profile-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.subscription-badge {
  background: var(--gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-secondary);
}

.meta-item svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.about-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}

.about-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

#photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 24px;
}

.photo-thumb {
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-surface);
  width: 100%;
  cursor: pointer;
  transition: opacity var(--transition);
}

.photo-thumb:hover {
  opacity: 0.85;
}

.btn-edit-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  transition: background var(--transition);
}

.btn-edit-profile:hover {
  background: var(--bg-card);
}

.btn-edit-profile svg {
  width: 18px;
  height: 18px;
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: rgba(231, 76, 60, 0.1);
  border: 1.5px solid rgba(231, 76, 60, 0.25);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--nope);
  transition: background var(--transition);
}

.btn-logout:hover {
  background: rgba(231, 76, 60, 0.18);
}

.btn-logout svg {
  width: 18px;
  height: 18px;
}

/* ── Edit Profile Modal (bottom sheet) ───────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  z-index: 201;
  transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.show {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  margin: 12px auto 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 18px;
  font-weight: 700;
}

.sheet-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 18px;
  transition: background var(--transition);
}

.sheet-close:hover {
  background: var(--bg-input);
  color: var(--text);
}

.sheet-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-save-btn {
  width: 100%;
  padding: 14px;
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-pink);
  transition: opacity var(--transition), transform var(--transition);
  margin-top: 4px;
}

.sheet-save-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Skeleton Loading ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-card) 50%, var(--bg-surface) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.skeleton-card {
  border-radius: var(--radius-xl);
}

.skeleton-text {
  height: 14px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.skeleton-avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
}

.skeleton-match {
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
}

/* ── Toast Notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: all;
}

.toast.hiding {
  animation: toastOut 0.25s ease forwards;
}

.toast.info    { border-left: 3px solid var(--pink); }
.toast.success { border-left: 3px solid var(--like); }
.toast.error   { border-left: 3px solid var(--nope); }
.toast.warning { border-left: 3px solid var(--super); }

@keyframes toastIn {
  0%   { opacity: 0; transform: translateY(-16px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

/* ── Utility Classes ─────────────────────────────────────── */
.hidden { display: none !important; }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--pink);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Desktop adjustments ────────────────────────────────── */
@media (min-width: 768px) {
  .discover-page {
    max-width: 480px;
  }

  .bottom-sheet {
    max-width: 480px;
    left: calc(var(--nav-width) + (100vw - var(--nav-width) - 480px) / 2 + 480px / 2);
  }

  #match-overlay {
    padding-left: var(--nav-width);
  }

  #toast-container {
    left: calc(var(--nav-width) + 16px);
    transform: none;
  }
}
