/* assets/css/app.css — Dating Platform Styles */

:root {
  --primary: #e0375a;
  --primary-dark: #b82d48;
  --primary-light: #f8d7de;
  --secondary: #2d2d3a;
  --accent: #ff8fa3;
  --bg: #f9f5f6;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b6b7b;
  --border: #ede8ea;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --coin: #f59e0b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --transition: 0.18s ease;
}

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

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

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

/* ── Typography ── */
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-size: 0.9rem;
  font-weight: 500; cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #e0d8db; }
.btn-outline   { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm        { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg        { padding: 14px 28px; font-size: 1rem; }
.btn-full      { width: 100%; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Forms ── */
.form-group   { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1rem; }
.form-label   { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.form-input   {
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; color: var(--text); background: #fff; transition: border var(--transition);
  outline: none; width: 100%;
}
.form-input:focus { border-color: var(--primary); }
.form-input::placeholder { color: #bbb; }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

/* ── Cards ── */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; border: 1px solid var(--border);
}
.card-sm { padding: 1rem; border-radius: var(--radius-sm); }

/* ── Navigation ── */
.navbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 1.5rem; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.nav-logo { font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.nav-logo span { color: var(--secondary); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 0.88rem;
  color: var(--text-muted); text-decoration: none; transition: all var(--transition);
  display: flex; align-items: center; gap: 6px; cursor: pointer; border: none; background: none;
}
.nav-link:hover, .nav-link.active { background: var(--primary-light); color: var(--primary); }
.nav-coins {
  display: flex; align-items: center; gap: 5px; padding: 6px 12px;
  background: #fff8e6; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
  color: #92640a; border: 1px solid #f0d080;
}

/* ── Layout ── */
.container  { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page       { padding: 2rem 0; min-height: calc(100vh - 62px); }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3     { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1      { gap: 0.5rem; }
.gap-2      { gap: 1rem; }
.gap-3      { gap: 1.5rem; }
.mt-1       { margin-top: 0.5rem; }
.mt-2       { margin-top: 1rem; }
.mt-3       { margin-top: 1.5rem; }
.mb-2       { margin-bottom: 1rem; }
.text-center { text-align: center; }

/* ── Profile cards (browse) ── */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.profile-card {
  background: #fff; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: all 0.2s ease; cursor: pointer;
  border: 1px solid var(--border);
}
.profile-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.profile-card-img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  background: linear-gradient(135deg, #f8d7de 0%, #fce7f3 100%);
  display: flex; align-items: center; justify-content: center;
}
.profile-card-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-card-placeholder { font-size: 3rem; }
.profile-card-body { padding: 0.875rem; }
.profile-card-name { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.profile-card-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ── Avatar ── */
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary-light); display: flex; align-items: center;
  justify-content: center; font-weight: 600; color: var(--primary);
  font-size: 0.9rem; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg  { width: 80px; height: 80px; font-size: 1.6rem; }
.avatar-xl  { width: 120px; height: 120px; font-size: 2.5rem; }

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 20px; font-size: 0.72rem; font-weight: 600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef9c3; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-muted   { background: #f1f5f9; color: #64748b; }

/* ── Messages / Chat ── */
.chat-layout { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 62px); overflow: hidden; }
.conv-list   { border-right: 1px solid var(--border); overflow-y: auto; background: #fff; }
.conv-item   {
  padding: 0.875rem 1rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
  display: flex; align-items: center; gap: 10px;
}
.conv-item:hover, .conv-item.active { background: var(--primary-light); }
.conv-item-name   { font-weight: 600; font-size: 0.88rem; color: var(--text); }
.conv-item-preview { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-left: auto; flex-shrink: 0; }

.chat-area   { display: flex; flex-direction: column; height: 100%; }
.chat-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: #fff; display: flex; align-items: center; gap: 12px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 10px; }
.chat-input-area { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: #fff; display: flex; gap: 10px; }
.chat-input { flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 22px; outline: none; font-size: 0.9rem; resize: none; }
.chat-input:focus { border-color: var(--primary); }

.msg-bubble { max-width: 68%; padding: 9px 14px; border-radius: 18px; font-size: 0.9rem; line-height: 1.5; }
.msg-out    { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-in     { background: #f1f1f4; color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-meta   { font-size: 0.7rem; opacity: 0.65; margin-top: 3px; }

/* ── Coin card ── */
.coin-pkg {
  border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
  text-align: center; cursor: pointer; transition: all var(--transition); background: #fff;
}
.coin-pkg:hover, .coin-pkg.selected { border-color: var(--primary); background: var(--primary-light); }
.coin-pkg.popular { border-color: var(--coin); position: relative; }
.coin-pkg-amount  { font-size: 2rem; font-weight: 700; color: var(--primary); }
.coin-pkg-price   { font-size: 1.1rem; color: var(--text); font-weight: 600; margin-top: 4px; }
.coin-pkg-label   { font-size: 0.8rem; color: var(--text-muted); }
.popular-badge    { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--coin); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }

/* ── Auth pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fff0f3 0%, #fce7f3 100%); padding: 2rem; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 2.5rem; width: 100%; max-width: 440px; }
.auth-logo  { text-align: center; margin-bottom: 1.5rem; font-size: 1.8rem; font-weight: 700; color: var(--primary); }

/* ── Notifications / Toast ── */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--secondary); color: #fff; padding: 12px 18px;
  border-radius: var(--radius-sm); font-size: 0.875rem; box-shadow: var(--shadow-lg);
  animation: slideIn 0.25s ease; max-width: 320px;
}
.toast.success { background: #15803d; }
.toast.error   { background: var(--danger); }
.toast.warning { background: #d97706; }
@keyframes slideIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }

/* ── Alert ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 3px solid #3b82f6; }
.alert-success { background: #dcfce7; color: #15803d; border-left: 3px solid #22c55e; }
.alert-warning { background: #fef9c3; color: #92400e; border-left: 3px solid #f59e0b; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border-left: 3px solid #ef4444; }

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

/* ── Page sections ── */
.page-header { margin-bottom: 1.5rem; }
.page-header h2 { margin-bottom: 0.25rem; }
.section-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ── Profile detail page ── */
.profile-hero { display: flex; gap: 2rem; align-items: flex-start; margin-bottom: 2rem; }
.profile-hero-pics { flex-shrink: 0; }
.profile-hero-main { width: 280px; height: 360px; border-radius: var(--radius); overflow: hidden; background: var(--primary-light); display: flex; align-items: center; justify-content: center; font-size: 6rem; }
.profile-hero-main img { width: 100%; height: 100%; object-fit: cover; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.tab { padding: 8px 16px; font-size: 0.875rem; cursor: pointer; border: none; background: none; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all var(--transition); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ── Search bar ── */
.search-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.search-input { flex: 1; min-width: 200px; }

/* ── Verification banner ── */
.verify-banner {
  background: linear-gradient(90deg, #fef9c3, #fef3c7);
  border: 1px solid #f0d080; border-radius: var(--radius-sm);
  padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  font-size: 0.875rem; color: #78350f; margin-bottom: 1.5rem;
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .conv-list { display: none; }
  .conv-list.show { display: block; position: fixed; top: 62px; left: 0; right: 0; bottom: 0; z-index: 50; }
  .profile-hero { flex-direction: column; }
  .profile-hero-main { width: 100%; height: 260px; }
  .nav-links .nav-link span { display: none; }
  h1 { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════════
   MOBILE RESPONSIVE — Full overhaul
   ═══════════════════════════════════════════════ */

/* ── Bottom nav (mobile only) ── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid var(--border);
  z-index: 200; height: 60px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.bottom-nav-inner {
  display: flex; height: 100%;
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; border: none; background: none;
  color: var(--text-muted); font-size: 0.6rem; font-weight: 500;
  cursor: pointer; padding: 6px 0; transition: color var(--transition);
  text-decoration: none;
}
.bottom-nav-item .bn-icon { font-size: 1.3rem; line-height: 1; }
.bottom-nav-item.active  { color: var(--primary); }
.bottom-nav-item:hover   { color: var(--primary); }
.bottom-nav-coins {
  font-size: 0.55rem; background: #fff8e6; color: #92640a;
  border: 1px solid #f0d080; border-radius: 10px; padding: 1px 5px;
  font-weight: 700; margin-top: 1px;
}

@media (max-width: 768px) {
  /* Show bottom nav, hide desktop nav links */
  .bottom-nav { display: block; }
  .nav-links   { display: none; }
  .navbar      { padding: 0 1rem; height: 54px; }
  .nav-logo    { font-size: 1.2rem; }

  /* Add padding so content doesn't hide behind bottom nav */
  .page        { padding: 1rem 0 80px; }
  .container   { padding: 0 1rem; }

  /* Grids → single column */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 1rem; }

  /* Profile cards — 2 per row on mobile */
  .profile-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .profile-card-body { padding: 0.6rem; }
  .profile-card-name { font-size: 0.85rem; }

  /* Profile hero */
  .profile-hero { flex-direction: column; gap: 1rem; }
  .profile-hero-main { width: 100%; height: 240px; font-size: 4rem; }

  /* Chat layout */
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 54px - 60px); }
  .conv-list {
    display: none; position: fixed; top: 54px; left: 0; right: 0;
    bottom: 60px; z-index: 150; background: #fff; overflow-y: auto;
  }
  .conv-list.show { display: block; }
  .chat-area { height: calc(100vh - 54px - 60px); }
  .chat-messages { padding: 0.875rem; }
  .chat-input-area { padding: 0.75rem; }

  /* Coin packages — 2 per row */
  #pkg-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.75rem; }
  .coin-pkg  { padding: 1rem 0.75rem; }
  .coin-pkg-amount { font-size: 1.5rem; }

  /* Settings page */
  .auth-card { padding: 1.5rem; }

  /* Cards */
  .card { padding: 1rem; }

  /* Typography */
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.15rem; }

  /* Search bar */
  .search-bar { gap: 8px; }
  .search-input { min-width: 0; }

  /* Page header */
  .page-header { margin-bottom: 1rem; }

  /* Verify banner */
  .verify-banner { font-size: 0.8rem; padding: 10px 12px; }

  /* Message bubbles */
  .msg-bubble { max-width: 82%; font-size: 0.875rem; }

  /* Nav coins — show in bottom nav only */
  .nav-coins { display: none; }

  /* Tabs — scrollable */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 2px; }
  .tab  { white-space: nowrap; flex-shrink: 0; }
}

@media (max-width: 400px) {
  .profile-grid { grid-template-columns: 1fr; }
  #pkg-grid     { grid-template-columns: 1fr !important; }
}
