/* =============================================================
   Salones Marketplace - Main Stylesheet
   ============================================================= */

:root {
  --primary: #6C63FF;
  --primary-dark: #5a52e0;
  --primary-light: #f0efff;
  --secondary: #4ECDC4;
  --accent: #FF6B6B;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --border: #e8eaf0;
  --text: #1a1a2e;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --shadow-sm: 0 2px 8px rgba(108,99,255,0.08);
  --shadow-md: 0 4px 24px rgba(108,99,255,0.12);
  --shadow-lg: 0 8px 40px rgba(108,99,255,0.18);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --nav-height: 64px;
  --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* =============================================================
   Layout
   ============================================================= */
.app-container {
  max-width: 100%;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + 16px);
}

.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* =============================================================
   Bottom Navigation
   ============================================================= */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--text-3);
  transition: color var(--transition);
  position: relative;
}

.nav-item.active { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

.nav-item svg { width: 24px; height: 24px; }
.nav-item span { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; }

/* =============================================================
   Top Header
   ============================================================= */
.top-header {
  background: var(--surface);
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.top-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* =============================================================
   Buttons
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(108,99,255,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(108,99,255,0.45); transform: translateY(-1px); }

.btn-secondary { background: var(--primary-light); color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: white; }

.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-icon { padding: 10px; border-radius: 50%; }

/* =============================================================
   Form Elements
   ============================================================= */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-hint { font-size: 12px; color: var(--text-2); margin-top: 4px; }

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.form-control::placeholder { color: var(--text-3); }
.form-control.error { border-color: var(--danger); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 2px solid var(--border); border-radius: 50px;
  cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2);
  transition: all var(--transition); user-select: none;
}
.checkbox-item:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.checkbox-item input { display: none; }

/* =============================================================
   Cards
   ============================================================= */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 20px; }
.card-title { font-size: 18px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-2); margin-top: 4px; }

/* Salon Card */
.salon-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.salon-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }

.salon-card-img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary-light), var(--surface-2));
}

.salon-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0efff, #e8f8f7);
  font-size: 48px;
}

.salon-card-body { padding: 16px; }
.salon-card-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.salon-card-city { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.salon-card-meta { display: flex; justify-content: space-between; align-items: center; }
.salon-card-price { font-size: 15px; font-weight: 700; color: var(--primary); }
.salon-card-capacity { font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 4px 10px; border-radius: 50px; }

.salon-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 50px; background: var(--primary-light); color: var(--primary);
}
.tag-green { background: #e8f8f0; color: var(--success); }
.tag-orange { background: #fff3cd; color: var(--warning); }

/* =============================================================
   Grid
   ============================================================= */
.salon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 0;
}
@media (max-width: 640px) { .salon-grid { grid-template-columns: 1fr; } }

/* =============================================================
   Search & Filters
   ============================================================= */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 4px 4px 4px 16px;
  gap: 8px;
  transition: border-color var(--transition);
  flex: 1;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; min-width: 0; }

.filters-drawer {
  position: fixed;
  bottom: var(--nav-height);
  left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 200;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  max-height: 80vh;
  overflow-y: auto;
}
.filters-drawer.open { transform: translateY(0); }
.filters-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
  display: none;
}
.filters-overlay.open { display: block; }

.filter-section { margin-bottom: 24px; }
.filter-section-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* =============================================================
   Badges & Status
   ============================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 50px;
  font-size: 12px; font-weight: 600;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #cff4fc; color: #0c5460; }
.badge-verified { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-paid { background: #d4edda; color: #155724; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-suspended { background: #f8d7da; color: #721c24; }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* =============================================================
   Modal
   ============================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 28px 24px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0); }
@media (min-width: 640px) { .modal { border-radius: var(--radius-lg); } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 20px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.modal-close:hover { background: var(--border); }

/* =============================================================
   Toast Notifications
   ============================================================= */
.toast-container {
  position: fixed;
  top: 20px; right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--text);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { from { opacity: 1; } to { opacity: 0; transform: translateX(20px); } }
.toast.hiding { animation: slideOut 0.3s ease forwards; }

/* =============================================================
   Page Headers
   ============================================================= */
.page-header { padding: 20px 16px 0; }
.page-title { font-size: 26px; font-weight: 800; color: var(--text); }
.page-subtitle { font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* =============================================================
   Section Headers
   ============================================================= */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; }

/* =============================================================
   Stats Grid
   ============================================================= */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 4px; font-weight: 500; }

/* =============================================================
   Tables
   ============================================================= */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* =============================================================
   Tabs
   ============================================================= */
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; overflow-x: auto; }
.tab-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); white-space: nowrap; transition: all var(--transition); flex-shrink: 0;
}
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* =============================================================
   Salon Detail
   ============================================================= */
.salon-gallery { position: relative; }
.gallery-main {
  width: 100%; aspect-ratio: 16/9;
  object-fit: cover; background: var(--surface-2);
}
.gallery-thumbs { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; }
.gallery-thumb {
  width: 72px; height: 52px; object-fit: cover;
  border-radius: 8px; border: 3px solid transparent; cursor: pointer; flex-shrink: 0;
  transition: border-color var(--transition);
}
.gallery-thumb.active { border-color: var(--primary); }

.salon-detail-header { padding: 20px 16px 0; }
.salon-detail-name { font-size: 24px; font-weight: 800; }
.salon-detail-city { color: var(--text-2); font-size: 14px; display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.salon-detail-price { font-size: 22px; font-weight: 800; color: var(--primary); margin: 12px 0; }
.salon-detail-price span { font-size: 14px; color: var(--text-2); font-weight: 400; }

.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.amenity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--radius-sm);
  background: var(--primary-light); font-size: 13px; font-weight: 600; color: var(--primary);
}

/* =============================================================
   Loading States
   ============================================================= */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-card { height: 280px; border-radius: var(--radius-md); }
.skeleton-text { height: 16px; margin-bottom: 8px; }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }

.loading-spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state-icon { font-size: 64px; margin-bottom: 16px; }
.empty-state-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

/* =============================================================
   Auth Pages
   ============================================================= */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f0efff 0%, #e8f8f7 100%);
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.auth-subtitle { text-align: center; color: var(--text-2); font-size: 14px; margin-bottom: 32px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--text-3); font-size: 13px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 20px; }

/* OTP Input */
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 24px 0; }
.otp-digit {
  width: 52px; height: 60px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; font-size: 24px; font-weight: 700; color: var(--primary);
  outline: none; transition: border-color var(--transition);
}
.otp-digit:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }

/* =============================================================
   Planner
   ============================================================= */
.planner-step { display: none; }
.planner-step.active { display: block; animation: fadeIn 0.3s ease; }

.planner-progress { display: flex; gap: 6px; margin-bottom: 28px; }
.progress-dot {
  flex: 1; height: 4px; border-radius: 4px;
  background: var(--border); transition: background 0.3s;
}
.progress-dot.done { background: var(--primary); }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.option-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px 12px; border: 2px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; text-align: center; transition: all var(--transition);
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.option-card:hover { border-color: var(--primary); color: var(--primary); }
.option-card.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.option-card .option-icon { font-size: 32px; }

/* =============================================================
   Account Page
   ============================================================= */
.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 32px 20px;
  text-align: center;
  color: white;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%; background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.5);
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-email { font-size: 14px; opacity: 0.85; }
.profile-badge { display: inline-block; margin-top: 8px; background: rgba(255,255,255,0.25); padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 600; }

.menu-list { background: var(--surface); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 500; color: var(--text);
  cursor: pointer; transition: background var(--transition);
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg); }
.menu-item .menu-icon { font-size: 20px; width: 24px; text-align: center; }
.menu-item .menu-arrow { margin-left: auto; color: var(--text-3); }
.menu-item.danger { color: var(--danger); }

/* =============================================================
   Admin Dashboard
   ============================================================= */
.admin-header {
  background: linear-gradient(135deg, var(--text), #2d2d4e);
  padding: 24px 16px;
  color: white;
}
.admin-title { font-size: 22px; font-weight: 800; }
.admin-subtitle { font-size: 13px; opacity: 0.7; margin-top: 4px; }

/* =============================================================
   Responsive
   ============================================================= */
@media (min-width: 768px) {
  .app-container { max-width: 768px; margin: 0 auto; }
  .bottom-nav { max-width: 768px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-md) var(--radius-md) 0 0; }
}

@media (min-width: 1024px) {
  .app-container { max-width: 1200px; }
  .bottom-nav { display: none; }
  .top-nav-desktop { display: flex !important; }
}

/* Desktop top nav */
.top-nav-desktop {
  display: none;
  gap: 4px;
}
.top-nav-desktop .nav-item {
  flex-direction: row;
  padding: 8px 16px;
  border-radius: 50px;
  gap: 6px;
  font-size: 14px;
}
.top-nav-desktop .nav-item span { font-size: 14px; }
.top-nav-desktop .nav-item.active::before { display: none; }
.top-nav-desktop .nav-item.active { background: var(--primary-light); }

/* Utility */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-2); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.section-pad { padding: 20px 16px; }
