/*
    Winnipeg Parks Demo — standalone theme
    - Unique animated "aurora" UI (does NOT use main website theme)
    - Split-view layout: results + details + map
*/

:root {
    --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

    --bg0: #050613;
    --bg1: #0a1030;
    --panel: rgba(255, 255, 255, 0.06);
    --panel2: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.14);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.68);

    /* Used by JS for boundary styling */
    --accent: #ff4fd8;
    --accent-2: #2de2e6;
    --accent-3: #7cff6b;

    --shadow: 0 18px 60px rgba(0, 0, 0, 0.40);
    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 24px;
    --space-5: 32px;
    --space-6: 48px;
    --container: 1200px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background:
        radial-gradient(900px 540px at 15% 10%, rgba(255, 79, 216, 0.18), transparent 60%),
        radial-gradient(800px 520px at 85% 20%, rgba(45, 226, 230, 0.16), transparent 60%),
        radial-gradient(760px 520px at 35% 85%, rgba(124, 255, 107, 0.12), transparent 58%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    overflow-x: hidden;
}

/* Animated aurora overlay */
body::before {
    content: '';
    position: fixed;
    inset: -40vh -40vw;
    pointer-events: none;
    background:
        conic-gradient(from 180deg, rgba(255, 79, 216, 0.10), rgba(45, 226, 230, 0.10), rgba(124, 255, 107, 0.08), rgba(255, 79, 216, 0.10));
    filter: blur(50px);
    opacity: 0.65;
    animation: auroraShift 12s ease-in-out infinite;
}

@keyframes auroraShift {
    0% { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1.05); }
    50% { transform: translate3d(2%, 1%, 0) rotate(18deg) scale(1.10); }
    100% { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1.05); }
}

a { color: inherit; text-decoration: none; }

:focus-visible {
    outline: 3px solid rgba(45, 226, 230, 0.65);
    outline-offset: 3px;
    border-radius: 12px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 14px;
    background: rgba(10, 16, 48, 0.9);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 999px;
    z-index: 9999;
}

.skip-link:focus { left: 14px; }

.container {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
}

.parks-page {
    padding: var(--space-6) 0;
    position: relative;
}

.parks-header {
    text-align: center;
    margin-bottom: var(--space-5);
}

.parks-title {
    margin: 0;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    letter-spacing: -0.03em;
}

.parks-subtitle {
    margin: var(--space-2) auto 0;
    max-width: 70ch;
    color: var(--muted);
}

.parks-form {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
    border-radius: var(--r-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow);
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
    margin-bottom: var(--space-3);
    backdrop-filter: blur(10px);
}

@media (min-width: 900px) {
    .parks-form {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }
}

.parks-field { display: grid; gap: 6px; }

.parks-field label {
    font-weight: 750;
    color: var(--text);
    font-size: 0.95rem;
}

.parks-field input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(5, 6, 19, 0.30);
    color: var(--text);
    transition: border-color 180ms ease, transform 180ms ease;
}

.parks-field input::placeholder { color: rgba(255, 255, 255, 0.42); }

.parks-field input:focus {
    border-color: rgba(45, 226, 230, 0.55);
}

.parks-actions {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-start;
}

@media (min-width: 900px) {
    .parks-actions { justify-content: flex-end; }
}

.parks-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(135deg, rgba(255, 79, 216, 0.85), rgba(45, 226, 230, 0.70));
    color: rgba(255, 255, 255, 0.96);
    padding: 12px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition: transform 180ms ease, filter 180ms ease;
    white-space: nowrap;
}

.parks-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.parks-btn:active { transform: translateY(0); }

.parks-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
}

.parks-status {
    min-height: 22px;
    color: var(--muted);
    margin: 0 0 var(--space-3);
}

/* Animated status banner */
.parks-status.is-showing {
    min-height: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    animation: statusIn 240ms ease both, statusGlow 1.6s ease-in-out infinite;
}

.parks-status.is-showing::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: radial-gradient(90px 60px at 20% 50%, rgba(255, 255, 255, 0.10), transparent 60%);
    opacity: 0.8;
    pointer-events: none;
}

.parks-status.is-showing::after {
    content: 'Tap to dismiss';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
}

.parks-status.is-showing:hover::after {
    opacity: 1;
}



.parks-status.is-loading {
    border-color: rgba(45, 226, 230, 0.35);
    box-shadow: 0 0 0 3px rgba(45, 226, 230, 0.12), 0 16px 45px rgba(0, 0, 0, 0.28);
}

.parks-status.is-success {
    border-color: rgba(124, 255, 107, 0.35);
    box-shadow: 0 0 0 3px rgba(124, 255, 107, 0.12), 0 16px 45px rgba(0, 0, 0, 0.28);
}

/* Transit (Winnipeg Transit trip planner) */
.parks-dir-open {
    display: inline-block;
    margin-top: 10px;
    color: rgba(45, 226, 230, 0.92);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.parks-transit-itineraries {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.parks-transit-itinerary {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 12px 12px;
}

.parks-transit-summary {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.parks-transit-legs {
    margin: 10px 0 0;
    padding-left: 18px;
    color: rgba(255, 255, 255, 0.82);
    display: grid;
    gap: 6px;
}

.parks-transit-leg {
    line-height: 1.4;
}

.parks-status.is-error {
    border-color: rgba(255, 79, 216, 0.42);
    box-shadow: 0 0 0 3px rgba(255, 79, 216, 0.14), 0 16px 45px rgba(0, 0, 0, 0.28);
}

.parks-status.is-loading {
    padding-left: 44px;
}

.parks-status-icon {
    font-weight: 900;
    opacity: 0.95;
}

.parks-status-text {
    position: relative;
    z-index: 1;
}

.parks-status.is-loading::before {
    background: radial-gradient(90px 60px at 20% 50%, rgba(45, 226, 230, 0.20), transparent 60%);
}

.parks-status.is-loading .parks-status-spinner {
    display: inline-block;
}

.parks-status-spinner {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: rgba(45, 226, 230, 0.85);
    animation: spin 800ms linear infinite;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes statusIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes statusGlow {
    0%, 100% { filter: brightness(1.00); }
    50% { filter: brightness(1.08); }
}

.parks-mobile-tabs {
    display: none;
    gap: 10px;
    justify-content: center;
    margin: 0 0 var(--space-3);
}

.parks-tab {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: -0.01em;
    transition: transform 180ms ease, filter 180ms ease, background 180ms ease, border-color 180ms ease;
}

.parks-tab:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.parks-tab[aria-selected="true"] {
    background: linear-gradient(135deg, rgba(255, 79, 216, 0.35), rgba(45, 226, 230, 0.22));
    border-color: rgba(45, 226, 230, 0.35);
}

.parks-layout {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
}

/* Leaflet theming (make controls match the demo UI) */
.leaflet-container {
    font: inherit;
    background: rgba(5, 6, 19, 0.22);
}

.leaflet-bar {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(5, 6, 19, 0.45);
    box-shadow: none;
    border-radius: 14px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.leaflet-bar a,
.leaflet-bar a:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.leaflet-bar a:last-child {
    border-bottom: 0;
}

.leaflet-control-attribution,
.leaflet-control-scale {
    background: rgba(5, 6, 19, 0.45);
    color: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 6px 10px;
    backdrop-filter: blur(10px);
}

.leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.86);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.leaflet-control-layers {
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(5, 6, 19, 0.45) !important;
    box-shadow: none !important;
    border-radius: 14px !important;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.leaflet-control-layers-toggle {
    filter: invert(1) opacity(0.9);
}

.leaflet-control-layers-expanded {
    padding: 10px 12px;
}

.leaflet-control-layers label {
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

.leaflet-control-layers-separator {
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* User location marker */
.parks-user-icon {
    background: transparent;
    border: 0;
}

.parks-user-pin {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(5, 6, 19, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    font-size: 16px;
    line-height: 1;
}

@media (min-width: 980px) {
    .parks-layout {
        grid-template-columns: 0.95fr 1.05fr 1.3fr;
        align-items: start;
    }
}

@media (max-width: 979.98px) {
    .parks-mobile-tabs {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 20;
        padding: 10px 0;
        backdrop-filter: blur(10px);
    }

    /* Google-Maps-like mobile layout:
       - Map is always visible (sticky)
       - Results/Details behave like a bottom sheet you can scroll
    */
    .parks-panel { display: block; }

    .parks-panel[data-panel="results"],
    .parks-panel[data-panel="details"] {
        display: none;
        margin-top: -14px;
        border-top-left-radius: var(--r-lg);
        border-top-right-radius: var(--r-lg);
    }

    .parks-panel[data-panel="results"].is-active,
    .parks-panel[data-panel="details"].is-active {
        display: block;
    }

    .parks-panel[data-panel="map"] {
        display: block;
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .parks-panel-map {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}

.parks-panel {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 320px;
    transform: translateY(0);
    animation: panelIn 380ms ease both;
    backdrop-filter: blur(10px);
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.parks-panel-head {
    padding: var(--space-3) var(--space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
}

.parks-panel-title { margin: 0; font-size: 1.05rem; }

.parks-panel-meta {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
}

.parks-results {
    padding: var(--space-2);
    display: grid;
    gap: 10px;
    max-height: 540px;
    overflow: auto;
}

.parks-result {
    width: 100%;
    text-align: left;
    background: rgba(5, 6, 19, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-md);
    padding: 12px 12px;
    cursor: pointer;
    color: var(--text);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.parks-result:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(45, 226, 230, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.parks-result[aria-selected="true"] {
    border-color: rgba(255, 79, 216, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 79, 216, 0.18);
    position: relative;
}

.parks-result[aria-selected="true"]::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--r-md) + 2px);
    border: 1px solid rgba(45, 226, 230, 0.25);
    animation: pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% { opacity: 0.25; }
    50% { opacity: 0.75; }
    100% { opacity: 0.25; }
}

.parks-result-title {
    font-weight: 850;
    letter-spacing: -0.01em;
}

.parks-result-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.parks-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.parks-details {
    padding: var(--space-3);
    display: grid;
    gap: 12px;
    color: var(--text);
}

.parks-details-empty { color: var(--muted); }

.parks-kv { display: grid; gap: 8px; }

.parks-kv-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
}

.parks-kv-key { color: var(--muted); font-weight: 800; }

.parks-directions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.parks-directions-title {
    font-weight: 900;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.parks-directions-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.parks-directions-actions + .parks-directions-actions {
    margin-top: 10px;
}

.parks-dir-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 850;
    letter-spacing: -0.01em;
    transition: transform 180ms ease, filter 180ms ease, background 180ms ease, border-color 180ms ease;
}

.parks-dir-btn.is-action {
    border-color: color-mix(in srgb, var(--accent-3) 55%, rgba(255, 255, 255, 0.14));
    background: color-mix(in srgb, var(--accent-3) 18%, rgba(255, 255, 255, 0.06));
}

.parks-dir-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    border-color: rgba(45, 226, 230, 0.35);
    background: rgba(255, 255, 255, 0.09);
}

.parks-dir-btn.is-action:hover {
    border-color: color-mix(in srgb, var(--accent-3) 70%, rgba(45, 226, 230, 0.25));
    background: color-mix(in srgb, var(--accent-3) 24%, rgba(255, 255, 255, 0.09));
}

.parks-directions-hint {
    margin-top: 12px;
    color: var(--muted);
}

.parks-route-summary {
    margin-top: 10px;
    color: var(--muted);
    font-weight: 800;
}

.parks-route-steps {
    margin: 10px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.parks-route-step {
    color: var(--text);
}

.parks-route-step.is-active {
    padding-left: 10px;
    border-left: 3px solid rgba(45, 226, 230, 0.55);
}

.parks-route-instruction {
    font-weight: 850;
    letter-spacing: -0.01em;
}

.parks-route-meta {
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 2px;
}

.parks-map {
    width: 100%;
    height: 520px;
}

@media (max-width: 980px) {
    .parks-map { height: clamp(380px, 55vh, 620px); }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    .parks-panel,
    .parks-btn,
    .parks-result,
    .parks-result[aria-selected="true"]::after {
        animation: none !important;
        transition: none !important;
    }
}