/* Reset & base — Google Maps inspired */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 14px; color: #202124; background: #fff; }

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.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;
}

/* General form controls */
.form-control {
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #202124;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.form-check-input {
    accent-color: #1a73e8;
}

.alert-danger {
    background: #fce8e6;
    color: #c5221f;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
}

.text-danger { color: #c5221f !important; }
.text-muted { color: #5f6368 !important; }

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* ===== Lock Portrait on Mobile ===== */
@media (orientation: landscape) and (max-height: 500px) {
    html::after {
        content: 'Please rotate your device to portrait mode';
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #202124;
        color: #e8eaed;
        font-family: 'Google Sans', 'Roboto', sans-serif;
        font-size: 1.2rem;
        text-align: center;
        padding: 2rem;
    }
}

/* ===== App Layout ===== */
.app-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Route Planner ===== */
.route-planner {
    display: flex;
    flex: 1;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 400px;
    min-width: 400px;
    background: #fff;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 2;
}

.sidebar-header {
    padding: 16px 20px;
    background: #fff;
}

.sidebar-header h4 {
    margin: 0;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: #202124;
}

.sidebar-content {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.map-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-container {
    width: 100%;
    flex: 1;
}

/* Compass widget */
.compass-widget {
    position: absolute;
    top: 80px;
    right: 12px;
    z-index: 1000;
    pointer-events: none;
}

.compass-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.compass-north {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #ea4335;
    line-height: 1;
}

.compass-needle {
    width: 4px;
    height: 20px;
    position: relative;
    transition: transform 0.3s ease-out;
}

.compass-needle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid #ea4335;
}

.compass-needle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 10px solid #5f6368;
}

/* ===== Start Location Picker ===== */
.start-location-picker h6,
.route-length-selector h6,
.route-preferences h6,
.route-details h6 {
    margin: 0 0 8px 0;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-row {
    display: flex;
    gap: 0;
    background: #f1f3f4;
    border-radius: 24px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.search-row:focus-within {
    background: #fff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
}

.search-row .form-control {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 16px;
    font-size: 0.9rem;
    outline: none;
    box-shadow: none;
}

.search-row .form-control:focus {
    box-shadow: none;
    outline: none;
}

.search-row .btn {
    border: none;
    background: transparent;
    color: #1a73e8;
    padding: 8px 14px;
    border-radius: 0;
    min-height: unset;
}

.click-toggle {
    margin-top: 8px;
}

.selected-point {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e8f0fe;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #1a73e8;
    word-break: break-word;
}

/* ===== Route Length Selector ===== */
.distance-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.distance-input .form-control {
    width: 80px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.distance-input .form-control:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.distance-input .unit {
    font-weight: 500;
    color: #5f6368;
}

.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.presets .btn {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 16px;
}

.form-range {
    margin-top: 8px;
    accent-color: #1a73e8;
}

/* ===== Route Details ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.detail-item {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 12px;
}

.detail-label {
    display: block;
    font-size: 0.7rem;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.detail-value {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: #202124;
}

.export-section {
    margin: 12px 0;
}

.export-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.export-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: #5f6368;
}

.export-hint a {
    color: #1a73e8;
}

.directions {
    margin-top: 8px;
    font-size: 0.85rem;
}

.directions summary {
    cursor: pointer;
    font-weight: 500;
    color: #1a73e8;
    padding: 6px 0;
}

.direction-list {
    padding-left: 1.2rem;
    margin: 8px 0 0 0;
}

.direction-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f1f3f4;
    color: #3c4043;
}

/* ===== Elevation Chart ===== */
.elevation-chart {
    margin: 8px 0;
}

.elevation-svg {
    width: 100%;
    height: 60px;
    background: #f8f9fa;
    border-radius: 12px;
}

.elevation-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #5f6368;
    margin-top: 4px;
}

/* ===== Generate Section ===== */
.generate-section .btn-primary {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
}

/* ===== Mobile Toggle Button ===== */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    padding: 10px 24px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a73e8;
    background: #fff;
    border: none;
    border-radius: 24px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    cursor: pointer;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .mobile-toggle {
        display: inline-flex;
    }

    .route-planner {
        flex-direction: column;
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        min-width: unset;
        max-height: 100vh;
        z-index: 1050;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding-bottom: 4rem;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
    }

    .sidebar.sidebar-open {
        transform: translateY(0);
    }

    .sidebar.sidebar-open ~ .map-area .nav-banner-container {
        display: none;
    }

    .map-area {
        height: 100vh;
        width: 100%;
    }

    .btn {
        min-height: 44px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .form-control {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .form-check {
        min-height: 44px;
    }

    .form-check-input {
        width: 1.25rem;
        height: 1.25rem;
    }

    .form-check-label {
        font-size: 0.9rem;
    }

    .presets .btn {
        font-size: 0.85rem;
        padding: 6px 14px;
        min-height: 36px;
    }

    .sidebar-content {
        padding: 12px 16px;
        gap: 12px;
    }

    .detail-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .nav-banner-body {
        padding: 16px 16px;
        gap: 12px;
    }

    .nav-step-instruction {
        font-size: 16px;
        line-height: 1.4;
    }

    .nav-step-distance {
        font-size: 14px;
        margin-top: 4px;
    }

    .nav-step-num {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .nav-arrow {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .nav-stop-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .floating-map-actions {
        bottom: 80px;
    }
}

/* ===== Google Maps-style buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.38;
    pointer-events: none;
}

.btn-primary {
    background: #1a73e8;
    color: #fff;
    border-color: #1a73e8;
}

.btn-primary:hover {
    background: #1765cc;
    box-shadow: 0 1px 3px rgba(26, 115, 232, 0.4);
}

.btn-outline-primary {
    background: transparent;
    color: #1a73e8;
    border-color: #dadce0;
}

.btn-outline-primary:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

.btn-outline-secondary {
    background: transparent;
    color: #5f6368;
    border-color: #dadce0;
}

.btn-outline-secondary:hover {
    background: #f1f3f4;
    border-color: #5f6368;
}

.btn-outline-success {
    background: transparent;
    color: #1e8e3e;
    border-color: #dadce0;
}

.btn-outline-success:hover {
    background: #e6f4ea;
    border-color: #1e8e3e;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8125rem;
}

.w-100 { width: 100%; }
.mt-2 { margin-top: 8px; }
.ms-2 { margin-left: 8px; }
.me-2 { margin-right: 8px; }

/* Floating map action buttons */
.floating-run-timer {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    font-variant-numeric: tabular-nums;
    padding: 8px 24px;
    border-radius: 12px;
    letter-spacing: 2px;
    pointer-events: none;
}

/* Run timer inside nav banner */
.nav-timer {
    font-variant-numeric: tabular-nums;
    font-weight: bold;
    font-size: 1.1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 1px;
}

/* Save run modal */
.save-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.save-modal {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.save-modal h5 {
    margin-bottom: 16px;
}

.save-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #198754;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.floating-map-actions {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.floating-nav-btn {
    padding: 12px 28px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: #1a73e8;
    border: none;
    border-radius: 28px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
}

.floating-nav-btn:hover {
    background: #1765cc;
    box-shadow: 0 2px 10px rgba(32, 33, 36, 0.35);
}

.floating-shuffle-btn {
    padding: 12px 28px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: #5f6368;
    border: none;
    border-radius: 28px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
}

.floating-shuffle-btn:hover {
    background: #4a4e52;
    box-shadow: 0 2px 10px rgba(32, 33, 36, 0.35);
}

.floating-shuffle-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.floating-stop-btn {
    padding: 12px 28px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: #ea4335;
    border: none;
    border-radius: 28px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
}

.floating-stop-btn:hover {
    background: #d93025;
    box-shadow: 0 2px 10px rgba(32, 33, 36, 0.35);
}

/* Version footer */
.version-footer {
    position: fixed;
    bottom: 4px;
    left: 8px;
    font-size: 10px;
    color: rgba(95, 99, 104, 0.5);
    pointer-events: none;
    z-index: 10000;
}

/* Navigation banner container — sits above the map */
.nav-banner-container {
    width: 100%;
    z-index: 1200;
    flex-shrink: 0;
}

/* Navigation step banner — Google green */
.nav-banner {
    background: #1e8e3e;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    pointer-events: auto;
    overflow: hidden;
    color: #fff;
}

.nav-progress-bar {
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
}

.nav-progress-fill {
    height: 100%;
    background: #fff;
    transition: width 0.3s ease;
}

.nav-banner-body {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 52px;
    position: relative;
}

.nav-arrow-left {
    position: absolute;
    left: 8px;
}

.nav-arrow-right {
    position: absolute;
    right: 8px;
}

.nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.nav-arrow:hover { background: rgba(255, 255, 255, 0.35); }

.nav-arrow-disabled {
    opacity: 0.3;
    pointer-events: none;
}

.nav-stop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 20px;
    border: none;
    background: #ea4335;
    color: #fff;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s;
}

.nav-stop-btn:hover { background: #d93025; }

.nav-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-step-instruction {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(14px * 1.3 * 2);
}

.nav-step-distance {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

@keyframes nav-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(66, 133, 244, 0); }
}

.nav-active-step {
    animation: nav-pulse 2s ease-in-out infinite;
}

.btn-primary {
    color: #fff;
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.btn-primary:hover { background-color: #2563eb; border-color: #2563eb; }

.btn-outline-primary {
    color: #3b82f6;
    border-color: #3b82f6;
    background: transparent;
}

.btn-outline-primary:hover { background: #3b82f6; color: #fff; }

.btn-outline-secondary {
    color: #64748b;
    border-color: #cbd5e1;
    background: transparent;
}

.btn-outline-secondary:hover { background: #f1f5f9; }

.btn-outline-success {
    color: #16a34a;
    border-color: #16a34a;
    background: transparent;
}

.btn-outline-success:hover { background: #16a34a; color: #fff; }

.w-100 { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.me-2 { margin-right: 0.5rem; }

.form-control {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1e293b;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus { border-color: #3b82f6; outline: 0; box-shadow: 0 0 0 0.2rem rgba(59,130,246,.25); }
.form-control-sm { padding: 0.25rem 0.5rem; font-size: 0.8125rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.form-check-input { width: 1rem; height: 1rem; margin: 0; accent-color: #3b82f6; }
.form-check-label { font-size: 0.85rem; cursor: pointer; }

.form-range { width: 100%; accent-color: #3b82f6; }

.alert { padding: 0.75rem 1rem; border-radius: 0.375rem; font-size: 0.85rem; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm { width: 0.8rem; height: 0.8rem; }

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

.text-muted { color: #94a3b8; }

/* ===== Username Setup Modal ===== */
.username-setup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.username-setup-modal {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.username-setup-modal h4 {
    margin-bottom: 0.25rem;
    font-family: 'Google Sans', sans-serif;
}

.username-setup-modal p {
    color: #5f6368;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

/* ===== Save Route Section ===== */
.save-route-section .input-group {
    border-radius: 8px;
    overflow: hidden;
}

.save-route-section .text-success {
    display: block;
    margin-top: 0.25rem;
}

/* ===== Saved Routes Page ===== */
.saved-routes-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem;
}

.saved-routes-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.saved-routes-header h4 {
    margin: 0;
    flex: 1;
    font-family: 'Google Sans', sans-serif;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #5f6368;
}

.empty-state p:first-child {
    font-size: 1.5rem;
}

.saved-routes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.saved-route-card {
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: box-shadow 0.2s;
}

.saved-route-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.saved-route-info {
    flex: 1;
    min-width: 0;
}

.saved-route-info h6 {
    margin: 0 0 0.25rem;
    font-family: 'Google Sans', sans-serif;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-route-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #5f6368;
    flex-wrap: wrap;
}

.saved-route-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .saved-route-card {
        flex-direction: column;
        align-items: stretch;
    }

    .saved-route-actions {
        justify-content: flex-end;
    }
}
