/* ============================================================
   WanderMatch — Main Stylesheet
   Aesthetic: Warm golden-hour travel romance
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --gold:       #E8A84C;
  --gold-light: #F5D08A;
  --terra:      #C2622E;
  --dusk:       #1A1025;
  --night:      #0D0A15;
  --sky:        #4A90D9;
  --sky-light:  #7BB8F0;
  --cream:      #FDF6EC;
  --warm-gray:  #6B6070;
  --green:      #3DAA72;
  --red:        #E05252;

  --surface:    #211930;
  --surface2:   #2D2040;
  --surface3:   #3A2D52;
  --border:     rgba(232,168,76,0.15);
  --text:       #F0EAF8;
  --text-dim:   rgba(240,234,248,0.6);

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  36px;
  --shadow:     0 8px 32px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 24px rgba(232,168,76,0.25);

  --font-display: 'Cormorant Garamond', serif;
  --font-body:    'DM Sans', sans-serif;
  
  --sidebar-w: 260px;
  --header-h:  64px;
}

*, *::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(--night);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- TYPOGRAPHY ---- */
h1, h2, h3 { font-family: var(--font-display); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 600; line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 600; }
h3 { font-size: 1.25rem; }
p { line-height: 1.65; color: var(--text-dim); }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--terra));
  color: #fff; box-shadow: var(--shadow-gold);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(232,168,76,0.4); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: rgba(232,168,76,0.12); }
.btn-ghost { background: var(--surface2); color: var(--text); }
.btn-ghost:hover { background: var(--surface3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 36px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---- INPUTS ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 12px 16px;
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,168,76,0.1); }
.form-control::placeholder { color: rgba(240,234,248,0.3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ---- CARDS ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* ---- BADGE ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 500;
}
.badge-gold { background: rgba(232,168,76,0.2); color: var(--gold); }
.badge-green { background: rgba(61,170,114,0.2); color: var(--green); }
.badge-red { background: rgba(224,82,82,0.2); color: var(--red); }
.badge-sky { background: rgba(74,144,217,0.2); color: var(--sky-light); }
.badge-gray { background: var(--surface2); color: var(--text-dim); }

/* ---- LAYOUT ---- */
.app-layout {
  display: flex; min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w); height: 100vh; position: fixed; left: 0; top: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; transition: transform 0.3s ease;
}
.main-content {
  margin-left: var(--sidebar-w); flex: 1; padding: 24px;
  min-height: 100vh; max-width: calc(100vw - var(--sidebar-w));
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-text {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 600;
  background: linear-gradient(135deg, var(--gold), var(--terra));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-logo .logo-tag { font-size: 0.75rem; color: var(--text-dim); }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; cursor: pointer; border-radius: 0;
  color: var(--text-dim); font-size: 0.9rem; font-weight: 400;
  transition: all 0.2s; border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(232,168,76,0.1); color: var(--gold); border-left-color: var(--gold); }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 1.1rem; }
.nav-badge {
  margin-left: auto; background: var(--terra); color: #fff;
  font-size: 0.7rem; padding: 2px 7px; border-radius: 99px;
}
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }

/* ---- HEADER ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h1, .page-header h2 { margin: 0; }

/* ---- STATS GRID ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 20px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--terra));
}
.stat-value { font-size: 2rem; font-weight: 600; font-family: var(--font-display); color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; }
.stat-icon { font-size: 2rem; opacity: 0.2; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }

/* ---- TABLE ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 0.8rem; font-weight: 500; color: var(--text-dim); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9rem; vertical-align: middle; }
.data-table tr:hover td { background: var(--surface2); }
.table-wrapper { overflow-x: auto; }

/* ---- USER CARD (swipe) ---- */
.swipe-stack { position: relative; height: 560px; }
.user-card {
  position: absolute; inset: 0;
  background: var(--surface); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow);
  cursor: grab; user-select: none;
  transition: transform 0.3s cubic-bezier(.17,.67,.35,1.2);
}
.user-card.dragging { cursor: grabbing; transition: none; }
.user-card-photo { width: 100%; height: 380px; object-fit: cover; }
.user-card-photos { position: relative; height: 380px; overflow: hidden; }
.user-card-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.user-card-photos img.active { opacity: 1; }
.photo-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.photo-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.4); transition: all 0.2s; }
.photo-dot.active { background: #fff; width: 18px; border-radius: 3px; }
.card-gradient { position: absolute; bottom: 0; left: 0; right: 0; height: 200px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); pointer-events: none; }
.user-card-body { padding: 16px 20px; }
.user-name { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.user-meta { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }
.user-interests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.interest-chip { background: var(--surface2); border: 1px solid var(--border); border-radius: 99px; padding: 4px 12px; font-size: 0.75rem; }
.swipe-actions { display: flex; justify-content: center; gap: 16px; margin-top: 16px; }
.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;
}
.swipe-btn-pass { background: var(--surface2); color: var(--red); border: 2px solid var(--red); }
.swipe-btn-like { background: linear-gradient(135deg, var(--gold), var(--terra)); color: #fff; box-shadow: var(--shadow-gold); }
.swipe-btn-super { background: var(--surface2); color: var(--sky-light); border: 2px solid var(--sky-light); }
.swipe-btn:hover { transform: scale(1.12); }

/* ---- ONLINE INDICATOR ---- */
.online-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--surface);
  display: inline-block;
}
.online-dot.offline { background: var(--warm-gray); }

/* ---- CHAT ---- */
.chat-layout { display: flex; height: calc(100vh - 48px); gap: 16px; }
.chat-sidebar { width: 300px; background: var(--surface); border-radius: var(--radius-lg); overflow-y: auto; }
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; }
.chat-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-input-area { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.chat-input { flex: 1; background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; color: var(--text); font-family: var(--font-body); font-size: 0.9rem; outline: none; }
.chat-input:focus { border-color: var(--gold); }
.msg-bubble { max-width: 70%; padding: 10px 14px; border-radius: 18px; font-size: 0.9rem; line-height: 1.5; }
.msg-bubble.sent { background: linear-gradient(135deg, var(--gold), var(--terra)); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.msg-bubble.recv { background: var(--surface2); color: var(--text); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 4px; }
.conv-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.2s; }
.conv-item:hover, .conv-item.active { background: var(--surface2); }
.conv-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface3); display: flex; align-items: center; justify-content: center; }
.conv-info { flex: 1; min-width: 0; }
.conv-name { font-weight: 500; font-size: 0.9rem; }
.conv-last { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge { background: var(--gold); color: var(--night); font-size: 0.7rem; font-weight: 600; border-radius: 99px; padding: 2px 7px; }

/* ---- MAP ---- */
.location-toggle { display: flex; align-items: center; gap: 10px; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--surface3);
  border-radius: 99px; cursor: pointer; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--gold); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px; max-width: 520px; width: 92%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 16px; }
.alert-success { background: rgba(61,170,114,0.15); border: 1px solid rgba(61,170,114,0.3); color: #6ee7a8; }
.alert-error { background: rgba(224,82,82,0.15); border: 1px solid rgba(224,82,82,0.3); color: #f8a1a1; }
.alert-info { background: rgba(74,144,217,0.15); border: 1px solid rgba(74,144,217,0.3); color: var(--sky-light); }

/* ---- AVATAR ---- */
.avatar { border-radius: 50%; object-fit: cover; background: var(--surface3); }
.avatar-sm  { width: 32px; height: 32px; }
.avatar-md  { width: 48px; height: 48px; }
.avatar-lg  { width: 72px; height: 72px; }
.avatar-xl  { width: 100px; height: 100px; border: 3px solid var(--gold); }

/* ---- MATCH ANIMATION ---- */
@keyframes matchPop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.match-celebration { animation: matchPop 0.5s cubic-bezier(.17,.67,.35,1.2); }

/* ---- ANIMATIONS ---- */
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp  { from { transform: translateY(30px); opacity:0; } to { transform: translateY(0); opacity:1; } }
@keyframes slideIn  { from { transform: translateX(-20px); opacity:0; } to { transform: translateX(0); opacity:1; } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes spin     { to { transform: rotate(360deg); } }

.fade-in  { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.4s ease; }

/* ---- LOADING ---- */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; }

/* ---- AD BANNER ---- */
.ad-banner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  display: flex; align-items: center; gap: 16px; padding: 12px 16px;
}
.ad-banner img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; }
.ad-label { font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---- GRID LAYOUTS ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }

/* ---- AUTH PAGES ---- */
.auth-page {
  min-height: 100vh; display: flex;
  background: linear-gradient(135deg, var(--night) 0%, var(--dusk) 50%, #1a0f2e 100%);
}
.auth-visual {
  flex: 1; background: url('../images/travel-bg.jpg') center/cover;
  position: relative; display: none;
}
.auth-visual::after { content:''; position:absolute; inset:0; background: linear-gradient(135deg, rgba(26,16,37,0.8), rgba(13,10,21,0.6)); }
.auth-visual-content { position: relative; z-index: 1; padding: 60px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.auth-form-panel { width: 480px; padding: 60px 48px; display: flex; flex-direction: column; justify-content: center; background: var(--night); }
.auth-logo { font-family: var(--font-display); font-size: 2rem; font-weight: 600; background: linear-gradient(135deg, var(--gold), var(--terra)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 8px; }
.auth-tagline { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 40px; }
@media (min-width: 900px) { .auth-visual { display: flex; } .auth-form-panel { width: 440px; } }
@media (max-width: 768px) { .auth-page { justify-content: center; } .auth-form-panel { width: 100%; padding: 40px 24px; } }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; max-width: 100%; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .chat-layout { flex-direction: column; height: auto; }
  .chat-sidebar { width: 100%; max-height: 200px; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 12px; }
}

/* ---- HAMBURGER ---- */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; background: none; border: none; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 99px; transition: 0.3s; }
@media (max-width: 900px) { .hamburger { display: flex; } }

/* ---- VENDOR / ADMIN SPECIFIC ---- */
.section-title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 16px; }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar .form-control { width: auto; }
.package-card { position: relative; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; background: var(--surface); transition: all 0.3s; }
.package-card:hover { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.package-card.featured { border-color: var(--gold); }
.package-card .price { font-family: var(--font-display); font-size: 2.5rem; color: var(--gold); }
.package-card .price span { font-size: 1rem; color: var(--text-dim); }
.package-features { list-style: none; margin: 16px 0; }
.package-features li { padding: 6px 0; font-size: 0.9rem; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.package-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

/* ---- NEAR ME MAP ---- */
#map { border-radius: var(--radius-lg); overflow: hidden; }
.map-overlay-card {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; min-width: 200px;
}

/* ---- PROFILE ---- */
.profile-hero { position: relative; }
.profile-cover { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: linear-gradient(135deg, var(--dusk), var(--terra)); }
.profile-avatar-wrap { position: absolute; bottom: -40px; left: 28px; }
.profile-photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 16px; }
.profile-photo-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }

/* ---- MEET FLOW ---- */
.meet-steps { display: flex; gap: 0; margin-bottom: 24px; }
.meet-step { flex: 1; text-align: center; padding: 12px; position: relative; }
.meet-step::after { content:''; position:absolute; top:20px; right:0; width:1px; height:24px; background: var(--border); }
.meet-step:last-child::after { display:none; }
.meet-step-icon { font-size: 1.5rem; display: block; }
.meet-step-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 4px; }
.meet-step.done .meet-step-icon { filter: drop-shadow(0 0 6px var(--green)); }
.meet-step.active .meet-step-icon { filter: drop-shadow(0 0 6px var(--gold)); }
