﻿/* ============================================================
   BarberHub - Global Stylesheet
   Open index.html directly in any browser  no setup needed!
   ============================================================ */

:root {
  --primary:      #e94560;
  --primary-dark: #c73652;
  --bg:           #0f0f1a;
  --bg-card:      #1a1a2e;
  --bg-surface:   #16213e;
  --bg-elevated:  #1f2b4a;
  --text:         #f0f0f0;
  --text-muted:   #8896b3;
  --border:       #2a3a5c;
  --gold:         #f59e0b;
  --green:        #10b981;
  --red:          #ef4444;
  --radius:       12px;
  --radius-sm:    6px;
  --shadow:       0 4px 24px rgba(0,0,0,0.45);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/*  Layout  */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.page-wrap  { display: flex; flex-direction: column; min-height: 100vh; }
main        { flex: 1; }

/*  NAV  */
/* ============================================================
   NAVBAR — 3-column marketplace layout
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8, 8, 20, 0.97);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 0.65rem 0;
}

/* Left: logo + links */
.navbar__left {
  display: flex; align-items: center; gap: 1.5rem; flex-shrink: 0;
}

.navbar__logo {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}
.navbar__logo span { color: var(--primary); }
.navbar__logo:hover { text-decoration: none; }

.navbar__links { display: flex; align-items: center; }
.navbar__links a {
  color: var(--text-muted); font-size: 0.85rem; font-weight: 500;
  padding: 0.4rem 0.65rem; border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s; text-decoration: none; white-space: nowrap;
}
.navbar__links a:hover { color: var(--text); background: var(--bg-elevated); text-decoration: none; }
.navbar__links a.nav-active { color: var(--primary); }

/* Center: search bar */
.navbar__center { display: flex; align-items: center; justify-content: center; min-width: 0; }

.navbar__search-bar {
  display: flex; align-items: center;
  background: var(--bg-elevated); border: 1.5px solid var(--border);
  border-radius: 50px; overflow: hidden;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.navbar__search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233,69,96,0.12);
}
.navbar__search-icon { padding: 0 0.4rem 0 1rem; color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }
.navbar__search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 0.85rem; padding: 0.58rem 0.4rem;
  font-family: inherit; min-width: 0;
}
.navbar__search-input::placeholder { color: var(--text-muted); }
.navbar__search-divider { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; margin: 0 0.2rem; }
.navbar__city-select {
  background: none; border: none; outline: none;
  color: var(--text-muted); font-size: 0.8rem; padding: 0.58rem 0.5rem;
  cursor: pointer; font-family: inherit; flex-shrink: 0;
}
.navbar__search-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border: none; cursor: pointer;
  padding: 0.58rem 1.1rem; font-size: 0.8rem; font-weight: 700;
  font-family: inherit; transition: opacity 0.2s;
  display: flex; align-items: center; gap: 0.3rem;
  white-space: nowrap; border-radius: 0 50px 50px 0;
}
.navbar__search-btn:hover { opacity: 0.88; }

/* Right: icon buttons + user */
.navbar__right { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }

.navbar__icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.2s, color 0.2s; font-size: 0.9rem;
  color: var(--text-muted); text-decoration: none; font-family: inherit;
}
.navbar__icon-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.navbar__notif { position: relative; }
.navbar__notif-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; background: var(--primary); color: white;
  border-radius: 50px; font-size: 0.58rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg); padding: 0 2px;
}

.theme-toggle {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border);
  cursor: pointer; transition: border-color 0.2s; font-size: 0.9rem; color: var(--text-muted);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* User pill + dropdown */
.navbar__user {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 50px; padding: 0.25rem 0.75rem 0.25rem 0.3rem;
  cursor: pointer; position: relative;
}
.navbar__avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}
.navbar__dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 220px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.45); overflow: hidden; z-index: 200;
}
.navbar__user:hover .navbar__dropdown { display: block; }
.navbar__dropdown a, .navbar__dropdown button {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.7rem 1rem; color: var(--text-muted); font-size: 0.875rem;
  width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; font-family: inherit; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.navbar__dropdown a:hover, .navbar__dropdown button:hover {
  background: var(--bg-elevated); color: var(--text); text-decoration: none;
}
.navbar__dropdown .logout { color: var(--red); }
.navbar__dropdown .logout:hover { background: rgba(239,68,68,0.08); color: var(--red); }
.nav-sep { border: none; border-top: 1px solid var(--border); margin: 0.2rem 0; }

/* Hamburger (mobile only) */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 0.6rem; cursor: pointer;
  min-height: 44px; min-width: 44px; align-items: center; justify-content: center;
}
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

.mobile-menu {
  display: none; background: var(--bg-card); border-top: 1px solid var(--border); padding: 0.75rem 0;
}
.mobile-menu a, .mobile-menu button {
  display: block; padding: 0.75rem 1.25rem;
  color: var(--text-muted); font-size: 0.95rem;
  border: none; background: none; width: 100%; text-align: left;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.mobile-menu a:hover, .mobile-menu button:hover { color: var(--primary); text-decoration: none; }
.mobile-menu.open { display: block; }

/* Mobile search row inside menu */
.mobile-search-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 0.25rem;
}
.mobile-search-row input {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.6rem 0.75rem;
  color: var(--text); font-size: 0.875rem; font-family: inherit; outline: none;
}
.mobile-search-row input:focus { border-color: var(--primary); }

/* Search autocomplete suggestions */
.navbar__search-wrap { position: relative; width: 100%; max-width: 500px; }
.navbar__suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 500; overflow: hidden; max-height: 340px; overflow-y: auto;
  scrollbar-width: thin;
}
.navbar__sugg-group {
  padding: 0.4rem 0.9rem 0.15rem;
  font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}
.navbar__sugg-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.9rem; cursor: pointer; font-size: 0.875rem;
  color: var(--text-muted); transition: background 0.12s; text-decoration: none;
}
.navbar__sugg-item:hover, .navbar__sugg-item.nav-focused {
  background: var(--bg-elevated); color: var(--text); text-decoration: none;
}
.navbar__sugg-match { color: var(--primary); font-weight: 700; }
.navbar__sugg-rest { color: var(--text); }
.navbar__sugg-sub { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.navbar__sugg-empty { padding: 0.85rem 0.9rem; color: var(--text-muted); font-size: 0.875rem; text-align: center; }

/* Filter chips for barber discovery */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--bg-elevated); border: 1.5px solid var(--border);
  border-radius: 50px; padding: 0.38rem 0.85rem;
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all 0.18s; color: var(--text-muted); white-space: nowrap;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); background: rgba(233,69,96,0.06); }
.filter-chip.active { border-color: var(--primary); color: var(--primary); background: rgba(233,69,96,0.1); font-weight: 600; }

/*  BUTTONS  */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.4rem; border: none; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.2s; text-decoration: none;
  white-space: nowrap; min-height: 44px;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; box-shadow: 0 4px 14px rgba(233,69,96,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 6px 18px rgba(233,69,96,0.45);
  text-decoration: none; color: white;
}

.btn-ghost {
  background: var(--bg-elevated); color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--border); color: var(--text); text-decoration: none;
}

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

.btn-success { background: var(--green); color: white; }
.btn-danger  { background: var(--red);   color: white; }
.btn-sm      { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg      { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-block   { width: 100%; }

/*  CARDS  */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.45); border-color: rgba(233,69,96,0.25); }

/*  FORMS  */
.form-group  { margin-bottom: 1.1rem; }
.form-label  { display: block; margin-bottom: 0.35rem; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }

.form-control {
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 1rem; font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(233,69,96,0.15); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/*  STARS  */
.stars { display: inline-flex; gap: 1px; color: #4a5568; font-size: 0.95rem; }
.stars .filled { color: var(--gold); }

/*  BADGES  */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.6rem; border-radius: 50px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-pending   { background: rgba(245,158,11,0.15);  color: var(--gold);  border: 1px solid rgba(245,158,11,0.3); }
.badge-confirmed { background: rgba(16,185,129,0.15);  color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.badge-completed { background: rgba(99,102,241,0.15);  color: #818cf8;      border: 1px solid rgba(99,102,241,0.3); }
.badge-cancelled { background: rgba(239,68,68,0.15);   color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }
.badge-verified  { background: rgba(99,102,241,0.15);  color: #818cf8;      border: 1px solid rgba(99,102,241,0.3); }

/*  ALERTS  */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-error   { background: rgba(239,68,68,0.1);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.alert-danger  { background: rgba(239,68,68,0.1);  color: #f87171; border: 1px solid rgba(239,68,68,0.25); }
.alert-success { background: rgba(16,185,129,0.1); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.alert-info    { background: rgba(99,102,241,0.1); color: #818cf8; border: 1px solid rgba(99,102,241,0.25); }
.alert-warning { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }

/*  TABS  */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 2rem; overflow-x: auto; }
.tab-btn {
  padding: 0.75rem 1.25rem; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-muted);
  font-size: 0.875rem; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: all 0.2s; white-space: nowrap;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/*  SECTION  */
.section { padding: 4.5rem 0; }
.section-sm { padding: 2.5rem 0; }
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.5rem; }
.section-header p  { color: var(--text-muted); }

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

/*  BARBER CARD  */
.barber-card { cursor: pointer; display: block; text-decoration: none; color: inherit; }
.barber-card:hover { text-decoration: none; }

.bc-cover {
  height: 90px;
  background: linear-gradient(135deg, #1f2b4a 0%, #162140 100%);
  position: relative;
}

.bc-avatar {
  position: absolute; bottom: -28px; left: 1.1rem;
  width: 58px; height: 58px; border-radius: 50%;
  border: 3px solid var(--bg-card); overflow: hidden;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-weight: 800; color: white; font-size: 1.2rem;
}
.bc-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bc-body { padding: 2.2rem 1.1rem 1.1rem; }
.bc-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.2rem; display: flex; align-items: center; gap: 0.35rem; }
.bc-loc  { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.5rem; }

.bc-rating { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.6rem; font-size: 0.82rem; }
.bc-rating strong { font-size: 0.85rem; }
.bc-rating span   { color: var(--text-muted); }

.bc-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.75rem; }
.bc-tag  { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 50px; padding: 0.15rem 0.5rem; font-size: 0.7rem; color: var(--text-muted); }

.bc-footer { display: flex; align-items: center; justify-content: space-between; }
.bc-price  { font-size: 0.82rem; color: var(--text-muted); }
.bc-price strong { color: var(--text); }

.verified-check {
  width: 16px; height: 16px; border-radius: 50%;
  background: #6366f1; color: white; font-size: 0.55rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/*  EMPTY STATE  */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--text-muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state h3    { color: #8896b3; margin-bottom: 0.4rem; }

/*  LOADING  */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.75s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-box { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 4rem; color: var(--text-muted); }

/*  FOOTER  */
.footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.25rem; margin-top: auto;
}
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }
.footer__logo { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.6rem; }
.footer__logo span { color: var(--primary); }
.footer__tagline { color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }
.footer__heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.9rem; }
.footer__links { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.footer__links a { color: var(--text-muted); font-size: 0.875rem; }
.footer__links a:hover { color: var(--primary); text-decoration: none; }
.footer__bottom { border-top: 1px solid var(--border); padding-top: 1rem; display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.5rem; }

/*  PAGE HEADER  */
.page-header { background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-surface) 100%); border-bottom: 1px solid var(--border); padding: 2.25rem 0; margin-bottom: 2rem; }
.page-header h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.2rem; }
.page-header p  { color: var(--text-muted); }

/*  AUTH PAGE  */
.auth-wrap {
  min-height: calc(100vh - 140px);
  display: flex; align-items: center; justify-content: center; padding: 3rem 1rem;
}
.auth-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.25rem;
  width: 100%; max-width: 440px; box-shadow: var(--shadow);
}
.auth-logo { display: block; text-align: center; font-size: 1.25rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; text-decoration: none; }
.auth-card h2 { text-align: center; margin-bottom: 0.25rem; }
.auth-card .sub { text-align: center; color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.75rem; }
.auth-footer { text-align: center; margin-top: 1.1rem; color: var(--text-muted); font-size: 0.85rem; }

/* Role selector */
.role-sel { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }
.role-btn {
  background: var(--bg-elevated); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem 0.75rem;
  cursor: pointer; font-family: inherit; text-align: center;
  transition: all 0.2s;
}
.role-btn:hover   { border-color: var(--primary); }
.role-btn.active  { border-color: var(--primary); background: rgba(233,69,96,0.08); }
.role-btn .ri { font-size: 1.4rem; display: block; margin-bottom: 0.3rem; }
.role-btn .rl { display: block; font-weight: 700; font-size: 0.9rem; color: var(--text); }
.role-btn .rd { font-size: 0.73rem; color: var(--text-muted); }

/*  DASHBOARD  */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.5rem; }
.dash-stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.dash-stat .icon  { font-size: 1.25rem; margin-bottom: 0.25rem; }
.dash-stat .value { font-size: 1.6rem; font-weight: 800; }
.dash-stat .label { font-size: 0.78rem; color: var(--text-muted); }

/* Booking item */
.booking-item { padding: 1.1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.bi-left  { display: flex; align-items: center; gap: 0.85rem; flex: 1; min-width: 0; }
.bi-ava   { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; flex-shrink: 0; }
.bi-info strong { display: block; font-size: 0.9rem; }
.bi-info span   { color: var(--text-muted); font-size: 0.82rem; }
.bi-right { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* Schedule toggle */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 22px; cursor: pointer; transition: 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: white; bottom: 3px; left: 3px; transition: 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500; 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); padding: 1.75rem; width: 100%; max-width: 480px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 0.4rem; }
.modal .sub { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem; }

/* Admin table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-elevated); color: var(--text-muted); font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Utility */
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary); }
.text-sm     { font-size: 0.82rem; }
.text-lg     { font-size: 1.1rem; }
.fw-bold     { font-weight: 700; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem;  }
.mt-2 { margin-top: 1rem;    }
.mt-3 { margin-top: 1.5rem;  }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem;   }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Fade-in animation */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.35s ease-out; }

/*  Responsive  */
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 768px) {
  /* 1-column card grids on mobile */
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: repeat(2,1fr); }
  .footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }
  /* Navbar: collapse to logo + hamburger on mobile */
  .navbar__inner { grid-template-columns: auto auto; justify-content: space-between; gap: 0; }
  .navbar__left .navbar__links { display: none; }
  .navbar__center { display: none; }
  .navbar__right .navbar__icon-btn { display: none; }
  .navbar__right .theme-toggle { display: none; }
  .navbar__right .navbar__user { display: none; }
  .navbar__right .lang-switcher { display: none; }
  .navbar__right .navbar__notif { display: none; }
  .navbar__actions .btn:not(.hamburger):not(.theme-toggle) { display: none; }
  #curSwitcher { display: none; }
  #langSwitcher { display: none; }
  .navbar__user { display: none; }
  .hamburger { display: flex; }
  .section { padding: 2.5rem 0; }
  .section-header { margin-bottom: 1.5rem; }
  .auth-card { padding: 1.5rem; }
  .container { padding: 0 1rem; }
  .btn { white-space: normal; }
  .table-wrap > table { min-width: 560px; }
  /* Touch targets for filter chips and tabs */
  .quick-tag { min-height: 44px; padding: 0.55rem 1rem; font-size: 0.82rem; }
  .cat-chip  { min-height: 44px; padding: 0.55rem 1rem; }
  .tab-btn   { min-height: 44px; }
  .mobile-pill { min-height: 44px; padding: 0.4rem 1rem; }
  /* Images always responsive */
  img { max-width: 100%; height: auto; }
  .portfolio-add-grid { grid-template-columns: 1fr; }
  .portfolio-manager-item { grid-template-columns: 1fr; }
  .portfolio-manager-thumb { max-width: 140px; }
  .recent-work-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr; }
  .section { padding: 2rem 0; }
  .container { padding: 0 1rem; }
  /* Smallest screens: all buttons full touch target */
  .btn-sm { min-height: 44px; }
  .recent-work-list { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   LIGHT MODE
   ============================================================ */
.light-mode {
  --bg:          #eceae5;
  --bg-card:     #c4c2be;
  --bg-surface:  #f3e5ca;
  --bg-elevated: #eee7db;
  --text:        #1f2933;
  --text-muted:  #5f6b76;
  --border:      #d8cfbf;
  --shadow:      0 6px 20px rgba(36,29,19,0.10);
}
.light-mode .navbar {
  background: rgba(219, 218, 216, 0.92);
}
.light-mode .bc-cover {
  background: linear-gradient(135deg, #e5d8bf 0%, #d8c8aa 100%);
}
.light-mode .hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/*  Language Switcher  */
.lang-switcher { position: relative; }
.lang-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.3rem 0.65rem;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  color: var(--text); font-family: inherit;
  display: flex; align-items: center; gap: 0.3rem;
  transition: background 0.15s; white-space: nowrap;
}
.lang-btn:hover { background: var(--border); }
.lang-menu {
  display: block; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 160px;
  box-shadow: var(--shadow); z-index: 300; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.lang-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.lang-opt {
  display: block; width: 100%; padding: 0.6rem 1rem;
  background: none; border: none; text-align: left;
  font-size: 0.85rem; cursor: pointer; font-family: inherit;
  color: var(--text-muted); transition: background 0.15s;
}
.lang-opt:hover  { background: var(--bg-elevated); color: var(--text); }
.lang-opt.active { color: var(--primary); font-weight: 700; background: rgba(233,69,96,0.06); }

/*  Theme Toggle Button  */
.theme-toggle {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--border); transform: rotate(20deg); }

/* Hide theme toggle on tablet/mobile to reduce top-nav crowding */
@media (max-width: 1024px) {
  .navbar__right .theme-toggle { display: none !important; }
}

/*  Barber Card Enhancements  */
.bc-social-proof {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(0,0,0,0.65); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  padding: 0.2rem 0.5rem; border-radius: 50px;
  backdrop-filter: blur(4px);
}
.bc-next-avail {
  font-size: 0.78rem; margin-bottom: 0.5rem;
}
.bc-next-avail strong { font-weight: 700; }

/*  Search Autocomplete  */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); z-index: 200;
  max-height: 260px; overflow-y: auto;
  box-shadow: var(--shadow);
}
.autocomplete-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 1rem; cursor: pointer;
  font-size: 0.875rem; transition: background 0.15s;
}
.autocomplete-item:hover { background: var(--bg-elevated); }
.autocomplete-item .ac-icon { font-size: 1rem; flex-shrink: 0; }
.autocomplete-item .ac-name { font-weight: 600; }
.autocomplete-item .ac-sub  { font-size: 0.75rem; color: var(--text-muted); }

/*  View Toggle (Grid / Map)  */
.view-toggle {
  display: flex; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-btn {
  padding: 0.4rem 0.85rem; font-size: 0.8rem; font-weight: 600;
  border: none; background: none; cursor: pointer; font-family: inherit;
  color: var(--text-muted); transition: all 0.15s; display: flex; align-items: center; gap: 0.35rem;
}
.view-btn.active { background: var(--primary); color: white; }

/*  Map Container  */
#barberMap {
  height: 520px; border-radius: var(--radius);
  border: 1px solid var(--border); display: none;
}
#barberMap.show { display: block; }
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }

/*  Service Categories  */
.svc-category-header {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--text-muted); font-weight: 700;
  margin: 1.25rem 0 0.6rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.svc-category-icon { font-size: 1rem; }
.cat-filter-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.cat-chip {
  padding: 0.3rem 0.85rem; border-radius: 50px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  font-size: 0.78rem; cursor: pointer; font-family: inherit;
  color: var(--text-muted); transition: all 0.15s;
}
.cat-chip:hover  { border-color: var(--primary); color: var(--primary); }
.cat-chip.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }

/*  Photo Lightbox  */
.lightbox-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.92); z-index: 1000;
  align-items: center; justify-content: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img {
  max-width: 90vw; max-height: 82vh;
  border-radius: var(--radius); object-fit: contain;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7);
}
.lightbox-close {
  position: fixed; top: 1.25rem; right: 1.5rem;
  background: rgba(255,255,255,0.1); border: none; color: white;
  font-size: 1.5rem; width: 42px; height: 42px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); border: none; color: white;
  font-size: 1.5rem; width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); transition: background 0.2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-caption {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.7); color: white; font-size: 0.875rem;
  padding: 0.4rem 1rem; border-radius: 50px; backdrop-filter: blur(8px);
  white-space: nowrap;
}
.lightbox-counter {
  position: fixed; top: 1.25rem; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.6); color: white; font-size: 0.78rem;
  padding: 0.25rem 0.75rem; border-radius: 50px; backdrop-filter: blur(8px);
}
.portfolio-thumb {
  cursor: pointer; border-radius: var(--radius-sm);
  aspect-ratio: 1; object-fit: cover; width: 100%;
  transition: transform 0.2s, opacity 0.2s;
  border: 2px solid transparent;
}
.portfolio-thumb:hover { transform: scale(1.03); opacity: 0.9; border-color: var(--primary); }

/*  Portfolio Manager (barber dashboard)  */
.portfolio-manager-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.portfolio-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.portfolio-add-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0.65rem;
  margin-top: 0.85rem;
}
.portfolio-manager-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.portfolio-manager-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.7rem;
}
.portfolio-manager-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.portfolio-manager-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.portfolio-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/*  Recent work preview strip (profile page)  */
.recent-work-strip {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.recent-work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.recent-work-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.recent-work-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--bg-elevated);
}
.recent-work-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.recent-work-item:hover img {
  transform: scale(1.03);
  opacity: 0.92;
}
.recent-work-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.3rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*  Custom Calendar  */
.cal-wrap { max-width: 340px; }
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.cal-header strong { font-size: 0.95rem; }
.cal-nav-btn {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; color: var(--text);
  transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--border); }
.cal-grid {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 3px;
}
.cal-dow {
  text-align: center; font-size: 0.65rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  padding: 0.3rem 0;
}
.cal-day {
  text-align: center; padding: 0.45rem 0;
  font-size: 0.82rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s; position: relative;
  border: 1px solid transparent;
}
.cal-day:hover:not(.cal-day--disabled):not(.cal-day--closed) {
  background: var(--bg-elevated); border-color: var(--primary);
}
.cal-day--today { font-weight: 700; color: var(--primary); }
.cal-day--selected {
  background: var(--primary) !important; color: white !important;
  border-color: var(--primary) !important; font-weight: 700;
}
.cal-day--disabled {
  opacity: 0.3; cursor: not-allowed;
}
.cal-day--closed {
  opacity: 0.25; cursor: not-allowed; text-decoration: line-through;
}
.cal-day--busy::after {
  content: ''; position: absolute; bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.cal-day--empty { visibility: hidden; cursor: default; }
.cal-legend { display: flex; gap: 1rem; margin-top: 0.75rem; font-size: 0.72rem; color: var(--text-muted); }
.cal-legend span { display: flex; align-items: center; gap: 0.3rem; }

/*  Recurring Booking  */
.recurring-opts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.recur-btn {
  padding: 0.35rem 0.85rem; border-radius: 50px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  font-size: 0.8rem; cursor: pointer; font-family: inherit;
  color: var(--text-muted); transition: all 0.15s;
}
.recur-btn.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }

/*  Waitlist  */
.waitlist-box {
  background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius); padding: 1.25rem;
  text-align: center; margin-top: 1rem;
}
.waitlist-box h4 { color: var(--gold); margin-bottom: 0.4rem; font-size: 0.95rem; }
.waitlist-box p  { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.85rem; }

/*  Review Reply  */
.review-reply {
  background: var(--bg-elevated); border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.6rem 0.85rem; margin-top: 0.6rem; font-size: 0.82rem;
  color: var(--text-muted);
}
.review-reply strong { color: var(--primary); font-size: 0.75rem; display: block; margin-bottom: 0.2rem; }
.review-reply-form { margin-top: 0.75rem; display: none; }
.review-reply-form.open { display: block; }

/*  Promo Banner  */
.promo-banner {
  background: linear-gradient(90deg, var(--primary) 0%, #c73652 100%);
  color: white; text-align: center;
  padding: 0.6rem 1rem; font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  position: relative;
}
.promo-banner a { color: white; font-weight: 700; text-decoration: underline; }
.promo-banner__close {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.2); border: none; color: white;
  border-radius: 50%; width: 22px; height: 22px; cursor: pointer;
  font-size: 0.75rem; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.promo-banner__close:hover { background: rgba(255,255,255,0.35); }

/*  Nav Search  */
.nav-search { position: relative; }
.nav-search__btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem; cursor: pointer; color: var(--text-muted);
  font-size: 0.9rem; transition: all 0.15s; line-height: 1;
}
.nav-search__btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(233,69,96,0.06); }
.nav-search__expanded {
  display: none; gap: 0.5rem; align-items: center;
  padding: 0.6rem 0; border-top: 1px solid var(--border);
}
.nav-search__expanded input {
  flex: 1; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem 0.75rem;
  color: var(--text); font-size: 1rem; font-family: inherit; outline: none;
}
.nav-search__expanded input:focus { border-color: var(--primary); }

/*  Mobile nav pills (lang + currency in one row)  */
.mobile-menu__row {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  padding: 0.6rem 1.25rem; border-top: 1px solid var(--border); margin-top: 0.25rem;
}
.mobile-pill {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 50px;
  color: var(--text-muted); font-size: 0.78rem; padding: 0.2rem 0.65rem;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.mobile-pill:hover  { border-color: var(--primary); color: var(--primary); }
.mobile-pill.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 700; }
.mobile-divider { color: var(--border); font-size: 1.1rem; margin: 0 0.15rem; }

/*  404 page  */
.page-404 {
  min-height: 70vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 3rem 1rem;
}
.page-404__icon { font-size: 5rem; margin-bottom: 1.5rem; opacity: 0.7; }
.page-404 h1 { font-size: 6rem; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 0.5rem; }
.page-404 h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.page-404 p  { color: var(--text-muted); max-width: 400px; margin-bottom: 2rem; }
.page-404__links { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/*  Print styles  */
@media print {
  .navbar, .footer, .btn, .booking-actions, nav, .promo-banner { display: none !important; }
  body { background: white !important; color: black !important; }
  .book-confirm-card { box-shadow: none !important; border: 1px solid #ccc !important; }
  a { color: black !important; }
}
