/* ============================================================
   FariidMatch — Design System
   Palette: Deep Burgundy / Warm Rose / Ivory / Charcoal
   Typefaces: Playfair Display (display) / Inter (body/ui)
   Signature: card-stack swipe with depth shadows + gradient accents
   ============================================================ */

:root {
  --crimson:    #C1121F;
  --rose:       #E63950;
  --rose-light: #FF6B82;
  --gold:       #D4A843;
  --ivory:      #FAF7F4;
  --ivory-dark: #F0EBE5;
  --surface:    #FFFFFF;
  --border:     #E8E0D8;
  --text-dark:  #1A1412;
  --text-mid:   #4A3F3A;
  --text-muted: #8A7B74;
  --online:     #22C55E;
  --shadow-sm:  0 1px 3px rgba(26,20,18,.08), 0 1px 2px rgba(26,20,18,.04);
  --shadow-md:  0 4px 16px rgba(26,20,18,.10), 0 2px 6px rgba(26,20,18,.06);
  --shadow-lg:  0 12px 40px rgba(26,20,18,.14), 0 4px 12px rgba(26,20,18,.08);
  --shadow-card:0 20px 60px rgba(193,18,31,.18), 0 8px 20px rgba(26,20,18,.12);
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full:9999px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, sans-serif;
  --transition:   all .2s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typography ─────────────────────────────────────────── */
h1,h2,h3 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 600; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; }
p  { color: var(--text-mid); }
a  { color: var(--rose); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--crimson); }

/* ── Layout ─────────────────────────────────────────────── */
.main-content { flex: 1; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--crimson);
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--rose);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-mid);
  transition: var(--transition);
}
.nav-link svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; flex-shrink: 0; }
.nav-link:hover { background: var(--ivory-dark); color: var(--rose); }
.nav-link.active { background: #FFF0F2; color: var(--rose); }
.admin-link { color: var(--gold); }
.admin-link svg { fill: currentColor; stroke: none; }
.admin-link:hover { background: #FFF9EC; color: var(--gold); }
.logout-link:hover { background: #FFF0F2; color: var(--crimson); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-dark); border-radius: 2px; transition: var(--transition); }

/* ── Flash Messages ──────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1.5rem;
  font-size: .9rem;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.flash-success { background: #F0FDF4; color: #166534; border-color: #86EFAC; }
.flash-error   { background: #FFF1F2; color: #9F1239; border-color: #FDA4AF; }
.flash-info    { background: #EFF6FF; color: #1E40AF; border-color: #93C5FD; }
.flash button  { background: none; border: none; cursor: pointer; color: inherit; opacity: .6; }
.flash button:hover { opacity: 1; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn-primary {
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  box-shadow: 0 4px 14px rgba(198,57,74,.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(198,57,74,.45);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--rose);
  color: var(--rose);
}
.btn-outline:hover { background: var(--rose); color: #fff; }

.btn-ghost {
  background: var(--ivory-dark);
  color: var(--text-mid);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--border); color: var(--text-dark); }

.btn-danger { background: var(--crimson); color: #fff; }
.btn-danger:hover { background: #9B0E19; }

.btn-sm { padding: .45rem .9rem; font-size: .8rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }

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

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: .4rem;
  letter-spacing: .01em;
}

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .9rem;
  background: var(--surface);
  color: var(--text-dark);
  transition: var(--transition);
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(230,57,80,.12);
}
textarea { resize: vertical; min-height: 100px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%238A7B74' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.5rem; }

.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--crimson); margin-top: .3rem; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-body { padding: 1.75rem; }
.card-header { padding: 1.25rem 1.75rem; border-bottom: 1px solid var(--border); }

/* ── Auth Pages ──────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--ivory);
}

.auth-visual {
  background: linear-gradient(135deg, #1A0A0E 0%, #3D0F1A 40%, #6B1528 70%, #C1121F 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(230,57,80,.15);
  top: -100px;
  right: -100px;
}

.auth-visual::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(212,168,67,.08);
  bottom: -80px;
  left: -60px;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2rem;
}

.auth-logo svg { width: 42px; height: 42px; color: var(--rose-light); }

.auth-tagline {
  font-size: 1.1rem;
  opacity: .8;
  font-weight: 300;
  letter-spacing: .02em;
}

.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.auth-stat { text-align: center; }
.auth-stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--rose-light);
}
.auth-stat-label { font-size: .75rem; opacity: .65; text-transform: uppercase; letter-spacing: .08em; }

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}

.auth-form-container {
  width: 100%;
  max-width: 420px;
}

.auth-form-container h1 { margin-bottom: .5rem; }
.auth-form-container > p { color: var(--text-muted); margin-bottom: 2rem; }

/* ── Swipe / Discover ────────────────────────────────────── */
.discover-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  align-items: start;
}

.swipe-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.card-stack {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 520px;
}

.profile-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: grab;
  user-select: none;
  transition: transform .15s ease;
  background: #1a1412;
}

.profile-card:nth-child(2) { transform: rotate(2deg) translateY(8px) scale(.97); z-index: 1; }
.profile-card:nth-child(3) { transform: rotate(-1deg) translateY(16px) scale(.94); z-index: 0; }
.profile-card:nth-child(1) { z-index: 2; }

.profile-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-card-photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card-photo-placeholder svg {
  width: 80px;
  height: 80px;
  color: rgba(255,255,255,.3);
}

.profile-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(10,5,7,.92) 0%, rgba(10,5,7,.5) 50%, transparent 100%);
  padding: 2rem 1.5rem 1.5rem;
  color: #fff;
}

.profile-card-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.profile-card-meta {
  font-size: .9rem;
  opacity: .8;
  margin-top: .25rem;
}

.profile-card-bio {
  font-size: .85rem;
  opacity: .7;
  margin-top: .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.swipe-indicator {
  position: absolute;
  top: 1.5rem;
  padding: .5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .05em;
  border: 3px solid;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 10;
}
.like-indicator   { left: 1.5rem; background: rgba(34,197,94,.15); color: #22C55E; border-color: #22C55E; }
.nope-indicator   { right: 1.5rem; background: rgba(193,18,31,.15); color: var(--crimson); border-color: var(--crimson); }

.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.swipe-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}
.swipe-btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.swipe-btn-dislike {
  width: 58px; height: 58px;
  background: #fff;
  color: var(--crimson);
}
.swipe-btn-dislike svg { width: 24px; height: 24px; }
.swipe-btn-dislike:hover { background: var(--crimson); color: #fff; transform: scale(1.08); }

.swipe-btn-like {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  box-shadow: 0 6px 20px rgba(198,57,74,.4);
}
.swipe-btn-like svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.swipe-btn-like:hover { transform: scale(1.08); box-shadow: 0 8px 28px rgba(198,57,74,.55); }

.swipe-btn-superlike {
  width: 52px; height: 52px;
  background: #fff;
  color: var(--gold);
}
.swipe-btn-superlike svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.swipe-btn-superlike:hover { background: var(--gold); color: #fff; transform: scale(1.08); }

.no-more-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
}

.no-more-icon { color: var(--rose); opacity: .4; }
.no-more-icon svg { width: 64px; height: 64px; fill: currentColor; }

/* ── Profile Sidebar (Discover) ──────────────────────────── */
.discover-sidebar {}
.sidebar-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.sidebar-section h3 { font-size: 1rem; margin-bottom: 1rem; color: var(--text-dark); }

/* ── Matches Grid ────────────────────────────────────────── */
.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
}

.match-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}
.match-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.match-card-photo {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: block;
}

.match-card-photo-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: flex;
  align-items: center;
  justify-content: center;
}
.match-card-photo-placeholder svg { width: 48px; height: 48px; color: rgba(255,255,255,.35); }

.match-card-body { padding: 1rem; }
.match-card-name { font-weight: 600; font-size: .95rem; color: var(--text-dark); }
.match-card-meta { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }

.match-badge-new {
  display: inline-block;
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .6rem;
  border-radius: var(--radius-full);
  margin-bottom: .4rem;
}

/* ── Chat / Messages ─────────────────────────────────────── */
.messages-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 62px);
}

.conversations-panel {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.conversations-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.conversation-list { flex: 1; overflow-y: auto; }

.conversation-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--ivory-dark);
  transition: var(--transition);
  text-decoration: none;
}
.conversation-item:hover { background: var(--ivory); }
.conversation-item.active { background: #FFF0F2; }

.convo-avatar {
  position: relative;
  flex-shrink: 0;
}
.convo-avatar img, .convo-avatar-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: flex; align-items: center; justify-content: center;
}
.convo-avatar-placeholder svg { width: 24px; height: 24px; color: rgba(255,255,255,.5); }

.online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--online);
  border: 2px solid var(--surface);
}

.convo-info { flex: 1; min-width: 0; }
.convo-name { font-weight: 600; font-size: .9rem; color: var(--text-dark); }
.convo-preview {
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: .15rem;
}
.convo-time { font-size: .72rem; color: var(--text-muted); flex-shrink: 0; }

.unread-badge {
  background: var(--rose);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--ivory);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.chat-header img, .chat-avatar-ph {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: flex; align-items: center; justify-content: center;
}
.chat-avatar-ph svg { width: 20px; height: 20px; color: rgba(255,255,255,.5); }

.chat-header-info .chat-username { font-weight: 600; font-size: .95rem; }
.chat-header-info .chat-status { font-size: .75rem; color: var(--text-muted); }

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.msg-bubble {
  max-width: 68%;
  padding: .75rem 1.1rem;
  border-radius: 18px;
  font-size: .9rem;
  line-height: 1.5;
  position: relative;
}

.msg-in {
  background: var(--surface);
  color: var(--text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg-out {
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg-time {
  font-size: .68rem;
  opacity: .55;
  margin-top: .3rem;
  text-align: right;
}
.msg-in .msg-time { text-align: left; }

.chat-input-area {
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: .75rem;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: .75rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: .9rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: var(--transition);
}
.chat-input:focus { outline: none; border-color: var(--rose); }

.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(198,57,74,.3);
}
.chat-send-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.chat-send-btn:hover { transform: scale(1.05); }

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
}
.chat-empty svg { width: 60px; height: 60px; color: var(--rose); opacity: .3; }

/* ── Profile Page ────────────────────────────────────────── */
.profile-layout {
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.profile-header-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.profile-cover {
  height: 180px;
  background: linear-gradient(135deg, #3D0F1A 0%, #C1121F 60%, #E63950 100%);
  position: relative;
}

.profile-avatar-wrap {
  position: absolute;
  bottom: -48px;
  left: 1.75rem;
}

.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  object-fit: cover;
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: block;
}

.profile-avatar-ph {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  background: linear-gradient(135deg, #3D0F1A, #6B1528);
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar-ph svg { width: 44px; height: 44px; color: rgba(255,255,255,.4); fill: none; stroke: currentColor; stroke-width: 1.5; }

.profile-info-body { padding: 3.5rem 1.75rem 1.75rem; }
.profile-name-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.profile-name-wrap h2 { font-size: 1.6rem; }
.profile-name-meta { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }

.profile-bio-text { color: var(--text-mid); margin-top: 1rem; line-height: 1.7; }

.profile-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.profile-tag {
  background: var(--ivory-dark);
  color: var(--text-mid);
  font-size: .78rem;
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: var(--radius-full);
}

/* ── Photo Grid ──────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-top: 1.25rem;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--ivory-dark);
  border: 2px dashed var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.photo-item:hover { border-color: var(--rose); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-item.has-photo { border-style: solid; border-color: transparent; }

.photo-add-btn {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .78rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: .75rem;
}
.photo-add-btn svg { width: 28px; height: 28px; color: var(--rose); opacity: .5; }

.photo-remove {
  position: absolute;
  top: .5rem; right: .5rem;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(193,18,31,.85);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: var(--transition);
}
.photo-item:hover .photo-remove { opacity: 1; }
.photo-remove svg { width: 14px; height: 14px; }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-icon-rose { background: #FFF0F2; color: var(--rose); }
.stat-icon-gold { background: #FFF9EC; color: var(--gold); }
.stat-icon-green { background: #F0FDF4; color: #16A34A; }
.stat-icon-blue  { background: #EFF6FF; color: #2563EB; }

.stat-value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 62px);
}

.admin-sidebar {
  background: var(--text-dark);
  padding: 1.5rem 1rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  transition: var(--transition);
  margin-bottom: .25rem;
}
.admin-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.admin-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-nav-link.active { background: var(--rose); color: #fff; }

.admin-main { padding: 2rem; }

.admin-table-wrap {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }
thead th { background: var(--ivory-dark); padding: .875rem 1.25rem; font-size: .8rem; font-weight: 600; color: var(--text-mid); text-align: left; text-transform: uppercase; letter-spacing: .05em; }
tbody td { padding: 1rem 1.25rem; font-size: .875rem; border-bottom: 1px solid var(--ivory-dark); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--ivory); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .25rem .7rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-active  { background: #F0FDF4; color: #166534; }
.badge-banned  { background: #FFF1F2; color: #9F1239; }
.badge-admin   { background: #FFF9EC; color: #92400E; }
.badge-new     { background: #EFF6FF; color: #1E40AF; }

/* ── Match Popup ─────────────────────────────────────────── */
.match-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,5,7,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.match-popup {
  background: linear-gradient(135deg, #1A0A0E 0%, #3D0F1A 50%, #6B1528 100%);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  color: #fff;
  max-width: 420px;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.match-popup::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(230,57,80,.2);
}

.match-popup-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: -20px;
  margin-bottom: 1.5rem;
  position: relative;
}

.match-avatar {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.3);
  object-fit: cover;
  background: linear-gradient(135deg, #6B1528, #C1121F);
}

.match-heart {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--rose), var(--crimson));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 -10px;
  z-index: 1;
  box-shadow: 0 0 20px rgba(230,57,80,.5);
  flex-shrink: 0;
}
.match-heart svg { width: 20px; height: 20px; fill: #fff; }

.match-popup h2 {
  font-size: 2rem;
  margin-bottom: .5rem;
  color: #fff;
}

.match-popup p { color: rgba(255,255,255,.7); margin-bottom: 2rem; }

/* ── Page States ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  gap: 1rem;
}
.empty-icon { color: var(--rose); opacity: .3; }
.empty-icon svg { width: 64px; height: 64px; fill: currentColor; }
.empty-state h3 { color: var(--text-dark); }
.empty-state p { color: var(--text-muted); max-width: 320px; }

/* ── Landing / Home ──────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1A0A0E 0%, #3D0F1A 40%, #6B1528 70%, #C1121F 100%);
  color: #fff;
  padding: 6rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(230,57,80,.08);
  top: -200px; right: -200px;
}

.hero-content { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 3.5rem); margin-bottom: 1.25rem; }
.hero p { font-size: 1.1rem; opacity: .8; margin-bottom: 2.5rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.2);
  padding: .4rem 1rem;
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--online); }

/* ── Utilities ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-sm { gap: .5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.section { padding: 4rem 1.5rem; }
.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { margin-bottom: .5rem; }
.section-title p { color: var(--text-muted); max-width: 500px; margin: 0 auto; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--text-dark);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-visual  { display: none; }
  .discover-layout { grid-template-columns: 1fr; }
  .discover-sidebar { order: -1; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .messages-layout { grid-template-columns: 1fr; }
  .conversations-panel { height: 280px; overflow: hidden; }
}

@media (max-width: 640px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: .5rem; z-index: 99; box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .form-row { grid-template-columns: 1fr; }
  .matches-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 4rem 1.5rem; }
  .auth-form-side { padding: 2rem 1.5rem; }
}
