/* FuelOwl — white UI overlays on map, amber + navy brand accents */

:root {
    --fo-navy:     #0F172A;
    --fo-navy2:    #1E293B;
    --fo-navy3:    #334155;
    --fo-amber:    #F59E0B;
    --fo-amber2:   #FBBF24;
    --fo-slate:    #475569;
    --fo-muted:    #64748B;
    --fo-panel-w:  360px;
}

/* ── Full-screen map container ─────────────────────────────────────────── */

/* fo-map-wrap IS the viewport — position:fixed so it works regardless of
   what Blazor renders around it. No height inheritance chain to break. */
.fo-map-wrap {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #0F172A;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

/* Force RadzenGoogleMap to fill the fixed container */
.fo-map-wrap > div:first-child,
.fo-map-wrap .rz-map,
.fo-map-wrap [class*="rz-google"] {
    width: 100% !important;
    height: 100% !important;
}

/* ── Floating toolbar (top overlay) — white card ──────────────────────── */

.fo-toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.12);
    flex-wrap: wrap;
}

.fo-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.fo-logo-wrap img {
    height: 32px;
    width: auto;
}

.fo-toolbar-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--fo-navy);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.fo-toolbar-title span {
    color: var(--fo-amber);
}

.fo-toolbar-divider {
    width: 1px;
    height: 26px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.fo-toolbar-spacer {
    flex: 1;
    min-width: 0;
}

/* Radzen dropdown inside toolbar — light theme */
.fo-fuel-select .rz-dropdown {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    color: var(--fo-navy) !important;
}

.fo-fuel-select .rz-dropdown-label,
.fo-fuel-select .rz-placeholder,
.fo-fuel-select .rz-label {
    color: var(--fo-navy) !important;
    font-weight: 500 !important;
}

.fo-fuel-select .rz-dropdown-trigger .rz-dropdown-trigger-icon {
    color: var(--fo-slate) !important;
}

.fo-toggle-label {
    font-size: 0.82rem;
    color: var(--fo-slate);
    white-space: nowrap;
}

.fo-about-btn {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--fo-slate) !important;
    border-radius: 8px !important;
    font-size: 0.82rem !important;
    padding: 4px 12px !important;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
    cursor: pointer;
}

.fo-about-btn:hover {
    border-color: var(--fo-amber) !important;
    color: var(--fo-navy) !important;
}

.fo-insights-btn {
    background: linear-gradient(135deg, #1d4ed8, #4f46e5) !important;
    border: none !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-size: 0.82rem !important;
    padding: 4px 14px !important;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.fo-insights-btn:hover {
    opacity: 0.88;
}

/* ── AI Insights modal ──────────────────────────────────────────────────── */

.fo-insights-backdrop {
    position: absolute;   /* parent fo-map-wrap is fixed;inset:0 — same visual area */
    inset: 0;
    z-index: 9999;        /* above Google Maps internal layers */
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fo-insights-modal {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fo-insights-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1d4ed8;
    flex-shrink: 0;
}

.fo-insights-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    font-size: 0.88rem;
    color: #1e293b;
    line-height: 1.6;
}

.fo-insights-body h3 {
    font-size: 0.95rem;
    color: #1d4ed8;
    margin: 18px 0 6px;
}

.fo-insights-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 14px;
    font-size: 0.83rem;
}

.fo-insights-body th {
    background: #f1f5f9;
    text-align: left;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
}

.fo-insights-body td {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
}

.fo-insights-body tr:nth-child(even) td {
    background: #f8fafc;
}

.fo-insights-email {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.fo-insights-email-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.15s;
}

.fo-insights-email-input:focus {
    border-color: #3b82f6;
}

.fo-insights-send-btn {
    background: #1d4ed8;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.fo-insights-send-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.fo-insights-sent {
    font-size: 0.85rem;
    color: #16a34a;
    font-weight: 500;
}

.fo-insights-prompt {
    padding: 32px 24px;
    text-align: center;
    color: #475569;
    font-size: 0.9rem;
}

.fo-insights-prompt p {
    margin-bottom: 18px;
}

.fo-insights-generate-btn {
    background: linear-gradient(135deg, #1d4ed8, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.15s;
}

.fo-insights-generate-btn:hover {
    opacity: 0.88;
}

.fo-insights-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 24px;
    color: #475569;
    font-size: 0.9rem;
}

.fo-insights-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #dbeafe;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: fo-spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.fo-insights-error {
    margin: 20px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.87rem;
}


.fo-locate-error {
    font-size: 0.75rem;
    color: #dc2626;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Price legend (bottom-left) — white card ──────────────────────────── */

.fo-legend {
    position: absolute;
    bottom: 28px;
    left: 12px;
    z-index: 100;
    background: #ffffff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.78rem;
    color: var(--fo-muted);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.fo-legend-cheapest {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #15803D;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.fo-legend-star {
    font-size: 1.1rem;
    color: #CA8A04;
    line-height: 1;
}

.fo-legend-title {
    font-weight: 700;
    color: var(--fo-navy);
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.fo-legend-bar {
    width: 120px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #22C55E, #EAB308, #EF4444);
    margin-bottom: 4px;
}

.fo-legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--fo-muted);
}

.fo-legend-grey {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--fo-muted);
}

.fo-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
    flex-shrink: 0;
}

/* ── Station count badge (bottom-centre) — white pill ─────────────────── */

.fo-count-badge {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: #ffffff;
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.8rem;
    color: var(--fo-slate);
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Fetching badge (below toolbar) ───────────────────────────────────── */

.fo-fetch-badge {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--fo-amber);
    color: var(--fo-navy);
    border-radius: 20px;
    padding: 5px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    animation: fo-pulse 1.5s ease-in-out infinite;
}

@keyframes fo-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.65; }
}

/* ── Side panel — dark navy (slides from right) ────────────────────────── */

.fo-panel-overlay {
    position: absolute;
    inset: 0;
    z-index: 200;
    pointer-events: none;
}

.fo-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--fo-panel-w);
    background: var(--fo-navy);
    border-left: 1px solid var(--fo-navy3);
    box-shadow: -6px 0 32px rgba(0,0,0,0.35);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    overflow: hidden;
}

.fo-panel.fo-panel--open {
    transform: translateX(0);
}

.fo-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--fo-navy3);
    background: var(--fo-navy2);
    flex-shrink: 0;
}

.fo-panel-name {
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
    margin-bottom: 3px;
    line-height: 1.3;
}

.fo-panel-brand {
    font-size: 0.82rem;
    color: var(--fo-amber);
    font-weight: 600;
}

.fo-panel-close {
    background: transparent;
    border: none;
    color: var(--fo-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 2px 4px;
    margin-left: 8px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.fo-panel-close:hover {
    color: #f1f5f9;
}

.fo-panel-meta {
    padding: 12px 16px;
    border-bottom: 1px solid var(--fo-navy3);
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.65;
    flex-shrink: 0;
}

.fo-panel-meta a {
    color: var(--fo-amber2);
    text-decoration: none;
}

.fo-panel-meta a:hover {
    text-decoration: underline;
}

.fo-directions-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #60a5fa !important;
    text-decoration: none !important;
    transition: color 0.15s;
}

.fo-directions-link:hover {
    color: #93c5fd !important;
    text-decoration: underline !important;
}

.fo-panel-prices {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 16px;
}

.fo-prices-heading {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--fo-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.fo-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--fo-navy3);
}

.fo-price-row:last-child {
    border-bottom: none;
}

.fo-price-type {
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

.fo-price-type.fo-price-selected {
    color: var(--fo-amber);
    font-weight: 700;
}

.fo-price-val {
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.fo-price-val.fo-price-avail {
    color: #f1f5f9;
}

.fo-price-val.fo-price-na {
    color: var(--fo-muted);
    font-weight: 400;
    font-size: 0.82rem;
}

.fo-updated {
    font-size: 0.72rem;
    color: var(--fo-muted);
    margin-top: 12px;
}

/* ── About dialog content ──────────────────────────────────────────────── */

.fo-about-wrap {
    padding: 8px 4px;
    max-width: 440px;
}

.fo-about-wrap h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--fo-amber);
    margin-bottom: 14px;
}

.fo-about-wrap p {
    font-size: 0.88rem;
    line-height: 1.65;
    margin-bottom: 12px;
}

.fo-about-wrap ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.fo-about-wrap ul li {
    font-size: 0.85rem;
    padding: 3px 0;
}

.fo-about-wrap ul li::before {
    content: '✦ ';
    color: var(--fo-amber);
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    :root { --fo-panel-w: 100vw; }

    .fo-toolbar {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 6px 10px;
        gap: 6px;
    }

    .fo-toolbar-title {
        font-size: 0.95rem;
    }

    .fo-legend,
    .fo-count-badge {
        bottom: 16px;
    }
}
