/* ==========================================================================
   CALZADA 360° STREET VIEW VIEWER COMPONENT
   Google Street View-style conventions:
   - Clean, non-intrusive floating place pill (no debug coordinates or badges)
   - Flat road chevrons lying on the asphalt surface (hover-only distance)
   - Low-emphasis close icon button
   - Smooth dolly-forward zoom + crossfade on navigation
   - Auto-fading HUD hint pill
   - Interactive mini-map with real-time heading cone
   ========================================================================== */

/* Full-Screen Overlay Container */
.calzada-streetview-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100000;
    background: #090D16;
    overflow: hidden;
    user-select: none;
    font-family: 'Outfit', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.calzada-streetview-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Pannellum Viewport Container with Dolly-Forward Zoom capability */
.calzada-pannellum-container {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    cursor: grab;
    transform: scale(1);
    transform-origin: center center;
    transition: none;
}

.calzada-pannellum-container:active {
    cursor: grabbing;
}

.calzada-pannellum-container.dolly-forward {
    transform: scale(1.18);
    transition: transform 180ms cubic-bezier(0.2, 0, 0.25, 1) !important;
}

/* Scene Crossfade Curtain */
.streetview-fade-curtain {
    position: absolute;
    inset: 0;
    background: #090D16;
    z-index: 25;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.20s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.20s step-end;
}

.streetview-fade-curtain.fading {
    opacity: 1 !important;
    visibility: visible !important;
    transition: opacity 0.20s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s step-start;
}

/* Guard against lingering Pannellum internal canvas snapshot fade images */
.pnlm-fade-img {
    pointer-events: none !important;
    display: none !important;
    opacity: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOP HEADER HUD (CLEAN & NON-INTRUSIVE)
   ───────────────────────────────────────────────────────────────────────────── */
.streetview-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    padding: 16px 20px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(9, 13, 22, 0.75) 0%, rgba(9, 13, 22, 0.3) 60%, rgba(9, 13, 22, 0) 100%);
    pointer-events: none;
}

/* Floating Place Card (Shown only if current node links to a real establishment) */
.streetview-place-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    color: #FFFFFF;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.streetview-place-pin {
    color: #38BDF8;
    flex-shrink: 0;
}

.streetview-place-name {
    font-family: 'Sora', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: #F8FAFC;
    letter-spacing: 0.01em;
}

.streetview-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
}

/* Close Control: Low-emphasis plain icon button matching Saved Establishments */
.streetview-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.45);
    color: #CBD5E1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all 150ms ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.streetview-close-btn:hover {
    color: #FFFFFF;
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
    transform: scale(1.06);
}

.streetview-close-btn:active {
    transform: scale(0.96);
}

/* ─────────────────────────────────────────────────────────────────────────────
   FLAT DIRECTIONAL ROAD CHEVRONS (GOOGLE STREET VIEW STYLE)
   No circular container; painted on the road surface with perspective.
   ───────────────────────────────────────────────────────────────────────────── */
.calzada-streetview-hotspot {
    width: 60px !important;
    height: 40px !important;
    margin-left: -30px !important;
    margin-top: -20px !important;
    position: absolute;
    cursor: pointer;
    z-index: 10;
}

.calzada-nav-chevron-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calzada-flat-chevron {
    width: 58px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Perspective tilt: lays flat on the asphalt road */
    transform: perspective(100px) rotateX(46deg);
    transform-origin: center bottom;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.75));
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s ease;
}

.calzada-chevron-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.calzada-chevron-path {
    fill: rgba(255, 255, 255, 0.88);
    stroke: rgba(15, 23, 42, 0.45);
    stroke-width: 1.5;
    stroke-linejoin: round;
    transition: fill 0.16s ease, stroke 0.16s ease;
}

.calzada-streetview-hotspot:hover .calzada-flat-chevron {
    transform: perspective(100px) rotateX(36deg) scale(1.18);
    filter: drop-shadow(0 4px 10px rgba(56, 189, 248, 0.85)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.calzada-streetview-hotspot:hover .calzada-chevron-path {
    fill: #FFFFFF;
    stroke: #38BDF8;
    stroke-width: 2;
}

/* Tooltip: ONLY visible on hover! Never permanent. */
.calzada-chevron-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(15, 23, 42, 0.92);
    color: #FFFFFF;
    font-family: 'Sora', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    margin-bottom: 6px;
}

.calzada-streetview-hotspot:hover .calzada-chevron-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CURSOR-TRACKING GROUND ARROW (GOOGLE STREET VIEW CONVENTION)
   Flattened perspective ellipse that follows cursor inside navigable road zones.
   ───────────────────────────────────────────────────────────────────────────── */
.calzada-ground-arrow-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.65);
    border: 1.5px solid rgba(15, 23, 42, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(-999px, -999px, 0) translate(-50%, -50%) scale(1);
    transform-origin: center center;
    will-change: transform, opacity;
    transition: opacity 0.12s ease, visibility 0.12s;
}

.calzada-ground-arrow-cursor.active {
    opacity: 1;
    visibility: visible;
}

.calzada-ground-arrow-icon {
    width: 22px;
    height: 22px;
    color: #0284C7; /* Brand blue tone */
    stroke-width: 3.2;
    display: block;
    transform-origin: center center;
    transition: transform 0.08s linear;
}

/* Floating Tooltip displaying target place / distance above cursor */
.calzada-ground-arrow-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    background: rgba(15, 23, 42, 0.94);
    color: #FFFFFF;
    font-family: 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    letter-spacing: 0.01em;
}

/* On desktop with mouse hover: hide static hotspot chevrons in favor of cursor ground arrow */
@media (hover: hover) and (pointer: fine) {
    .calzada-streetview-hotspot {
        display: none !important;
    }
}

/* When active road zone is hovered, change canvas cursor to pointer */
.calzada-pannellum-container.zone-hovered {
    cursor: pointer !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MINI-MAP (BOTTOM-LEFT CONVENTION)
   ───────────────────────────────────────────────────────────────────────────── */
.streetview-minimap-card {
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 220px;
    height: 168px;
    background: #FFFFFF;
    border-radius: 14px;
    overflow: hidden;
    z-index: 30;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s ease;
}

.streetview-minimap-card.minimized {
    width: 140px;
    height: 38px;
}

.streetview-minimap-header {
    height: 32px;
    padding: 0 12px;
    background: #0F172A;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    flex-shrink: 0;
}

.streetview-minimap-label {
    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #E2E8F0;
}

.streetview-minimap-toggle {
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    transition: transform 0.2s ease, color 0.15s ease;
}

.streetview-minimap-toggle:hover {
    color: #FFFFFF;
}

.streetview-minimap-card.minimized .streetview-minimap-toggle {
    transform: rotate(180deg);
}

.streetview-minimap-body {
    flex: 1;
    width: 100%;
    position: relative;
    background: #F1F5F9;
}

.streetview-minimap-card.minimized .streetview-minimap-body {
    display: none;
}

/* Mini-Map Nodes Dots */
.streetview-minimap-node-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #475569;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.streetview-minimap-node-dot:hover {
    transform: scale(1.6);
    background: #378ADD;
    z-index: 10;
}

.streetview-minimap-node-dot.active-current-node {
    display: none;
}

/* Mini-Map Active Beacon & Field-of-View Cone */
.streetview-current-beacon {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.streetview-beacon-cone {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: conic-gradient(from -30deg at 50% 50%, rgba(55, 138, 221, 0.45) 0deg, rgba(55, 138, 221, 0.45) 60deg, transparent 60deg, transparent 360deg);
    top: -20px;
    left: -20px;
    pointer-events: none;
    transform-origin: center center;
    transition: transform 0.05s linear;
}

.streetview-beacon-ring {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(55, 138, 221, 0.3);
    border: 1.5px solid rgba(55, 138, 221, 0.8);
    animation: beaconPulse 2s infinite ease-out;
}

@keyframes beaconPulse {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.streetview-beacon-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #378ADD;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BOTTOM HUD HINT PILL (AUTO-FADING AFTER 4-5S OR FIRST INTERACTION)
   ───────────────────────────────────────────────────────────────────────────── */
.streetview-controls-hud {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease;
    opacity: 1;
}

.streetview-controls-hud.fade-out {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
}

.streetview-hud-pill {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F8FAFC;
    font-family: 'Sora', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    letter-spacing: 0.02em;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .streetview-top-bar {
        padding: 12px 16px;
    }
    .streetview-place-pill {
        padding: 5px 12px;
    }
    .streetview-place-name {
        font-size: 12.5px;
    }
    .streetview-minimap-card {
        bottom: 74px;
        left: 16px;
        width: 170px;
        height: 130px;
    }
    .streetview-controls-hud {
        bottom: 16px;
    }
    .streetview-hud-pill {
        font-size: 10.5px;
        padding: 6px 14px;
    }
}
