/* Shared UI components. Page layouts live in each page's scoped .razor.css. */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  border: 1px solid transparent; border-radius: var(--radius-md);
  background: var(--surface-2); color: var(--text);
  font-size: var(--text-sm); font-weight: 700; line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn i { font-size: .95em; }

.btn-primary { background: var(--brand-gradient); color: var(--on-primary); box-shadow: 0 6px 18px -6px var(--glow-gold); }
.btn-primary:hover:not(:disabled) { background: var(--brand-gradient); filter: brightness(1.08); box-shadow: 0 10px 26px -8px var(--glow-gold); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.btn-soft { background: var(--primary-soft); color: var(--primary-soft-text); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--primary-soft) 80%, var(--primary) 20%); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger-text); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger-bg) 75%, var(--danger) 25%); }
.btn-link { min-height: 0; padding: 0; background: none; color: var(--accent-text); border: 0; }
.btn-link:hover:not(:disabled) { background: none; text-decoration: underline; }

.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg { min-height: 52px; padding: 0 var(--space-6); font-size: var(--text-base); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }

/* ---------- Form fields ---------- */
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field-label { font-size: var(--text-sm); font-weight: 700; color: var(--text); }
.field-hint { font-size: var(--text-xs); color: var(--text-3); line-height: 1.7; }
.input, .select, .textarea {
  width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--text);
  font-size: var(--text-base); line-height: 1.6;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--text-2); cursor: not-allowed; }
.input[dir="ltr"], .input[type="email"] { text-align: left; font-feature-settings: normal; }
.textarea { resize: vertical; min-height: 96px; }
.select {
  appearance: none; cursor: pointer; padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366726b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center;
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group > i { position: absolute; inset-inline-start: 14px; color: var(--text-3); pointer-events: none; }
.input-group > .input { padding-inline-start: 40px; }

.check { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; font-size: var(--text-sm); }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); cursor: pointer; }

/* Toggle switch: <label class="switch"><input type="checkbox"><span></span> text</label> */
.switch { display: flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span:first-of-type { position: relative; flex: none; width: 44px; height: 26px; border-radius: var(--radius-full); background: var(--border-strong); transition: background var(--normal) var(--ease); }
.switch > span:first-of-type::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start var(--normal) var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { inset-inline-start: 21px; }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Chips & segmented control ---------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full);
  background: var(--surface); color: var(--text);
  font-size: var(--text-sm); font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.chip:hover { border-color: var(--text-3); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip i { font-size: .9em; }
.chip-row { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.chip-row::-webkit-scrollbar { display: none; }

.segmented { display: inline-flex; max-width: 100%; padding: 4px; gap: 4px; overflow-x: auto; scrollbar-width: none; border-radius: var(--radius-md); background: var(--surface-2); }
.segmented::-webkit-scrollbar { display: none; }
.segmented > button { flex: none; white-space: nowrap; }
.segmented button {
  min-height: 36px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font-size: var(--text-sm); font-weight: 700;
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.segmented button[aria-selected="true"], .segmented button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented.block { display: flex; }
.segmented.block button { flex: 1; justify-content: center; }

/* ---------- Tags, badges and status ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-2); font-size: var(--text-xs); font-weight: 600; line-height: 1.9; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 800; }
.badge-soft { background: var(--surface-3); color: var(--text-2); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: 700; line-height: 1.9; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.confirmed { background: var(--success-bg); color: var(--success-text); }
.status.pending { background: var(--warning-bg); color: var(--warning-text); }
.status.cancelled, .status.rejected { background: var(--danger-bg); color: var(--danger-text); }
.status.completed { background: var(--info-bg); color: var(--info-text); }
.verified { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: 10px; flex: none; }

.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--text-sm); }
.rating i { color: var(--star); font-size: .85em; }
.rating small { color: var(--text-2); font-weight: 500; }
.rating-new { padding: 1px 8px; border-radius: var(--radius-full); background: var(--success-bg); color: var(--success-text); font-size: var(--text-xs); }
.rating-new i { color: inherit; }

/* ---------- Avatar ---------- */
.avatar {
  --size: 48px;
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-soft-text);
  font-size: calc(var(--size) * .34); font-weight: 800; line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.square { border-radius: var(--radius-lg); }

/* ---------- Cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-pad { padding: var(--space-6); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.card-head h2 { font-size: var(--text-lg); }
.card-head p { color: var(--text-2); font-size: var(--text-sm); margin-top: 2px; }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--space-5) 0; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.section-head h2 { font-size: var(--text-2xl); }
.section-head p { color: var(--text-2); margin-top: 4px; }

/* Empty, loading and error states */
.empty-state { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-12) var(--space-6); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty-state > i { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 22px; }
.empty-state h3 { font-size: var(--text-lg); }
.empty-state p { color: var(--text-2); max-width: 420px; font-size: var(--text-sm); }
.empty-state .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); margin-top: var(--space-2); }

.spinner { width: 20px; height: 20px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-12); color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(-100%); } }

.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: var(--text-sm); line-height: 1.8; }
.alert-info { background: var(--info-bg); color: var(--info-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }

/* ---------- Dialog / bottom sheet ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: var(--z-overlay); display: grid; place-items: center; padding: var(--space-6); background: var(--overlay); animation: fade-in var(--normal) var(--ease); }
.dialog {
  position: relative; width: min(560px, 100%); max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain;
  padding: var(--space-6); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-lg);
  animation: dialog-in var(--normal) var(--ease);
}
.dialog-head { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-5); }
.dialog-head h2 { font-size: var(--text-xl); flex: 1; }
.dialog-head p { color: var(--text-2); font-size: var(--text-sm); }
.dialog-foot { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-6); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 640px) {
  .dialog-backdrop { place-items: end stretch; padding: 0; }
  .dialog { width: 100%; max-height: 92dvh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-5) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom)); animation-name: sheet-in; }
  .dialog::before { content: ""; display: block; width: 40px; height: 4px; margin: -8px auto 12px; border-radius: 4px; background: var(--border-strong); }
  .dialog-foot { flex-direction: column-reverse; }
  .dialog-foot .btn { width: 100%; }
  @keyframes sheet-in { from { transform: translateY(100%); } }
}

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: var(--z-toast); bottom: 24px; inset-inline-end: 24px; display: grid; gap: var(--space-2); width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: var(--text-sm); line-height: 1.8; pointer-events: auto; animation: dialog-in var(--normal) var(--ease); }
.toast > i { margin-top: 5px; }
.toast.success > i { color: #8fd3a1; }
.toast.error > i, .toast.warning > i { color: #f2b56b; }
.toast span { flex: 1; }
.toast button { flex: none; width: 28px; height: 28px; margin: -2px; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .7; }
.toast button:hover { opacity: 1; background: rgb(255 255 255 / .12); }
[data-theme="dark"] .toast.success > i { color: #2c6b3d; }
[data-theme="dark"] .toast.error > i, [data-theme="dark"] .toast.warning > i { color: #9a5a16; }
@media (max-width: 760px) { .toast-stack { inset-inline: 16px; width: auto; } }

/* ---------- Theme toggle ---------- */
.theme-toggle .theme-sun { display: none; }
[data-theme="dark"] .theme-toggle .theme-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle .theme-moon { display: none; }

/* ---------- Splash ---------- */
.app-splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--space-4); padding: var(--space-8); text-align: center; background: var(--bg); }
.app-splash img { border-radius: 24px; }
.app-splash h1 { font-size: var(--text-xl); }
.app-splash p { color: var(--text-2); font-size: var(--text-sm); }
.splash-progress { width: 96px; height: 3px; border-radius: 3px; background: var(--border); overflow: hidden; }
.splash-progress::after { content: ""; display: block; width: 40%; height: 100%; background: var(--primary); animation: splash-slide 1.1s ease-in-out infinite alternate; }
@keyframes splash-slide { from { transform: translateX(150%); } to { transform: translateX(-100%); } }

/* ---------- Workspace (customer & professional panels) ---------- */
.ws { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; background: var(--bg); }
.ws-side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--space-6); padding: var(--space-5) var(--space-4); border-inline-end: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.ws-brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.ws-brand img { width: 36px; height: 36px; }
.ws-brand strong { display: block; font-size: var(--text-base); line-height: 1.3; }
.ws-brand small { color: var(--text-3); font-size: var(--text-xs); }
.ws-nav { display: grid; gap: 2px; }
.ws-nav-item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-2);
  font-size: var(--text-sm); font-weight: 600; text-align: start;
}
.ws-nav-item i { width: 20px; text-align: center; color: var(--text-3); }
.ws-nav-item span { flex: 1; }
.ws-nav-item:hover { background: var(--surface-2); color: var(--text); }
.ws-nav-item.is-active { background: var(--primary-soft); color: var(--primary-soft-text); font-weight: 800; }
.ws-nav-item.is-active i { color: var(--primary-soft-text); }
.ws-side-foot { margin-top: auto; display: grid; gap: var(--space-2); }
.ws-main { min-width: 0; display: flex; flex-direction: column; }
.ws-top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: var(--space-4); min-height: var(--header-h); padding: 0 var(--space-8); border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.ws-top h1 { font-size: var(--text-xl); flex: 1; }
.ws-user { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.ws-user strong { display: block; line-height: 1.3; }
.ws-user small { color: var(--text-3); font-size: var(--text-xs); }
.ws-content { width: 100%; max-width: 1080px; padding: var(--space-8); display: grid; gap: var(--space-6); align-content: start; }
.ws-tabs { display: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.stat { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.stat > i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-2); font-size: 18px; flex: none; }
.stat small { display: block; color: var(--text-2); font-size: var(--text-xs); }
.stat strong { font-size: var(--text-xl); line-height: 1.4; }
@media (max-width: 900px) {
  .ws { grid-template-columns: 1fr; }
  .ws-side { display: none; }
  .ws-top { padding: 0 var(--space-4); }
  .ws-tabs { display: flex; gap: var(--space-1); position: sticky; top: var(--header-h); z-index: var(--z-sticky); padding: var(--space-2) var(--space-4); overflow-x: auto; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--border); }
  .ws-tabs::-webkit-scrollbar { display: none; }
  .ws-tabs .ws-nav-item { width: auto; flex: none; min-height: 40px; }
  .ws-content { padding: var(--space-4) var(--space-4) var(--space-12); }
  .ws-user div { display: none; }
}

/* ---------- Leaflet essentials (kept local so the map works if the CDN stylesheet is blocked) ---------- */
/* isolation keeps Leaflet's internal z-indexes (400–1000) inside the map so they never cover the tab bar or dialogs. */
.leaflet-container { position: relative; isolation: isolate; z-index: 0; overflow: hidden; outline: 0; background: var(--surface-2); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
.leaflet-pane, .leaflet-tile, .leaflet-marker-icon, .leaflet-marker-shadow, .leaflet-tile-container, .leaflet-pane > svg, .leaflet-pane > canvas, .leaflet-zoom-box { position: absolute; top: 0; left: 0; }
.leaflet-container img.leaflet-tile { max-width: none !important; max-height: none !important; padding: 0; }
.leaflet-tile { visibility: hidden; user-select: none; -webkit-user-drag: none; }
.leaflet-tile-loaded { visibility: inherit; }
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-control { position: relative; z-index: 800; pointer-events: auto; float: left; clear: both; }
.leaflet-top, .leaflet-bottom { position: absolute; z-index: 1000; pointer-events: none; }
.leaflet-top { top: 0; } .leaflet-bottom { bottom: 0; } .leaflet-left { left: 0; } .leaflet-right { right: 0; }
.leaflet-right .leaflet-control { float: right; }
.leaflet-top .leaflet-control { margin-top: 12px; }
.leaflet-bottom .leaflet-control { margin-bottom: 12px; }
.leaflet-left .leaflet-control { margin-left: 12px; }
.leaflet-right .leaflet-control { margin-right: 12px; }
.leaflet-zoom-animated { transform-origin: 0 0; }
.leaflet-interactive { cursor: pointer; }
.leaflet-tooltip { position: absolute; pointer-events: none; white-space: nowrap; }
.leaflet-bar { border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow: hidden; }
.leaflet-bar a { display: block; width: 36px; height: 36px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 18px/36px Arial, sans-serif; text-align: center; }
.leaflet-bar a:last-child { border-bottom: 0; }
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-control-attribution { margin: 0; padding: 2px 8px; background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text-2); font-size: 10px; }
.leaflet-control-attribution a { color: var(--accent-text); }

.map-unavailable { display: grid; place-items: center; height: 100%; min-height: inherit; padding: var(--space-8); color: var(--text-2); background: var(--surface-2); font-size: var(--text-sm); text-align: center; }
.map-provider-error { max-width: 18rem; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); direction: rtl; font-size: var(--text-xs); }
.map-provider-error button { display: block; margin-top: 6px; padding: 4px 12px; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-primary); }
.map-device-location button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-md); background: var(--surface); color: #2563eb; box-shadow: var(--shadow-md); font-size: 17px; }
.map-device-location button:hover { background: var(--surface-2); }
.map-location-notice { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; max-width: min(22rem, calc(100vw - 96px)); margin: 10px 10px 0 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warning-text) 30%, transparent); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); direction: rtl; font-size: var(--text-xs); line-height: 1.9; }
.map-location-notice > i { margin-top: 4px; color: var(--warning-text); font-size: 15px; }
.map-location-notice > div { grid-column: 1 / -1; display: flex; gap: 6px; }
.map-location-notice button { padding: 5px 14px; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: var(--on-primary); font: inherit; font-weight: 700; }
.map-location-notice button.ghost { background: var(--surface-2); color: var(--text-2); }
.map-device-location button.is-busy i { animation: spin 1s linear infinite; }
[data-theme="dark"] .map-device-location button { color: #60a5fa; }

/* Location picker marker */
.aravira-map-marker { background: transparent; border: 0; }
.aravira-map-marker span { position: absolute; display: block; width: 30px; height: 30px; transform: rotate(45deg); border: 4px solid #fff; border-radius: 50% 50% 50% 6px; background: var(--primary); box-shadow: 0 6px 16px rgb(0 0 0 / .3); }
.aravira-map-marker span::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }

/* Professional pins: price/name pill like modern marketplaces */
.pro-pin {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px;
  border-radius: var(--radius-full); background: var(--surface); color: var(--text);
  box-shadow: 0 2px 10px rgb(0 0 0 / .22); font: 700 12px/1 var(--font); white-space: nowrap; direction: rtl;
  transition: transform var(--fast) var(--ease), background var(--fast), color var(--fast);
}
.pro-pin .pin-face { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--primary-soft); color: var(--primary-soft-text); font-size: 11px; }
.pro-pin .pin-face img { width: 100%; height: 100%; object-fit: cover; }
.pro-pin .pin-rating { color: var(--text-2); font-weight: 600; }
.pro-pin:hover, .pro-pin.is-active { background: var(--text); color: var(--surface); transform: scale(1.08); z-index: 10; }
.pro-pin:hover .pin-rating, .pro-pin.is-active .pin-rating { color: inherit; }
.leaflet-marker-icon.pin-active { z-index: 2000 !important; }
.pro-pin-host { background: transparent; border: 0; }
.search-center-pin { display: block; width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgb(59 130 246 / .2); }

.pro-map-tooltip { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.pro-map-tooltip::before { display: none; }
.pro-map-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-3); min-width: 15rem; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); direction: rtl; font-family: var(--font); }
.pro-map-card .avatar { --size: 48px; border-radius: var(--radius-md); }
.pro-map-card strong { display: block; font-size: var(--text-sm); }
.pro-map-card small { display: block; color: var(--text-2); font-size: var(--text-xs); }
.pro-map-card .rating { font-size: var(--text-xs); }


/* ---------- Atmosphere ---------- */
/* Gradient headline word */
.text-gradient { background: var(--text-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Slow-moving aurora blobs; place inside a positioned, overflow-hidden parent */
.aurora { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .9; animation: aurora-drift 22s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { top: -22vmax; inset-inline-end: -12vmax; background: var(--aurora-1); }
.aurora span:nth-child(2) { top: 0; inset-inline-start: -18vmax; background: var(--aurora-2); animation-duration: 28s; animation-delay: -6s; }
.aurora span:nth-child(3) { bottom: -30vmax; inset-inline-end: 20%; background: var(--aurora-3); animation-duration: 32s; animation-delay: -12s; }
@keyframes aurora-drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.12); } 100% { transform: translate(-4vmax, 7vmax) scale(.94); } }

/* Soft daylight behind every light page: faint sage and gold light instead of flat white */
:root:not([data-theme="dark"]) body {
  background:
    radial-gradient(70vmax 45vmax at 100% -15%, rgb(46 107 82 / .07), transparent 60%),
    radial-gradient(60vmax 40vmax at -15% 25%, rgb(214 181 108 / .09), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
:root:not([data-theme="dark"]) .card, :root:not([data-theme="dark"]) .stat {
  background: linear-gradient(180deg, rgb(255 255 255 / .55), transparent 50%), var(--surface);
}

/* Night sky behind every dark page */
[data-theme="dark"] body {
  background:
    radial-gradient(60vmax 40vmax at 100% -10%, rgb(16 185 129 / .14), transparent 60%),
    radial-gradient(50vmax 36vmax at -10% 20%, rgb(226 201 138 / .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="dark"] .card, [data-theme="dark"] .stat, [data-theme="dark"] .empty-state {
  background: linear-gradient(180deg, rgb(255 255 255 / .025), transparent 40%), var(--surface);
}
[data-theme="dark"] .chip[aria-pressed="true"], [data-theme="dark"] .chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--accent-soft); }
[data-theme="dark"] .verified { background: var(--brand-gradient); }
[data-theme="dark"] ::selection { background: rgb(226 201 138 / .35); }

/* Fade-up on first paint */
.rise { animation: rise .6s var(--ease) both; }
.rise-2 { animation-delay: .08s; } .rise-3 { animation-delay: .16s; } .rise-4 { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Map atmosphere ---------- */
/* Night map: invert the light raster tiles so the map matches the dark theme. */
[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.55); }
[data-theme="dark"] .leaflet-container { background: #0e1512; }

/* Current user: blue dot with a soft pulse */
.user-dot { position: relative; display: block; width: 22px; height: 22px; }
.user-dot::before { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: rgb(59 130 246 / .28); animation: user-pulse 2s ease-out infinite; }
.user-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(180deg, #60a5fa, #2563eb); border: 3px solid #fff; box-shadow: 0 2px 10px rgb(37 99 235 / .55); }
@keyframes user-pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }

/* On the full-screen map, messages appear under the search bar instead of over the bottom sheet. */
html:has(.map-app) .toast-stack { top: calc(env(safe-area-inset-top) + 124px); bottom: auto; }
[data-theme="dark"] .pro-pin:hover, [data-theme="dark"] .pro-pin.is-active { background: var(--brand-gradient); color: var(--on-primary); box-shadow: 0 6px 22px -4px var(--glow-gold); }

/* Day map: take the edge off bright white tiles so the map sits calmly in the warm light theme. */
:root:not([data-theme="dark"]) .leaflet-tile-pane { filter: sepia(.12) saturate(.9) brightness(.96); }

/* ---------- Horizontal scroller (Ui/HScroll + js/hscroll.js) ---------- */
.hscroll { position: relative; min-width: 0; }
.hscroll-track { overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; overscroll-behavior-x: contain; }
.hscroll-track::-webkit-scrollbar { display: none; }
/* Fade the edge that still has content behind it (RTL: start = right, end = left). */
.hscroll.can-next .hscroll-track { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 56px); mask-image: linear-gradient(to right, transparent 0, #000 56px); }
.hscroll.can-prev .hscroll-track { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 56px); mask-image: linear-gradient(to left, transparent 0, #000 56px); }
.hscroll.can-prev.can-next .hscroll-track { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%); }
.hs-btn {
  position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-md); font-size: 11px; cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(-50%) scale(.85);
  transition: opacity var(--normal) var(--ease), transform var(--normal) var(--ease), background var(--fast);
}
.hs-btn:hover { background: var(--surface-2); }
.hs-prev { inset-inline-start: 0; }
.hs-next { inset-inline-end: 0; }
.hscroll.can-prev .hs-prev, .hscroll.can-next .hs-next { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }

/* ───── Notifications: card, bell menu, live pop-up, push opt-in ───── */
.nc { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: start; }
.nc-avatar { position: relative; flex: none; }
.nc-avatar .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--nc-ring, var(--accent-soft)); }
.nc-kind { position: absolute; bottom: -2px; inset-inline-end: -4px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--nc-tone, var(--accent)); color: #fff; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
.nc-accent { --nc-tone: var(--accent); --nc-ring: color-mix(in srgb, var(--accent) 35%, transparent); }
.nc-success { --nc-tone: #2f8a57; --nc-ring: color-mix(in srgb, #2f8a57 35%, transparent); }
.nc-danger { --nc-tone: var(--danger); --nc-ring: color-mix(in srgb, var(--danger) 35%, transparent); }
.nc-muted { --nc-tone: var(--text-3); --nc-ring: var(--border); }
.nc-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.nc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.nc-head strong { font-size: var(--text-sm); font-weight: 800; color: var(--text); }
.nc-head small { flex: none; color: var(--text-3); font-size: 11px; }
.nc-body { color: var(--text-2); font-size: var(--text-xs); line-height: 1.9; }
.nc-reason { display: flex; gap: 6px; margin-top: 4px; padding: 6px 10px; border-radius: var(--radius-md); background: var(--danger-bg); color: var(--danger-text); font-size: var(--text-xs); line-height: 1.8; }
.nc-reason i { margin-top: 4px; }
.nc-dot { position: absolute; top: 6px; inset-inline-start: -10px; width: 8px; height: 8px; border-radius: 50%; background: var(--nc-tone, var(--accent)); }

.notif { position: relative; display: inline-flex; }
.notif-trigger { position: relative; }
.notif-trigger .fa-solid.fa-bell { color: var(--accent-text); animation: notif-ring 1.2s var(--ease) 1; }
.notif-badge { position: absolute; top: 4px; inset-inline-end: 2px; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-full); background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px var(--surface); }
.notif-scrim { position: fixed; inset: 0; z-index: calc(var(--z-overlay) - 1); }
.notif-panel { position: absolute; top: calc(100% + 8px); inset-inline-end: -8px; z-index: var(--z-overlay); display: flex; flex-direction: column; width: min(400px, calc(100vw - 24px)); max-height: min(560px, 80vh); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-lg); animation: dialog-in var(--normal) var(--ease); }
.notif-handle { display: none; }
.notif-head { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4) var(--space-4) var(--space-3); border-bottom: 1px solid var(--border); }
.notif-head h2 { flex: 1; font-size: var(--text-base); }
.notif-list { display: grid; align-content: start; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-2); }
.notif-item { display: block; width: 100%; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border: 0; border-radius: var(--radius-lg); background: transparent; color: inherit; transition: background var(--fast); }
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-2); }
.notif-item:has(.is-unread) { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.notif-item:has(.is-unread):hover { background: var(--accent-soft); }
.notif-empty { display: grid; justify-items: center; gap: 6px; padding: var(--space-10) var(--space-6); text-align: center; }
.notif-empty > span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); font-size: 22px; }
.notif-empty strong { font-size: var(--text-sm); }
.notif-empty small { color: var(--text-2); font-size: var(--text-xs); line-height: 1.9; }
.notif-optin { margin: var(--space-3) var(--space-3) 0; }

.push-optin { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.push-optin-icon { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; animation: notif-ring 2.4s var(--ease) infinite; }
.push-optin-text { display: grid; flex: 1; min-width: 0; }
.push-optin-text strong { font-size: var(--text-sm); }
.push-optin-text small { color: var(--text-2); font-size: var(--text-xs); line-height: 1.8; }
.push-hint { display: flex; gap: var(--space-2); margin: var(--space-3) var(--space-3) 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-2); font-size: var(--text-xs); line-height: 1.9; }
.push-hint i { margin-top: 4px; }

.notif-toasts { position: fixed; top: calc(env(safe-area-inset-top) + 16px); inset-inline-start: 16px; z-index: var(--z-toast); display: grid; gap: var(--space-2); width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.notif-toast { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); pointer-events: auto; animation: notif-in .45s cubic-bezier(.2, .9, .3, 1.2); }
.notif-toast-main { display: block; width: 100%; padding: var(--space-4) var(--space-4) var(--space-4) var(--space-10); border: 0; background: transparent; color: inherit; cursor: pointer; }
.notif-toast-close { position: absolute; top: 10px; inset-inline-end: 10px; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.notif-toast-timer { position: absolute; inset: auto 0 0 0; height: 3px; background: var(--accent); transform-origin: right; animation: notif-timer 9s linear forwards; }
.notif-toast:has(.nc-danger) .notif-toast-timer { background: var(--danger); animation-duration: 14s; }
.notif-toast:has(.nc-success) .notif-toast-timer { background: #2f8a57; }
.notif-toast:hover .notif-toast-timer { animation-play-state: paused; }
.notif-toast .nc-head strong { font-size: var(--text-base); }
.notif-toast .nc-body { font-size: var(--text-sm); }

@keyframes notif-in { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes notif-timer { to { transform: scaleX(0); } }
@keyframes notif-ring { 0%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-14deg); } 20%, 40% { transform: rotate(14deg); } 50% { transform: rotate(0); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .notif-trigger .fa-bell, .push-optin-icon, .notif-toast { animation: none !important; } }

/* backdrop-filter (and z-index) on a header would trap the fixed panel and scrim inside it; lift them while open. */
:is(.site-header, .ws-top, .map-topbar, header):has(.notif-panel) { z-index: var(--z-overlay) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; transform: none !important; }

/* Map home: the bell sits with the floating buttons */
.map-bell .notif-trigger { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

@media (max-width: 760px) {
  .notif-scrim { background: var(--overlay); animation: fade-in var(--normal); }
  .notif-panel { position: fixed; inset: auto 0 0 0; width: 100%; max-height: 85vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-up var(--normal) var(--ease); }
  .notif-handle { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--border-strong); }
}

/* Phones: every pop-up drops in from the top like an Instagram / iOS banner. Newest in front, older ones peek
   behind it; drag up or sideways to dismiss (swipe-dismiss.js), tap to open. */
@media (max-width: 760px) {
  .notif-toasts, .toast-stack, html:has(.map-app) .toast-stack {
    inset: calc(env(safe-area-inset-top) + 8px) 8px auto 8px; width: auto; bottom: auto;
    display: grid; grid-template-areas: "stack";
  }
  .notif-toasts > *, .toast-stack > * { grid-area: stack; align-self: start; }
  .notif-toast, .toast { touch-action: none; user-select: none; -webkit-user-select: none; animation: banner-drop .5s cubic-bezier(.2, 1.1, .3, 1); }
  .notif-toast { border-radius: 22px; box-shadow: 0 10px 30px -8px rgb(0 0 0 / .35), 0 0 0 1px var(--border); }
  .notif-toast-main { padding: 14px 16px 18px; }
  .notif-toast-close, .notif-toast-timer { display: none; }
  .notif-toast-grab { position: absolute; bottom: 6px; left: 50%; width: 36px; height: 4px; border-radius: 4px; background: var(--border-strong); transform: translateX(-50%); }
  .notif-toast .nc-head strong { font-size: var(--text-sm); }
  .notif-toast .nc-body { font-size: var(--text-xs); }
  .toast { border-radius: 18px; padding: 12px 16px; box-shadow: 0 10px 30px -8px rgb(0 0 0 / .4); }
  /* Older pop-ups tuck behind the newest one */
  .notif-toast:not(:last-child), .toast:not(:last-child) { transform: translateY(10px) scale(.94); opacity: .55; pointer-events: none; filter: saturate(.6); }
  .notif-toast:not(:last-child) .nc-text, .toast:not(:last-child) > span { visibility: hidden; }
  .is-dragging { cursor: grabbing; }
  /* Both kinds at the top: notifications win. */
  body:has(.notif-toast) .toast-stack { visibility: hidden; }
}
@media (min-width: 761px) { .notif-toast-grab { display: none; } }
@keyframes banner-drop { from { transform: translateY(-130%); opacity: .4; } }

/* ───── Men's / women's section: choice on the sign-up form ───── */
.gender-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.gender-pick button { display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font-weight: 700; transition: border-color var(--fast), background var(--fast); }
.gender-pick button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }


/* Narrow phones: the header keeps logo, section switch, theme and sign-in on one line */
@media (max-width: 430px) {
  .site-header .brand span { display: none !important; }
}

/* ───── Review dialog ───── */
.review-dialog { width: min(480px, 100%); }
.review-head { display: grid; justify-items: center; gap: 6px; margin-bottom: var(--space-4); text-align: center; }
.review-head h2 { font-size: var(--text-lg); }
.review-head p { color: var(--text-2); font-size: var(--text-xs); }
.review-stars { display: flex; justify-content: center; gap: var(--space-2); direction: ltr; }
.review-stars button { display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; color: var(--border-strong); font-size: 30px; transition: transform var(--fast), color var(--fast); }
.review-stars button.is-on { color: var(--star); }
.review-stars button:hover, .review-stars button:focus-visible { transform: scale(1.12); }
.review-label { min-height: 1.8em; margin: var(--space-1) 0 var(--space-4); color: var(--text-2); font-size: var(--text-sm); font-weight: 700; text-align: center; }
