/* assets/css/app.css — Estilos globales de la app */

:root {
  --wine: #6B1F2A;
  --wine-light: #8B2C3A;
  --wine-dark: #4A1520;
  --gold: #C9933A;
  --gold-light: #E8B05A;
  --cream: #FEF9F4;
  --cream-dark: #F7EDE0;
  --text: #2C1515;
  --muted: #7A5A5A;
  --white: #FFFFFF;
  --success: #2D7A4F;
  --success-bg: #E8F5EE;
  --danger: #A32D2D;
  --danger-bg: #FCEBEB;
  --border: #EAD8CC;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(107,31,42,0.12);
  --bottom-nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body { font-family: 'Nunito Sans', sans-serif; background: var(--cream); color: var(--text); line-height: 1.6; overflow-x: hidden; }
.app-body { padding-bottom: var(--bottom-nav-h); min-height: 100svh; }

/* ─── TOPBAR ─── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 56px; background: var(--wine-dark);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; gap: 0.5rem;
}
.app-logo { font-size: 1.1rem; font-weight: 800; color: #fff; text-decoration: none; white-space: nowrap; }
.app-logo span { color: var(--gold-light); }
.topbar-center { font-size: 0.9rem; font-weight: 700; color: rgba(255,255,255,0.85); }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.credit-pill {
  display: flex; align-items: center; gap: 4px;
  background: rgba(201,147,58,0.25); color: var(--gold-light);
  padding: 5px 10px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 800; text-decoration: none;
}
.plan-badge { font-size: 0.7rem; font-weight: 800; padding: 3px 8px; border-radius: 10px; }
.plan-badge.premium { background: rgba(201,147,58,0.3); color: var(--gold-light); }
.plan-badge.vip     { background: rgba(255,255,255,0.2); color: #fff; }

/* ─── MAIN CONTENT ─── */
.page-wrap { margin-top: 56px; min-height: calc(100svh - 56px - var(--bottom-nav-h)); }
.container { max-width: 640px; margin: 0 auto; padding: 1rem; }

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-nav-h);
  background: var(--white); border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  box-shadow: 0 -4px 20px rgba(107,31,42,0.08);
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted);
  transition: color 0.2s; -webkit-tap-highlight-color: transparent;
}
.bnav-item.active { color: var(--wine); }
.bnav-icon { font-size: 1.3rem; line-height: 1; }
.bnav-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── CARDS ─── */
.card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.25rem;
  margin-bottom: 1rem;
}
.card-title { font-size: 1rem; font-weight: 800; color: var(--wine-dark); margin-bottom: 0.75rem; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'Nunito Sans', sans-serif; font-size: 0.95rem; color: var(--text);
  background: var(--white); transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--wine);
}
.form-textarea { height: 100px; resize: vertical; }

/* ─── BUTTONS ─── */
.btn {
  display: block; width: 100%; padding: 14px;
  border-radius: 50px; border: none; cursor: pointer;
  font-family: 'Nunito Sans', sans-serif; font-size: 1rem; font-weight: 800;
  text-align: center; text-decoration: none;
  transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.btn-wine { background: var(--wine); color: var(--white); }
.btn-wine:hover { background: var(--wine-light); }
.btn-gold { background: var(--gold); color: var(--text); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; border: 2px solid var(--wine); color: var(--wine); }
.btn-outline:hover { background: var(--wine); color: var(--white); }
.btn-sm { padding: 9px 20px; font-size: 0.85rem; display: inline-block; width: auto; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1.5px solid #F7C1C1; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ─── ALERTS ─── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.9rem; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid #B8DFC8; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid #F7C1C1; }
.alert-info    { background: #E6F1FB; color: #185FA5; border: 1px solid #B5D4F4; }

/* ─── PROFILE CARD (buscar) ─── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.profile-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.profile-card:active { transform: scale(0.97); }
.profile-photo {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  background: var(--cream-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-info { padding: 0.6rem 0.75rem; }
.profile-name { font-size: 0.9rem; font-weight: 800; color: var(--text); }
.profile-meta { font-size: 0.78rem; color: var(--muted); }
.profile-distance { font-size: 0.75rem; color: var(--gold); font-weight: 700; }

/* ─── MATCH SWIPE CARD ─── */
.swipe-card {
  position: relative; width: 100%;
  max-width: 400px; margin: 0 auto;
  aspect-ratio: 3/4;
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--cream-dark);
}
.swipe-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.swipe-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 2rem 1.25rem 1.25rem;
  color: #fff;
}
.swipe-name { font-size: 1.4rem; font-weight: 800; }
.swipe-meta { font-size: 0.9rem; opacity: 0.85; }
.swipe-actions {
  display: flex; justify-content: center; gap: 1.5rem;
  margin-top: 1.25rem;
}
.swipe-btn {
  width: 60px; height: 60px; border-radius: 50%; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.swipe-btn.nope  { background: #fff; color: #E24B4A; }
.swipe-btn.like  { background: var(--wine); color: #fff; }
.swipe-btn.super { background: var(--gold); color: #fff; width: 50px; height: 50px; font-size: 1.2rem; }

/* ─── CHAT ─── */
.chat-list { display: flex; flex-direction: column; gap: 0; }
.chat-item {
  display: flex; align-items: center; gap: 12px;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background 0.15s; -webkit-tap-highlight-color: transparent;
}
.chat-item:hover { background: var(--cream); }
.chat-avatar {
  width: 48px; height: 48px; border-radius: 50%; object-fit: cover;
  background: var(--cream-dark); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-info { flex: 1; min-width: 0; }
.chat-name { font-weight: 800; font-size: 0.9rem; }
.chat-preview { font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }
.chat-unread { background: var(--wine); color: #fff; border-radius: 10px; font-size: 10px; font-weight: 800; padding: 2px 6px; }

.chat-window { display: flex; flex-direction: column; height: calc(100svh - 56px - var(--bottom-nav-h)); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.msg-wrap { display: flex; }
.msg-wrap.mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 18px;
  font-size: 0.9rem; line-height: 1.5;
}
.msg-bubble.theirs { background: var(--white); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-bubble.mine   { background: var(--wine); color: #fff; border-bottom-right-radius: 4px; }
.msg-time { font-size: 0.7rem; color: var(--muted); margin-top: 2px; padding: 0 4px; }

.chat-input-bar {
  background: var(--white); border-top: 1px solid var(--border);
  padding: 0.75rem 1rem; display: flex; gap: 8px; align-items: flex-end;
}
.chat-input {
  flex: 1; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 22px;
  font-family: 'Nunito Sans', sans-serif; font-size: 0.9rem; resize: none;
  max-height: 100px; outline: none; background: var(--cream);
}
.chat-input:focus { border-color: var(--wine); }
.chat-send {
  width: 42px; height: 42px; border-radius: 50%; background: var(--wine);
  border: none; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem; flex-shrink: 0;
  transition: background 0.2s;
}
.chat-send:hover { background: var(--wine-light); }
.creditos-warn { font-size: 0.78rem; color: var(--gold); text-align: center; padding: 4px; }

/* ─── PROFILE VIEW ─── */
.profile-hero {
  width: 100%; aspect-ratio: 4/5; position: relative;
  background: var(--cream-dark);
}
.profile-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-hero-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 2rem 1.25rem 1.25rem; color: #fff;
}
.profile-hero-name { font-size: 1.6rem; font-weight: 800; }
.profile-hero-meta { font-size: 0.9rem; opacity: 0.85; }

.profile-section { margin-bottom: 1.25rem; }
.profile-section-title { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.5rem; }

/* ─── STATS ─── */
.stats-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.stat-box { flex: 1; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem 0.5rem; text-align: center; }
.stat-box .n { font-size: 1.5rem; font-weight: 800; color: var(--wine); }
.stat-box .l { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }

/* ─── PRICING ─── */
.plan-cards { display: flex; flex-direction: column; gap: 1rem; }
.plan-card {
  background: var(--white); border-radius: var(--radius);
  border: 2px solid var(--border); padding: 1.5rem;
  position: relative;
}
.plan-card.featured { border-color: var(--wine); }
.plan-featured-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--wine); color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 3px 14px; border-radius: 20px; white-space: nowrap;
}
.plan-name { font-size: 1.1rem; font-weight: 800; color: var(--wine-dark); margin-bottom: 4px; }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--wine); line-height: 1; }
.plan-price span { font-size: 0.9rem; color: var(--muted); font-weight: 400; }
.plan-features { list-style: none; margin: 1rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.plan-features li { font-size: 0.9rem; color: var(--muted); display: flex; gap: 8px; }
.plan-features li .ok { color: var(--wine); flex-shrink: 0; }

/* ─── AUTH PAGES ─── */
.auth-wrap { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; background: var(--cream); }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border-radius: 20px; padding: 2rem 1.75rem; border: 1px solid var(--border); box-shadow: var(--shadow); }
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo a { font-size: 1.7rem; font-weight: 800; color: var(--wine-dark); text-decoration: none; }
.auth-logo a span { color: var(--gold); }
.auth-logo p { font-size: 0.9rem; color: var(--muted); margin-top: 4px; }
.auth-title { font-size: 1.25rem; font-weight: 800; color: var(--wine-dark); margin-bottom: 1.25rem; text-align: center; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.875rem; color: var(--muted); }
.auth-footer a { color: var(--wine); font-weight: 700; text-decoration: none; }

/* ─── UTILITIES ─── */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.fw-bold { font-weight: 800; }
.section-title { font-size: 1.1rem; font-weight: 800; color: var(--wine-dark); margin-bottom: 0.75rem; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-wine { background: #FAECE7; color: var(--wine); }
.badge-gold { background: #FAF0D7; color: #85520A; }

/* ─── PHOTO UPLOAD ─── */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.photo-slot {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--cream-dark); border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; font-size: 1.5rem;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; background: rgba(0,0,0,0.6); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; cursor: pointer;
}

/* ─── LOADER ─── */
.loader { text-align: center; padding: 2rem; color: var(--muted); font-size: 0.9rem; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--wine); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── NO-RESULTS ─── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 800; color: var(--wine-dark); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.9rem; }

/* ─── RESPONSIVE ─── */
@media (min-width: 640px) {
  .container { padding: 1.5rem; }
  .profile-grid { grid-template-columns: repeat(3, 1fr); }
  .plan-cards { flex-direction: row; }
}
