html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ==========================================
   PROVIDER / LOCATION CARD GRADIENT PALETTE
   Used by ProviderLocationCard and ProviderDetails location cards
   via style="background: var(--gradient-N)" where N = id % 10
   ========================================== */
:root {
    --gradient-0: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-1: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-3: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-4: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-5: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
    --gradient-6: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-7: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    --gradient-8: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-9: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* ── View toggle — desktop inline pill ──────────────────────────────── */
.view-toggle-group {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.view-toggle-btn.active {
    background: #fff;
    color: #6366f1;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.view-toggle-btn i { font-size: 0.95rem; }

/* ── View toggle — mobile floating pill ─────────────────────────────── */
.view-fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 1050;
    display: flex;
    background: #1e293b;
    border-radius: 999px;
    padding: 5px 6px;
    gap: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.28);
    /* hidden until user scrolls into results */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.88);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
/* On mobile, lift above the bottom nav bar */
@media (max-width: 640.98px) {
    .view-fab {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }
}
.view-fab.fab-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
}
.view-fab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 22px;
    border: none;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.view-fab-btn.active {
    background: #6366f1;
    color: #fff;
}
.view-fab-btn i { font-size: 1rem; }

/* ── Radius FAB pill (mobile map+geo mode) ──────────────────────────── */
.radius-fab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: none;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.radius-fab-btn.has-value {
    color: #4ade80;
}
.radius-fab-btn.active {
    background: rgba(74,222,128,0.18);
    color: #4ade80;
}
.radius-fab-btn i { font-size: 1rem; }
.radius-fab-divider {
    width: 1px;
    height: 20px;
    background: #334155;
    align-self: center;
    flex-shrink: 0;
}

/* ── Radius popover (above FAB, mobile) ─────────────────────────────── */
.radius-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1051;
}
.radius-popover {
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1052;
    background: #1e293b;
    border-radius: 16px;
    padding: 14px 18px 10px;
    width: min(300px, calc(100vw - 32px));
    box-shadow: 0 8px 32px rgba(0,0,0,0.40);
    animation: radiusPopoverIn 0.18s ease;
}
@@keyframes radiusPopoverIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.radius-popover .form-range {
    accent-color: #4ade80;
}

/* ── Leaflet map popups ──────────────────────────────────────────────── */

/* User location — pulsing animated dot */
.user-location-marker {
    position: relative;
    width: 20px;
    height: 20px;
}
.user-location-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #2563eb;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(37,99,235,0.55);
    z-index: 2;
}
.user-location-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.22);
    animation: user-loc-pulse 2s ease-out infinite;
    z-index: 1;
}
.user-location-ring-2 {
    animation-delay: 0.7s;
}
@keyframes user-loc-pulse {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

.map-popup { font-family: inherit; min-width: 180px; }
.map-popup-name { font-weight: 700; font-size: 0.92rem; color: #111827; margin-bottom: 3px; }
.map-popup-addr { font-size: 0.78rem; color: #6b7280; margin-bottom: 3px; }
.map-dist { font-size: 0.78rem; color: #6366f1; font-weight: 600; margin-bottom: 4px; }
.map-services { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 6px; }
.map-service-chip {
    font-size: 0.7rem; padding: 2px 7px; border-radius: 999px;
    background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe;
    white-space: nowrap;
}
.map-btn {
    display: block; text-align: center; font-size: 0.8rem; font-weight: 600;
    padding: 5px 0; border-radius: 6px; background: #6366f1; color: #fff !important;
    text-decoration: none; margin-top: 2px;
}
.map-btn:hover { background: #4f46e5; color: #fff !important; }

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny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;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

/* ============================================================
   Rating Modals — scrollable on all screen sizes
   Covers: .rate-provider-modal and .rate-customer-modal
   ============================================================ */

/* Full-screen fixed backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1040;
}

/* Centred, scrollable dialog wrapper */
.modal-dialog.rate-provider-modal,
.modal-dialog.rate-customer-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: flex-start;       /* top-align so content isn't clipped on short screens */
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;              /* THE key fix — dialog wrapper scrolls */
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
}

/* The white card itself — let it grow naturally, never taller than needed */
.modal-dialog.rate-provider-modal .modal-content,
.modal-dialog.rate-customer-modal .modal-content {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: auto;                  /* centres vertically when content is short */
    border-radius: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-height: none;              /* let the wrapper scroll — don't cap the card */
}

/* Sticky header so Close button is always reachable */
.modal-dialog.rate-provider-modal .modal-header,
.modal-dialog.rate-customer-modal .modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Sticky footer so Submit is always reachable */
.modal-dialog.rate-provider-modal .modal-footer,
.modal-dialog.rate-customer-modal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: #fff;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Mobile tweaks */
@media (max-width: 575.98px) {
    .modal-dialog.rate-provider-modal,
    .modal-dialog.rate-customer-modal {
        padding: 0.5rem;
        align-items: flex-start;
    }

    .modal-dialog.rate-provider-modal .modal-content,
    .modal-dialog.rate-customer-modal .modal-content {
        border-radius: 0.5rem;
    }
}

.loading-progress-text {
    display: block;
    text-align: center;
    font-weight: bold;
    margin-top: -9rem;
    line-height: 8rem;
    font-size: 0.875rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}