/* ==========================================================================
   VenueIQ — experience layer styles
   Extends public/css/style.css for the wayfinding, parking, dashboard,
   account, checkout and auth screens. Uses the same design tokens.
   ========================================================================== */

/* ------------------------------------------------------------ foundations */

.vx-focusable:focus-visible,
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.vx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.vx-stack { display: grid; gap: 12px; }
.vx-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.vx-row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.vx-muted { color: var(--text-muted); font-size: 13px; }
.vx-mb-0 { margin-bottom: 0; }

.vx-empty {
  text-align: center;
  padding: 32px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 14px;
}
.vx-empty .vx-empty-icon { font-size: 30px; display: block; margin-bottom: 8px; }
.vx-empty strong { display: block; color: var(--text); margin-bottom: 4px; }

.vx-flash {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.vx-flash-success { background: rgba(34, 197, 94, 0.1); color: #15803d; border-color: rgba(34, 197, 94, 0.3); }
.vx-flash-error { background: rgba(255, 107, 107, 0.1); color: #b91c1c; border-color: rgba(255, 107, 107, 0.3); }
.vx-flash-info { background: var(--gradient-soft); color: var(--text); border-color: var(--border); }

/* Field styling shared by auth, settings and checkout forms */
.vx-field { display: grid; gap: 6px; font-size: 13px; color: var(--text-muted); text-align: left; }
.vx-field > span { font-weight: 600; }
.vx-input,
.vx-field input,
.vx-field select,
.vx-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}
.vx-field input[type="checkbox"] { width: auto; }
.vx-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text); }
.vx-error { color: var(--danger); font-size: 12px; }
.vx-hint { color: var(--text-soft); font-size: 12px; }

/* --------------------------------------------------------------- map page */

.map-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.floor-tab { border: none; font-family: inherit; }
.floor-tabs { flex-wrap: wrap; }

.map-corridor { stroke: #cfd6e8; stroke-width: 14; stroke-linecap: round; fill: none; }
.map-corridor-inner { stroke: #f2f5ff; stroke-width: 8; stroke-linecap: round; fill: none; }
.map-node { fill: #b9c1d8; }
.map-node-label { font-size: 10px; fill: var(--text-muted); font-family: var(--font-body); }
.map-shop rect { fill: #eef0ff; stroke: #d8deea; stroke-width: 1.5; }
.map-shop:hover rect, .map-shop:focus rect { fill: #ded9ff; stroke: var(--primary); }
.map-shop.is-destination rect { fill: #d6fff8; stroke: var(--accent); stroke-width: 2.5; }
.map-shop text { font-size: 11px; font-weight: 600; fill: var(--text); font-family: var(--font-body); }
.map-service { font-size: 16px; }
.map-service-label { font-size: 9px; fill: var(--text-soft); font-family: var(--font-body); }

.map-route-line {
  fill: none;
  stroke: url(#pathGrad);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14 10;
  animation: vxDash 1.4s linear infinite;
}
@keyframes vxDash { to { stroke-dashoffset: -48; } }
.map-route-start { fill: var(--primary); stroke: white; stroke-width: 3; }
.map-route-end { fill: var(--accent); stroke: white; stroke-width: 3; }
.map-layout.is-loading .map-svg { opacity: 0.6; }

.step-body { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; flex: 1; }
.step-glyph { font-size: 14px; }
.step-text { flex: 1; min-width: 120px; }
.step-distance {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.direction-step.is-active { background: var(--gradient-soft); border-radius: 10px; padding: 10px 8px; }
.direction-step.is-active .step-num { box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.18); }
.direction-step.is-done { opacity: 0.55; }
.direction-step-empty .step-num { background: var(--surface-2); color: var(--text-muted); }

.map-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.map-legend span.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; vertical-align: -2px; margin-right: 6px; }

/* ---------------------------------------------------------------- AR page */

.ar-panel {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, 92%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  max-height: 62vh;
  overflow-y: auto;
}
.ar-panel h2 { font-size: 19px; }
.ar-steps {
  list-style: none;
  margin: 12px 0 0;
  max-height: 168px;
  overflow-y: auto;
  padding-right: 4px;
}
.ar-steps .direction-step { font-size: 13px; }
.ar-controls { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ar-controls .btn { flex: 1 1 120px; padding: 10px; font-size: 13px; }
.ar-fallback-note {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  max-width: 92%;
  text-align: center;
}
.ar-instruction-card {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(108, 92, 231, 0.95);
  color: #fff;
  padding: 12px 22px;
  border-radius: 18px;
  font-weight: 700;
  text-align: center;
  max-width: 92%;
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.5);
}
.ar-instruction-card small { display: block; font-weight: 500; opacity: 0.9; font-size: 11px; margin-top: 2px; }
.ar-distance-badge {
  position: absolute;
  top: 168px;
  right: 8%;
  background: rgba(0, 194, 184, 0.94);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 18px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 194, 184, 0.45);
}
.ar-distance-badge small { display: block; font-size: 11px; font-weight: 500; opacity: 0.9; }
.ar-select {
  background: rgba(255, 255, 255, 0.92);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  max-width: 220px;
}

/* ------------------------------------------------------------- dashboard */

.vx-range { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.vx-range a {
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.vx-range a.active { background: var(--gradient); color: #fff; }

.vx-heat-scroll { overflow-x: auto; }
.vx-heat-table { min-width: 520px; }
.vx-heat-row { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: center; margin-bottom: 6px; }
.vx-heat-cells { display: grid; grid-template-columns: repeat(13, 1fr); gap: 3px; }
.vx-heat-cells .heat-cell { position: relative; }
.vx-heat-legend { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--text-muted); margin-top: 10px; }
.vx-heat-legend i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

.vx-spark { width: 100%; height: 140px; display: block; }
.vx-spark-area { fill: rgba(108, 92, 231, 0.14); }
.vx-spark-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.vx-spark-dot { fill: var(--accent); }

.vx-meter { display: grid; gap: 8px; }
.vx-meter-row { display: grid; grid-template-columns: 110px 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.vx-meter-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.vx-meter-fill { height: 100%; background: var(--gradient); border-radius: 99px; }
.vx-meter-fill.alt { background: var(--gradient-2); }

.kpi-change.flat { color: var(--text-muted); }

/* ---------------------------------------------------------------- parking */

.parking-grid { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
.parking-slot { font-size: 11px; letter-spacing: 0.02em; border: 2px solid transparent; }
.parking-slot[disabled] { cursor: not-allowed; }
.parking-slot.blocked { background: repeating-linear-gradient(45deg, #e7e9f0, #e7e9f0 5px, #dcdfe9 5px, #dcdfe9 10px); color: var(--text-soft); }
.parking-slot.is-selected { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.18); transform: scale(1.06); }
.parking-slot.my-car::after { content: '📍'; position: absolute; top: -6px; right: -6px; font-size: 14px; }
.parking-legend { display: flex; gap: 10px; flex-wrap: wrap; }

.vx-ticket {
  background: var(--gradient);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 6px;
}
.vx-ticket .vx-ticket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 14px; margin-top: 10px; }
.vx-ticket small { opacity: 0.85; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.vx-ticket strong { font-size: 18px; }

/* ------------------------------------------------------------------ staff */

.alert-card.is-resolved { opacity: 0.5; }
.alert-state { font-size: 12px; color: var(--success); font-weight: 600; }

/* -------------------------------------------------------------- concierge */

.chat-clear { font-size: 12px; color: rgba(255, 255, 255, 0.9); background: rgba(255, 255, 255, 0.18); padding: 6px 12px; border-radius: 999px; }
.chat-msg a.btn { margin-top: 8px; display: inline-flex; }
.chat-time { display: block; font-size: 10px; opacity: 0.6; margin-top: 4px; }

/* ---------------------------------------------------------------- account */

.vx-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.vx-tabs a {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.vx-tabs a.active { background: var(--gradient); color: #fff; }
.vx-tabs a:hover { border-color: var(--primary); }

.vx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.vx-card + .vx-card { margin-top: 14px; }
.vx-card-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }

.vx-progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.vx-progress > div { height: 100%; background: var(--gradient); border-radius: 99px; }

.vx-lines { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.vx-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-muted); }
.vx-lines li strong { color: var(--text); }

.vx-ledger { list-style: none; display: grid; gap: 2px; }
.vx-ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.vx-ledger li:last-child { border-bottom: none; }
.vx-ledger .points-up { color: var(--success); font-weight: 700; }
.vx-ledger .points-down { color: var(--danger); font-weight: 700; }

.vx-notification { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--surface-2); }
.vx-notification.is-unread { background: var(--gradient-soft); border-left: 3px solid var(--primary); }
.vx-notification .vx-note-icon { font-size: 22px; }

.vx-pagination { margin-top: 20px; }
.vx-pagination nav { display: flex; justify-content: center; }
.vx-pagination svg { width: 16px; height: 16px; }
.vx-pagination a, .vx-pagination span { font-size: 13px; }

/* --------------------------------------------------------------- checkout */

.vx-checkout { max-width: 640px; margin: 0 auto; }
.vx-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; margin-top: 14px; border-top: 1px dashed var(--border); }
.vx-total strong { font-size: 26px; }
.vx-provider {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.vx-provider:has(input:checked) { border-color: var(--primary); background: var(--gradient-soft); }
.vx-provider input { margin-top: 3px; }

/* ------------------------------------------------------------------- auth */

.auth-links { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.auth-links a { color: var(--primary); font-weight: 600; }

@media (max-width: 720px) {
  .vx-meter-row { grid-template-columns: 90px 1fr 48px; }
  .ar-distance-badge { top: 150px; right: 5%; padding: 9px 14px; font-size: 16px; }
  .ar-panel { bottom: 12px; padding: 14px; }
  .map-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
  .vx-heat-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .vx-heat-table { min-width: 480px; }
  .vx-split, .vx-two-col {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-route-line { animation: none; }
}
