/* ==========================================================================
   Beauty Salon Finder — Design System
   Palette is fixed by the brand brief. Typography is pulled directly from
   the logo itself: a high-contrast serif for "Beauty" (headlines here use
   Playfair Display) paired with a clean wide-tracked sans for "SALON
   FINDER" (DM Sans, used for UI/body + the uppercase label treatment).
   The rose-magenta swoosh under "Beauty" in the logo becomes this site's
   signature: a short curved accent rule under section headings.
   ========================================================================== */

@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/playfair-display-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/playfair-display-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('/assets/fonts/playfair-display-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* Brand palette — fixed by brief */
  --plum: #6D1B7B;
  --plum-dark: #55155F;
  --rose: #D62A7A;
  --blush: #FFF4F8;
  --ink: #191821;
  --white: #FFFFFF;
  --success: #16A36A;
  --warning: #F59E0B;
  --error: #DC2626;

  /* Derived neutrals (tinted toward plum, not flat gray, to stay in-family) */
  --border: #ECE3E9;
  --muted: #71697A;
  --surface: #FBF7F9;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(25, 24, 33, 0.04), 0 8px 24px -12px rgba(109, 27, 123, 0.18);
  --shadow-float: 0 24px 48px -16px rgba(109, 27, 123, 0.28);
  --container: 1200px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; }
a { color: var(--rose); text-decoration: none; }
a:hover { color: var(--plum); }

img { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.muted { color: var(--muted); }

/* Signature element: short curved accent rule, echoing the logo's swoosh
   under "Beauty". Used sparingly under section headings only. */
.section-heading { position: relative; padding-bottom: 14px; margin-bottom: 28px; }
.section-heading::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 56px; height: 4px;
  background: var(--rose);
  border-radius: 4px;
}
.section-heading.centered { text-align: center; }
.section-heading.centered::after { left: 50%; transform: translateX(-50%); }

/* ---------- Top announcement bar ---------- */
.topbar { background: var(--ink); color: rgba(255,255,255,0.85); font-size: 0.8rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; flex-wrap: wrap; gap: 6px; }
.topbar-links a { color: rgba(255,255,255,0.85); margin-left: 14px; }
.topbar-links a:hover { color: var(--white); }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--white); position: sticky; top: 0; z-index: 40; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 20px; }
.brand img { height: 36px; }
.main-nav-toggle-checkbox { display: none; }
.main-nav-menu-btn { display: none; font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 4px 8px; }

@media (max-width: 900px) {
  .main-nav-menu-btn { display: block; }
  .main-nav-collapsible {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
  }
  .main-nav-toggle-checkbox:checked ~ .header-inner .main-nav-collapsible { display: block; }
  .header-inner { position: relative; flex-wrap: wrap; }
  .main-nav { flex-direction: column; gap: 4px; align-items: flex-start; }
  .main-nav a { padding: 8px 0; width: 100%; }
  .header-actions { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
  .header-actions .btn { width: 100%; text-align: center; }
}
.main-nav { display: flex; gap: 24px; }
.main-nav a { color: var(--ink); font-weight: 500; font-size: 0.95rem; }
.main-nav a:hover { color: var(--rose); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.inline-form { display: inline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease, color .12s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--plum); color: var(--white); }
.btn-primary:hover { background: var(--plum-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--plum); border-color: var(--plum); }
.btn-outline:hover { background: var(--blush); color: var(--plum); }
.btn-block { width: 100%; }

/* ---------- Alerts / states ---------- */
.alert { padding: 12px 18px; border-radius: var(--radius-sm); margin: 16px auto; font-size: 0.92rem; }
.alert-success { background: #EAFBF3; color: #0F7A50; border: 1px solid #BFEFDA; }
.alert-error { background: #FDEEEE; color: #B91C1C; border: 1px solid #F6C6C6; }
.field-error { display: block; color: var(--error); font-size: 0.82rem; margin-top: 4px; }

.empty-state {
  text-align: center; padding: 48px 24px; background: var(--surface);
  border: 1px dashed var(--border); border-radius: var(--radius-md);
}
.empty-state p { color: var(--muted); margin-bottom: 16px; }

/* ---------- Hero ---------- */
.hero { background: var(--blush); padding: 64px 0 96px; }
.hero-inner { text-align: center; max-width: 760px; margin: 0 auto; }
.hero-sub { color: var(--muted); font-size: 1.1rem; margin-bottom: 32px; }

.search-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float); border-top: 4px solid var(--rose);
  padding: 22px; display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end;
  text-align: left;
}
.search-field { flex: 1 1 200px; }
.search-field label {
  display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.search-field input, .search-field select {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.95rem;
  background: var(--white); color: var(--ink);
}
.search-field input:focus, .search-field select:focus { border-color: var(--rose); outline: none; }
.search-btn { flex: 0 0 auto; padding: 13px 32px; }

/* ---------- Sections / grids ---------- */
.section { padding: 56px 0; }
.section-blush { background: var(--blush); }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.category-card {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 22px 14px; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--ink); font-weight: 600;
  transition: border-color .12s ease, transform .12s ease;
}
.category-card:hover { border-color: var(--rose); color: var(--plum); transform: translateY(-2px); }

.salon-card {
  display: block; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden; color: var(--ink);
  box-shadow: var(--shadow-card); transition: transform .15s ease;
}
.salon-card:hover { transform: translateY(-3px); color: var(--ink); }
.salon-card-img { height: 170px; background-size: cover; background-position: center; background-color: var(--blush); }
.salon-card-body { padding: 16px; }
.salon-card-body h3 { margin-bottom: 4px; }
.rating { color: var(--warning); font-weight: 600; font-size: 0.9rem; }

/* ---------- Forms ---------- */
.form { max-width: 480px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-field { flex: 1; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.form-field input {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--font-body); font-size: 0.95rem;
}
.form-field input:focus { border-color: var(--rose); outline: none; }
.auth-section { padding: 56px 0 88px; }
.auth-container { max-width: 480px; margin: 0 auto; background: var(--white); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
@media (max-width: 640px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 2px solid var(--border); padding: 8px 0; }
  .table td { border-bottom: none; padding: 4px 0; }
}

/* ---------- Salon detail ---------- */
.salon-cover { height: 260px; background-size: cover; background-position: center; background-color: var(--blush); }
.salon-detail-header { padding: 24px 20px 0; }
.salon-detail-body { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; padding: 24px 20px 64px; }
@media (max-width: 800px) { .salon-detail-body { grid-template-columns: 1fr; } }
.booking-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; position: sticky; top: 90px; }
.booking-card p { font-size: 0.88rem; }

/* ---------- Error pages ---------- */
.error-page { text-align: center; padding: 96px 20px; }
.error-page h1 { font-size: 4rem; color: var(--rose); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.75); margin-top: 40px; }
.footer-inner { padding: 40px 20px; text-align: center; }
.footer-inner img { margin: 0 auto 12px; filter: brightness(0) invert(1); opacity: 0.9; }
.footer-inner p { font-size: 0.85rem; margin: 0; }
.footer-links { margin-bottom: 12px !important; }
.footer-links a { color: rgba(255,255,255,0.75); }
.footer-links a:hover { color: var(--white); }

/* ==========================================================================
   Dashboard shell (layouts/admin.php, layouts/salon.php, and future
   staff/artist/advertiser dashboard layouts)
   Sidebar + topbar shell. Class names are prefixed "admin-" for
   historical reasons (this was written for the admin dashboard first)
   but every rule here is generic dashboard chrome - reused as-is by any
   role's dashboard layout rather than duplicated per role.
   Mobile toggle uses a checkbox (no extra JS) so it degrades safely with
   scripting disabled.
   ========================================================================== */
.admin-body { margin: 0; background: var(--surface); }
.admin-sidebar-checkbox { display: none; }

.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 240px; flex-shrink: 0; background: var(--ink); color: rgba(255,255,255,0.85);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  transform: translateX(-100%); transition: transform .2s ease; z-index: 50;
}
.admin-sidebar-brand { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar-brand img { filter: brightness(0) invert(1); }
.admin-nav { display: flex; flex-direction: column; padding: 12px; gap: 2px; flex: 1; }
.admin-nav a { color: rgba(255,255,255,0.78); padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.92rem; }
.admin-nav a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.admin-sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar-footer .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.35); }
.admin-sidebar-footer .btn-outline:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: var(--white); border-bottom: 1px solid var(--border); }
.admin-page-title { font-size: 1.2rem; margin: 0; }
.admin-menu-btn { display: inline-flex; cursor: pointer; font-size: 1.3rem; line-height: 1; user-select: none; }
.admin-content { padding: 20px; max-width: 1100px; }

/* Sidebar shown when the checkbox is checked (mobile) or always on desktop */
#admin-sidebar-toggle:checked ~ .admin-shell .admin-sidebar { transform: translateX(0); }
@media (min-width: 900px) {
  .admin-sidebar { transform: translateX(0); }
  .admin-main { margin-left: 240px; }
  .admin-menu-btn { display: none; }
}

.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.admin-stat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--ink);
}
.admin-stat-alert { border-color: var(--error); }
.admin-stat-number { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.admin-stat-label { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.admin-review-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; margin-top: 16px; }
@media (max-width: 800px) { .admin-review-grid { grid-template-columns: 1fr; } }

/* ---------- Messaging (customer + salon owner, shared) ---------- */
.conversation-list { max-width: 640px; }
.conversation-row { display: flex; justify-content: space-between; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; color: var(--ink); }
.conversation-row:hover { border-color: var(--rose); }
.conversation-row.is-unread { background: var(--blush); border-color: var(--rose); }
.unread-badge { background: var(--rose); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: 0.78rem; font-weight: 700; }

.message-thread { max-height: 460px; overflow-y: auto; padding: 16px; background: var(--surface); border-radius: var(--radius-md); margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.message-bubble { max-width: 75%; padding: 10px 14px; border-radius: var(--radius-md); background: var(--white); border: 1px solid var(--border); align-self: flex-start; }
.message-bubble.is-mine { align-self: flex-end; background: var(--plum); color: #fff; border-color: var(--plum); }
.message-bubble p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.message-meta { display: block; font-size: 0.72rem; opacity: 0.65; margin-top: 4px; }
.message-form { display: flex; gap: 10px; align-items: flex-end; }
.message-form textarea { flex: 1; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-body); resize: vertical; }

/* ---------- Ads ---------- */
.ad-banner { display: block; position: relative; border-radius: var(--radius-md); overflow: hidden; }
.ad-banner img { width: 100%; height: auto; display: block; }
.ad-banner-label { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; }
.ad-sidebar-card { display: block; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; position: relative; }
.ad-sidebar-card img { width: 100%; height: auto; display: block; }

/* ---------- Notifications ---------- */
.notification-list { max-width: 640px; }
.notification-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 8px; }
.notification-row.is-unread { background: var(--blush); border-color: var(--rose); }
.notification-icon { font-size: 1.3rem; line-height: 1; }
.header-bell { position: relative; display: inline-flex; align-items: center; padding: 8px 10px; }
.header-bell .bell-badge { position: absolute; top: 2px; right: 2px; background: var(--rose); color: #fff; border-radius: 999px; min-width: 16px; height: 16px; font-size: 0.65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

/* ---------- Reviews (public detail pages + salon dashboard) ---------- */
.review-card { padding: 16px 0; border-bottom: 1px solid var(--border); }
.review-card:last-child { border-bottom: none; }
.review-reply { margin-top: 10px; padding: 12px; background: var(--surface); border-radius: var(--radius-sm); }

/* ---------- Loading state (used by JS for future async actions) ---------- */
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px;
  margin: -8px 0 0 -8px; border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff;
  border-radius: 50%; animation: bsf-spin 0.6s linear infinite;
}
@keyframes bsf-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
