/* ============================================================
   APEX DEMO / PRESENTATION MODE — visual overlay only.
   Every selector is scoped under `body.demo-mode`. Without that
   class the file produces zero visual side effects, so it's safe
   to ship in production. Activation lives in demo_mode.js.

   Style brief: luxury restaurant lounge, NOT cyberpunk:
     - gold accents, calm pulses (1.6 s+)
     - low contrast halos, no neon
     - no aggressive scale changes
     - reduced-motion respected
   ============================================================ */

/* ---- 1. Floating "DEMO" exit pill (bottom-right) ----------- */
body.demo-mode .demo-pill {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(202, 164, 90, 0.55);
    background: linear-gradient(180deg, rgba(244, 216, 150, 0.92) 0%, rgba(201, 154, 74, 0.92) 100%);
    color: #1a1306;
    font: 700 11px/1 "Inter", system-ui, sans-serif;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    box-shadow: 0 8px 22px rgba(201, 154, 74, 0.40);
    backdrop-filter: blur(6px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 0.12s ease, filter 0.15s ease;
}
body.demo-mode .demo-pill:hover  { filter: brightness(1.05); }
body.demo-mode .demo-pill:active { transform: scale(0.96); }
body.demo-mode .demo-pill:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}
body.demo-mode .demo-pill .demo-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #2c5e2f;
    box-shadow: 0 0 0 3px rgba(95, 180, 100, 0.35);
    animation: demo-dot-pulse 1.6s ease-in-out infinite;
    flex: none;
}
@keyframes demo-dot-pulse {
    0%, 100% { transform: scale(1);    box-shadow: 0 0 0 3px rgba(95, 180, 100, 0.35); }
    50%      { transform: scale(1.25); box-shadow: 0 0 0 5px rgba(95, 180, 100, 0.18); }
}

/* ---- 2. Spotlight halo — soft gold ring around current focus card */
body.demo-mode .demo-spotlight {
    position: relative;
    z-index: 1;
}
body.demo-mode .demo-spotlight::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid rgba(232, 185, 116, 0.55);
    box-shadow:
        0 0 0 6px rgba(201, 154, 74, 0.12),
        0 14px 38px rgba(201, 154, 74, 0.22);
    animation: demo-spot-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes demo-spot-pulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}

/* ---- 3. Ambient brand breathing on the home hero / topbar brand */
body.demo-mode .topbar-brand,
body.demo-mode .hero-logo,
body.demo-mode .res-topbrand {
    animation: demo-breath 6s ease-in-out infinite;
}
@keyframes demo-breath {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(201, 154, 74, 0)); }
    50%      { filter: drop-shadow(0 0 8px rgba(201, 154, 74, 0.35)); }
}

/* ---- 4. QR attention pulse on home — discreet ring around the QR
          image so guests notice the install affordance during demo. */
body.demo-mode .qr-image {
    position: relative;
}
body.demo-mode .qr-image::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 1.5px solid rgba(232, 185, 116, 0.45);
    pointer-events: none;
    animation: demo-qr-ring 2.4s ease-out infinite;
    opacity: 0;
}
@keyframes demo-qr-ring {
    0%   { transform: scale(1);    opacity: 0.7; }
    80%  { transform: scale(1.08); opacity: 0; }
    100% { transform: scale(1.08); opacity: 0; }
}

/* ---- 5. Activity ticker — bottom-center dark-glass strip with
          rotating "live restaurant" lines on /reservation. */
body.demo-mode .demo-ticker {
    position: fixed;
    left: 50%;
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 76px));
    transform: translateX(-50%);
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(20, 20, 24, 0.95) 0%, rgba(15, 15, 18, 0.92) 100%);
    border: 1px solid rgba(202, 164, 90, 0.40);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    color: #f4efe6;
    font: 600 13px/1.3 "Inter", system-ui, sans-serif;
    letter-spacing: 0.04em;
    pointer-events: none;
    max-width: min(92vw, 460px);
    transition: opacity 350ms ease, transform 350ms ease;
}
body.demo-mode .demo-ticker.is-fade {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
}
body.demo-mode .demo-ticker .demo-ticker-led {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6fcf97;
    box-shadow: 0 0 0 3px rgba(111, 207, 151, 0.25);
    flex: none;
    animation: demo-led-pulse 1.6s ease-in-out infinite;
}
@keyframes demo-led-pulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.18); }
}

/* ---- 6. Onboarding hint card — appears on home in demo mode,
          fades in once after splash, dismissable. Compact dark
          glass, never blocks taps on real CTAs. */
body.demo-mode .demo-hint-card {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    top:   max(96px, env(safe-area-inset-top));
    z-index: 9995;
    width: min(280px, calc(100vw - 28px));
    padding: 14px 16px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 20, 24, 0.96) 0%, rgba(15, 15, 18, 0.92) 100%);
    border: 1px solid rgba(202, 164, 90, 0.42);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(10px);
    color: #f4efe6;
    font: 500 13px/1.45 "Inter", system-ui, sans-serif;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}
body.demo-mode .demo-hint-card.is-shown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
body.demo-mode .demo-hint-card .demo-hint-eyebrow {
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(232, 185, 116, 0.95);
    font-weight: 700;
    margin-bottom: 4px;
}
body.demo-mode .demo-hint-card .demo-hint-title {
    font: 700 14px/1.2 "Playfair Display", "Georgia", serif;
    color: #f7e2bd;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
body.demo-mode .demo-hint-card .demo-hint-text {
    font-size: 12.5px;
    color: rgba(244, 239, 230, 0.85);
}
body.demo-mode .demo-hint-card .demo-hint-close {
    position: absolute;
    top: 6px; right: 6px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(244, 239, 230, 0.7);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0; font: 600 12px/1 system-ui, sans-serif;
}
body.demo-mode .demo-hint-card .demo-hint-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f4efe6;
}

/* ---- 7. Reduced-motion compliance ----------------------------- */
@media (prefers-reduced-motion: reduce) {
    body.demo-mode .demo-pill .demo-dot,
    body.demo-mode .demo-spotlight::after,
    body.demo-mode .topbar-brand,
    body.demo-mode .hero-logo,
    body.demo-mode .res-topbrand,
    body.demo-mode .qr-image::after,
    body.demo-mode .demo-ticker .demo-ticker-led {
        animation: none !important;
    }
    body.demo-mode .demo-spotlight::after { opacity: 0.7; }
    body.demo-mode .demo-ticker { transition-duration: 80ms !important; }
}

/* ---- 8. On phones, prevent the ticker overlapping the PWA install
          card or the bottom topbar. Stack it higher and shrink slightly. */
@media (max-width: 600px) {
    body.demo-mode .demo-ticker {
        bottom: max(168px, calc(env(safe-area-inset-bottom) + 168px));
        font-size: 12px;
        padding: 9px 14px;
    }
    body.demo-mode .demo-pill {
        font-size: 10px;
        letter-spacing: 0.14em;
        padding: 8px 12px;
    }
    body.demo-mode .demo-hint-card {
        top: max(74px, env(safe-area-inset-top));
        width: min(260px, calc(100vw - 28px));
        font-size: 12px;
    }
}
