/* ============================================
   THE SCALP SOCIETY — Client Hub
   Design System + Components
   Dark luxury aesthetic: #0a0a0a + gold #C8A96E
   ============================================ */

/* ---------- CSS VARIABLES ---------- */
:root {
  --bg-primary: #0a0a0a;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --bg-input: #1a1a1a;
  --bg-overlay: rgba(10, 10, 10, 0.92);
  --gold: #C8A96E;
  --gold-light: #d4ba85;
  --gold-dark: #a8894e;
  --gold-glow: rgba(200, 169, 110, 0.15);
  --gold-border: rgba(200, 169, 110, 0.2);
  --text-primary: #f5f0eb;
  --text-secondary: #a0988e;
  --text-muted: #6b6560;
  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --transition: 0.25s ease;
}

/* ---------- RESET ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-secondary); }
.text-small { font-size: 0.85rem; }
.text-center { text-align: center; }

/* ---------- LAYOUT ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.container-xs { max-width: 560px; margin: 0 auto; padding: 0 1.5rem; }
.page-content { padding: 6rem 0 3rem; min-height: 100vh; }
.section { padding: 4rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 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: 1.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 1rem 2rem;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-overlay);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-border);
}
.nav-logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.nav-logo img { height: 42px; }
.nav-logo span { font-family: var(--font-heading); font-size: 1.1rem; color: var(--text-primary); letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 400; letter-spacing: 0.3px; transition: color var(--transition); }
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-user { display: flex; align-items: center; gap: 1rem; }
.nav-cart { position: relative; color: var(--text-secondary); font-size: 1.2rem; }
.nav-cart .badge { position: absolute; top: -6px; right: -8px; background: var(--gold); color: var(--bg-primary); font-size: 0.65rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; }
.mobile-nav { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-primary); z-index: 999; flex-direction: column; align-items: center; justify-content: center; gap: 2rem; }
.mobile-nav.open { display: flex; }
.mobile-nav a { font-family: var(--font-heading); font-size: 1.5rem; color: var(--text-primary); }
.mobile-nav .close-btn { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; color: var(--text-primary); font-size: 2rem; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; border-radius: var(--radius-sm); font-weight: 500;
  font-size: 0.9rem; border: none; transition: all var(--transition); letter-spacing: 0.3px;
}
.btn-primary { background: var(--gold); color: var(--bg-primary); }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); box-shadow: 0 4px 20px var(--gold-glow); }
.btn-secondary { background: transparent; color: var(--gold); border: 1px solid var(--gold-border); }
.btn-secondary:hover { border-color: var(--gold); background: var(--gold-glow); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); }
.btn-danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.3); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.25); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
.card-gold { border-color: var(--gold-border); background: linear-gradient(135deg, var(--bg-card) 0%, rgba(200, 169, 110, 0.05) 100%); }
.card-gold:hover { border-color: var(--gold); box-shadow: 0 0 30px var(--gold-glow); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.card-img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1rem; }

/* ---------- FORMS ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.4rem; font-weight: 500; }
.form-input {
  width: 100%; padding: 0.75rem 1rem; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.95rem; transition: border-color var(--transition);
}
.form-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { min-height: 120px; resize: vertical; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0988e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

/* Checkbox + Radio */
.form-check { display: flex; align-items: flex-start; gap: 0.75rem; cursor: pointer; }
.form-check input[type="checkbox"], .form-check input[type="radio"] {
  appearance: none; width: 20px; height: 20px; min-width: 20px;
  border: 1px solid var(--border-light); border-radius: 4px;
  background: var(--bg-input); cursor: pointer; position: relative; margin-top: 2px;
}
.form-check input[type="radio"] { border-radius: 50%; }
.form-check input:checked { background: var(--gold); border-color: var(--gold); }
.form-check input:checked::after { content: '✓'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--bg-primary); font-size: 12px; font-weight: 700; }

/* Toggle switch */
.toggle { position: relative; width: 48px; height: 26px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 13px; cursor: pointer; transition: var(--transition);
}
.toggle-slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 2px; bottom: 2px; background: var(--text-secondary); border-radius: 50%; transition: var(--transition); }
.toggle input:checked + .toggle-slider { background: var(--gold-glow); border-color: var(--gold); }
.toggle input:checked + .toggle-slider::before { transform: translateX(22px); background: var(--gold); }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tab-btn {
  padding: 0.75rem 1.5rem; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; white-space: nowrap;
  transition: all var(--transition); cursor: pointer;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- BADGES ---------- */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-gold { background: var(--gold-glow); color: var(--gold); }
.badge-success { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge-info { background: rgba(96, 165, 250, 0.15); color: var(--info); }

/* ---------- TABLES ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.75rem 1rem; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); }
td { padding: 0.75rem 1rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px);
  z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; padding: 2rem;
}
.modal-lg { max-width: 800px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--text-primary); }

/* ---------- TOAST ---------- */
.toast-container { position: fixed; top: 5rem; right: 1.5rem; z-index: 3000; display: flex; flex-direction: column; gap: 0.75rem; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem 1.5rem;
  min-width: 300px; display: flex; align-items: center; gap: 0.75rem;
  box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-info { border-left: 3px solid var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- CALENDAR ---------- */
.calendar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.calendar-header h3 { font-family: var(--font-heading); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar-day-label { font-size: 0.75rem; color: var(--text-muted); padding: 0.5rem; font-weight: 600; }
.calendar-day {
  padding: 0.6rem; border-radius: var(--radius-sm); font-size: 0.9rem;
  cursor: pointer; transition: all var(--transition); border: 1px solid transparent;
}
.calendar-day:hover { background: var(--gold-glow); border-color: var(--gold-border); }
.calendar-day.selected { background: var(--gold); color: var(--bg-primary); font-weight: 600; }
.calendar-day.disabled { color: var(--text-muted); cursor: not-allowed; opacity: 0.4; }
.calendar-day.today { border-color: var(--gold-border); }

/* Time slots */
.time-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.5rem; }
.time-slot {
  padding: 0.6rem; text-align: center; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer; transition: all var(--transition);
}
.time-slot:hover { border-color: var(--gold-border); background: var(--gold-glow); }
.time-slot.selected { background: var(--gold); color: var(--bg-primary); border-color: var(--gold); font-weight: 600; }
.time-slot.unavailable { opacity: 0.3; cursor: not-allowed; }

/* ---------- CHAT ---------- */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 10rem); }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-bubble { max-width: 75%; padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.9rem; line-height: 1.5; }
.chat-bubble.sent { align-self: flex-end; background: var(--gold); color: var(--bg-primary); border-bottom-right-radius: 4px; }
.chat-bubble.received { align-self: flex-start; background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.25rem; }
.chat-input-wrap { display: flex; gap: 0.75rem; padding: 1rem; border-top: 1px solid var(--border); background: var(--bg-card); }
.chat-input { flex: 1; }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 85vh; display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover; background-position: center;
  filter: brightness(0.3);
}
.hero-content { position: relative; z-index: 1; max-width: 650px; padding: 2rem; }
.hero h1 { margin-bottom: 1rem; }
.hero p { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 2rem; line-height: 1.7; }

/* ---------- FEATURES GRID ---------- */
.feature-card { text-align: center; padding: 2rem 1.5rem; }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ---------- SECRET SERVICE (existing clients) ---------- */
.secret-service { border: 1px solid var(--gold) !important; background: linear-gradient(135deg, var(--bg-card) 0%, rgba(200, 169, 110, 0.08) 100%) !important; position: relative; }
.secret-service::before { content: '★ Exclusive'; position: absolute; top: 0.75rem; right: 0.75rem; background: var(--gold); color: var(--bg-primary); font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 20px; }

/* ---------- STEP INDICATOR ---------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 2rem; }
.step { display: flex; align-items: center; gap: 0.5rem; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 600; border: 2px solid var(--border);
  color: var(--text-muted); transition: all var(--transition);
}
.step.active .step-num { background: var(--gold); border-color: var(--gold); color: var(--bg-primary); }
.step.completed .step-num { background: var(--success); border-color: var(--success); color: var(--bg-primary); }
.step-label { font-size: 0.85rem; color: var(--text-muted); }
.step.active .step-label { color: var(--text-primary); }
.step-line { width: 60px; height: 2px; background: var(--border); margin: 0 0.5rem; }
.step.completed + .step-line { background: var(--success); }

/* ---------- BLOODWORK METER ---------- */
.meter { height: 8px; background: var(--bg-input); border-radius: 4px; overflow: hidden; margin: 0.5rem 0; position: relative; }
.meter-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.meter-optimal { background: var(--success); }
.meter-low { background: var(--warning); }
.meter-high { background: var(--danger); }
.meter-marker { position: absolute; top: -4px; width: 3px; height: 16px; background: var(--text-primary); border-radius: 2px; transform: translateX(-50%); }

/* ---------- CONSENT BANNER ---------- */
.consent-banner {
  background: linear-gradient(135deg, rgba(200, 169, 110, 0.1), rgba(200, 169, 110, 0.05));
  border: 1px solid var(--gold-border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 2rem;
}
.consent-banner h3 { color: var(--gold); margin-bottom: 0.5rem; }
.consent-banner p { color: var(--text-secondary); font-size: 0.9rem; }

/* ---------- PWA BANNER ---------- */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; width: 100%; z-index: 900;
  background: var(--bg-card); border-top: 1px solid var(--gold-border);
  padding: 1rem 1.5rem; display: none; align-items: center; justify-content: space-between;
}
.pwa-banner.show { display: flex; }

/* ---------- ADMIN SIDEBAR ---------- */
.admin-layout { display: flex; min-height: 100vh; padding-top: 4rem; }
.admin-sidebar {
  width: 240px; background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 1.5rem 0; position: fixed; top: 4rem; bottom: 0; overflow-y: auto;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.5rem;
  color: var(--text-secondary); font-size: 0.9rem; transition: all var(--transition);
}
.admin-sidebar a:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.admin-sidebar a.active { color: var(--gold); background: var(--gold-glow); border-right: 2px solid var(--gold); }
.admin-main { flex: 1; margin-left: 240px; padding: 2rem; }

/* ---------- STAT CARDS ---------- */
.stat-card { text-align: center; }
.stat-value { font-family: var(--font-heading); font-size: 2rem; color: var(--gold); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }

/* ---------- FOLLOW-UP QUEUE ---------- */
.followup-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 0.75rem; transition: all var(--transition);
}
.followup-item:hover { border-color: var(--gold-border); }
.followup-item.overdue { border-left: 3px solid var(--danger); }
.followup-info h4 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.followup-info p { font-size: 0.8rem; color: var(--text-secondary); }
.followup-actions { display: flex; gap: 0.5rem; }

/* ---------- LOADING ---------- */
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-overlay); z-index: 5000; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1rem; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { width: 200px; }
  .admin-main { margin-left: 200px; }
}
@media (max-width: 768px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .steps { flex-wrap: wrap; }
  .step-line { display: none; }
  .hero { min-height: 70vh; }
  .modal { margin: 0.5rem; padding: 1.5rem; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .card { padding: 1rem; }
  .btn-lg { padding: 0.75rem 1.5rem; }
  .time-slots { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- UTILITIES ---------- */
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.p-2 { padding: 1rem; } .p-3 { padding: 1.5rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
