/* Voyagr Navigation App - Main Stylesheet */
/* Extracted from HTML_TEMPLATE for better maintainability */
/* Enhanced for modern PWA mobile experience - 2024 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    /* iOS safe area support */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh; /* Dynamic viewport height for mobile */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
    /* Smooth scrolling */
    -webkit-overflow-scrolling: touch;
    /* Prevent text size adjustment on orientation change */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Prevent pull-to-refresh on Chrome Android */
    overscroll-behavior-y: contain;
}

body {
    display: flex;
    flex-direction: column;
    /* iOS safe area padding */
    padding-top: var(--safe-area-inset-top);
    padding-left: var(--safe-area-inset-left);
    padding-right: var(--safe-area-inset-right);
}

/* Full-screen map layout */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Floating action buttons */
.fab-container {
    position: absolute;
    bottom: calc(100px + var(--safe-area-inset-bottom, 0px));
    right: calc(20px + var(--safe-area-inset-right, 0px));
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    /* GPU acceleration for smooth animations */
    will-change: transform;
    /* Prevent text selection */
    user-select: none;
    -webkit-user-select: none;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Haptic feedback visual indicator */
.fab.haptic-feedback {
    animation: hapticPulse 0.15s ease;
}

@keyframes hapticPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.88); }
    100% { transform: scale(1); }
}

/* Bottom sheet drawer */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    z-index: 50;
    max-height: 90vh;
    max-height: 90dvh; /* Dynamic viewport for mobile */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(calc(100% - 80px - var(--safe-area-inset-bottom, 0px)));
    /* GPU acceleration */
    will-change: transform;
    /* Prevent content from going behind notch */
    padding-bottom: var(--safe-area-inset-bottom, 0px);
    display: flex;
    flex-direction: column;
}

.bottom-sheet.expanded {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 100%;
    height: 50px;
    background: transparent;
    border-radius: 2px;
    margin: 0;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    touch-action: none;
    pointer-events: auto;
}

.bottom-sheet-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

.bottom-sheet-header {
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 5;
    cursor: pointer;
    user-select: none;
    min-height: 50px;
}

.bottom-sheet-header h2 {
    font-size: 18px;
    color: #333;
    margin: 0;
    flex: 1;
}

.bottom-sheet-header button {
    pointer-events: auto;
    z-index: 10;
    flex-shrink: 0;
}

.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.bottom-sheet-content::-webkit-scrollbar {
    width: 6px;
}

.bottom-sheet-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bottom-sheet-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.bottom-sheet-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.location-input-group {
    position: relative;
    margin-bottom: 15px;
}

.location-input-group input {
    padding-right: 90px; /* Space for two buttons (40px each + gap) */
}

/* Container for location buttons - positioned to not block input touch area */
.location-btn-container {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    pointer-events: none; /* Let touches pass through to input */
}

.location-btn {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    color: #667eea;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Re-enable touch on buttons themselves */
}

.location-btn:hover {
    color: #5568d3;
    background: #e8e8e8;
}

.location-btn:active {
    background: #ddd;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-calculate {
    background: #667eea;
    color: white;
    grid-column: 1 / -1;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-calculate:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-clear {
    background: #f0f0f0;
    color: #333;
}

.btn-clear:hover {
    background: #e0e0e0;
}

/* Quick search buttons */
.quick-search {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.quick-search-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
}

.quick-search-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.quick-search-btn-icon {
    font-size: 24px;
}

/* Trip info section */
.trip-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    display: none;
}

.trip-info.show {
    display: block;
}

.trip-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.trip-info-row:last-child {
    margin-bottom: 0;
}

.trip-info-label {
    color: #666;
    font-weight: 500;
}

.trip-info-value {
    color: #333;
    font-weight: 600;
}

/* Status messages */
.status {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.status.show {
    display: block;
}

.status.loading {
    background: #fff3cd;
    color: #856404;
}

.status.success {
    background: #d4edda;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Preferences section */
.preferences-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.preferences-section h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.preference-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
    padding: 0;
}

.toggle-switch.active {
    background: #667eea;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.toggle-switch.active::after {
    left: 22px;
}

/* Voice control section */
.voice-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.voice-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.voice-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-voice {
    background: #ff6b6b;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-voice:hover {
    background: #ff5252;
}

.btn-voice.active {
    background: #51cf66;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.btn-voice-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px;
    border: 2px solid white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-voice-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.voice-status {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    min-height: 18px;
    font-size: 12px;
}

/* Responsive design - Mobile First */
@media (max-width: 768px) {
    .bottom-sheet {
        border-radius: 16px 16px 0 0;
        /* iOS safe area for bottom sheet */
        padding-bottom: var(--safe-area-inset-bottom);
    }

    .bottom-sheet-content {
        padding: 15px;
        /* Enable smooth momentum scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }

    .quick-search {
        grid-template-columns: 1fr 1fr;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    /* Larger touch targets for accessibility (min 44px) */
    button, .btn, .fab, input, select, .toggle-btn {
        min-height: 44px;
        min-width: 44px;
    }

    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

@media (max-width: 480px) {
    .fab-container {
        bottom: calc(90px + var(--safe-area-inset-bottom));
        right: calc(10px + var(--safe-area-inset-right));
    }

    .fab {
        width: 52px;
        height: 52px;
        font-size: 22px;
        /* Better touch feedback */
        transition: transform 0.1s ease, box-shadow 0.1s ease;
    }

    .fab:active {
        transform: scale(0.92);
    }

    .quick-search {
        grid-template-columns: 1fr;
    }

    .bottom-sheet-content {
        padding: 12px;
        padding-bottom: calc(12px + var(--safe-area-inset-bottom));
    }

    /* Better button spacing for touch */
    .button-group {
        gap: 12px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 12px;
    }
}

/* Standalone PWA mode adjustments */
@media (display-mode: standalone) {
    .app-container {
        padding-top: var(--safe-area-inset-top);
    }

    .bottom-sheet {
        padding-bottom: var(--safe-area-inset-bottom);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn, .fab {
        border: 2px solid currentColor;
    }

    input, select, textarea {
        border-width: 2px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .bottom-sheet {
        transition: none;
    }
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
}

/* Voice Control Styles */
.voice-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.voice-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.voice-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-voice {
    background: #ff6b6b;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-voice:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.btn-voice.active {
    background: #51cf66;
    animation: pulse 1s infinite;
}

.btn-voice-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px;
    border: 2px solid white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-voice-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.voice-status {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    min-height: 20px;
    font-size: 14px;
}

.voice-transcript {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    min-height: 30px;
    font-size: 14px;
    font-style: italic;
}

.voice-commands {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
}

.voice-commands p {
    margin: 0 0 8px 0;
    font-weight: bold;
}

.voice-commands ul {
    margin: 0;
    padding-left: 20px;
}

.voice-commands li {
    margin: 4px 0;
}

.status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    display: none;
}

.status.loading {
    display: block;
    background: #fff3cd;
    color: #856404;
}

.status.success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.status.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

.result {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: none;
}

.result.show {
    display: block;
}

.result-item {
    margin: 10px 0;
    font-size: 16px;
}

.result-label {
    font-weight: bold;
    color: #667eea;
}

/* Phase 2 Features Styles */
.search-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-history-dropdown.show {
    display: block;
}

.search-history-item {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.search-history-item:hover {
    background: #f8f9ff;
}

/* Autocomplete Dropdown Styles */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autocomplete-item:hover {
    background: #f0f7ff;
}

.autocomplete-item-icon {
    font-size: 16px;
    min-width: 20px;
}

.autocomplete-item-text {
    flex: 1;
    min-width: 0;
}

.autocomplete-item-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-item-address {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-loading {
    padding: 12px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.autocomplete-no-results {
    padding: 12px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-history-item-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.search-history-item-meta {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.favorites-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.favorites-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.favorite-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-size: 13px;
    color: #333;
}

.favorite-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.favorite-btn-name {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.favorite-btn-category {
    font-size: 11px;
    color: #999;
}

.lane-guidance-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.lane-guidance-display.show {
    display: block;
}

.lane-guidance-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    opacity: 0.9;
}

.lane-visual {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    justify-content: center;
}

.lane-indicator {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.lane-indicator.current {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.lane-indicator.recommended {
    background: #51cf66;
    border-color: #51cf66;
}

.lane-guidance-text {
    font-size: 14px;
    text-align: center;
}

.speed-warning-display {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    font-weight: 600;
}

.speed-warning-display.show {
    display: block;
}

.speed-warning-display.compliant {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.speed-warning-display.approaching {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.speed-warning-display.exceeding {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.speed-warning-text {
    font-size: 14px;
}

.speed-warning-details {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.9;
}

/* Variable Speed Limit Display */
.variable-speed-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.variable-speed-display.show {
    display: block;
}

.variable-speed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.variable-speed-icon {
    font-size: 16px;
}

.variable-speed-title {
    font-weight: 600;
}

.variable-speed-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.variable-speed-limit {
    font-size: 28px;
    font-weight: bold;
}

.variable-speed-info {
    font-size: 12px;
    text-align: right;
    opacity: 0.9;
}

.variable-speed-info-item {
    margin: 4px 0;
}

/* Phase 3 Features Styles */
.gesture-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: rgba(102, 126, 234, 0.9);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    z-index: 300;
    animation: shake-pulse 0.5s ease-out;
}

.gesture-indicator.show {
    display: flex;
}

@keyframes shake-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.battery-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 6px;
}

.battery-indicator.low {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.battery-indicator.medium {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.battery-indicator.high {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.battery-icon {
    font-size: 14px;
}

.theme-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.theme-option {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
}

.theme-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.theme-option.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.theme-preview {
    width: 100%;
    height: 40px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.theme-preview.standard {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 1px solid #ccc;
}

.theme-preview.satellite {
    background: linear-gradient(135deg, #8b7355 0%, #5a4a3a 100%);
}

.theme-preview.dark {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
}

.ml-predictions-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
}

.ml-predictions-section.show {
    display: block;
}

.ml-predictions-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.ml-prediction-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.ml-prediction-item:last-child {
    margin-bottom: 0;
}

.ml-prediction-label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.ml-prediction-details {
    font-size: 12px;
    opacity: 0.9;
}

.gesture-sensitivity-slider {
    width: 100%;
    margin-top: 8px;
}

.preference-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.preference-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.preference-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

/* Routing Mode Buttons */
.routing-mode-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.routing-mode-btn:hover {
    border-color: #667eea;
    background: #f5f5ff;
}

.routing-mode-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Vehicle Marker Icon - Custom SVG with directional indicator */
.vehicle-marker-icon {
    width: 50px !important;
    height: 50px !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.vehicle-marker-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Ensure smooth rotation transitions */
.vehicle-marker-icon > div {
    transition: transform 0.3s ease-out !important;
}

/* ===== DARK MODE STYLES ===== */
/* Dark mode is applied via body.dark-mode class */

body.dark-mode {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode html {
    background: #1a1a1a;
}

/* Bottom Sheet Dark Mode */
body.dark-mode .bottom-sheet {
    background: #2d2d2d;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

body.dark-mode .bottom-sheet-handle::before {
    background: #555;
}

body.dark-mode .bottom-sheet-header {
    border-bottom-color: #444;
}

body.dark-mode .bottom-sheet-header h2 {
    color: #e0e0e0;
}

body.dark-mode .bottom-sheet-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .bottom-sheet-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-mode .bottom-sheet-content::-webkit-scrollbar-thumb {
    background: #555;
}

body.dark-mode .bottom-sheet-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Form Elements Dark Mode */
body.dark-mode label {
    color: #b0b0b0;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: #667eea;
    background: #3a3a3a;
    color: #e0e0e0;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #888;
}

/* Button Dark Mode */
body.dark-mode .btn-calculate {
    background: #667eea;
    color: white;
}

body.dark-mode .btn-calculate:hover {
    background: #5568d3;
}

body.dark-mode .btn-clear {
    background: #3a3a3a;
    color: #e0e0e0;
    border: 1px solid #555;
}

body.dark-mode .btn-clear:hover {
    background: #4a4a4a;
}

/* Routing Mode Buttons Dark Mode */
body.dark-mode .routing-mode-btn {
    background: #3a3a3a;
    border-color: #555;
    color: #b0b0b0;
}

body.dark-mode .routing-mode-btn:hover {
    border-color: #667eea;
    background: #3a3a3a;
}

body.dark-mode .routing-mode-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* FAB Dark Mode */
body.dark-mode .fab {
    background: #3a3a3a;
    color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode .fab:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

/* Status Messages Dark Mode */
body.dark-mode .status.loading {
    background: #4a3a1a;
    color: #ffd700;
}

body.dark-mode .status.success {
    background: #1a3a1a;
    color: #51cf66;
}

body.dark-mode .status.error {
    background: #3a1a1a;
    color: #ff6b6b;
}

body.dark-mode .status.info {
    background: #1a2a3a;
    color: #74c0fc;
}

/* Result Container Dark Mode */
body.dark-mode .result {
    background: #3a3a3a;
    border: 1px solid #555;
}

/* Preference Items Dark Mode */
body.dark-mode .preference-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .preference-label {
    color: #b0b0b0;
}

/* Toggle Switch Dark Mode */
body.dark-mode .toggle-switch {
    background: #3a3a3a;
    border-color: #555;
}

body.dark-mode .toggle-switch.active {
    background: #4CAF50;
    border-color: #4CAF50;
}

/* Theme Option Dark Mode */
body.dark-mode .theme-option {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .theme-option:hover {
    border-color: #667eea;
    background: #4a4a4a;
}

body.dark-mode .theme-option.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Preferences Section Dark Mode */
body.dark-mode .preferences-section {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .preferences-section h3 {
    color: #e0e0e0;
}

/* Tabs Dark Mode */
body.dark-mode .tab-button {
    background: #3a3a3a;
    color: #b0b0b0;
    border-color: #555;
}

body.dark-mode .tab-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Tab Content Dark Mode */
body.dark-mode .tab-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

/* Battery Indicator Dark Mode */
body.dark-mode .battery-indicator {
    background: #3a3a3a;
    border-color: #667eea;
    color: #e0e0e0;
}

body.dark-mode .battery-indicator.low {
    background: #3a1a1a;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

body.dark-mode .battery-indicator.medium {
    background: #3a3a1a;
    border-color: #ffd700;
    color: #ffd700;
}

body.dark-mode .battery-indicator.high {
    background: #1a3a1a;
    border-color: #51cf66;
    color: #51cf66;
}

/* Slider Dark Mode */
body.dark-mode .preference-slider {
    background: #555;
}

body.dark-mode .preference-slider::-webkit-slider-thumb {
    background: #667eea;
}

body.dark-mode .preference-slider::-moz-range-thumb {
    background: #667eea;
}

/* Location Input Group Dark Mode */
body.dark-mode .location-input-group {
    background: #3a3a3a;
}

body.dark-mode .location-btn {
    background: #4a4a4a;
    border-color: #666;
    color: #e0e0e0;
}

body.dark-mode .location-btn:hover {
    background: #555;
}

body.dark-mode .location-btn:active {
    background: #666;
}

/* Autocomplete Dropdown Dark Mode */
body.dark-mode .autocomplete-dropdown,
body.dark-mode .search-history-dropdown {
    background: #3a3a3a;
    border-color: #555;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode .autocomplete-item,
body.dark-mode .history-item {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .autocomplete-item:hover,
body.dark-mode .history-item:hover {
    background: #4a4a4a;
}

/* Route Preview Dark Mode */
body.dark-mode .route-preview-container {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .route-preview-item {
    background: #2d2d2d;
    border-color: #555;
    color: #e0e0e0;
}

/* Route Comparison Dark Mode */
body.dark-mode .route-comparison-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .route-comparison-item:hover {
    background: #4a4a4a;
}

/* Trip History Dark Mode */
body.dark-mode .trip-history-item {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .trip-history-item:hover {
    background: #4a4a4a;
}

/* In-App Notification Dark Mode */
body.dark-mode .in-app-notification {
    background: #3a3a3a;
    border-color: #555;
    color: #e0e0e0;
}

body.dark-mode .in-app-notification.success {
    background: #1a3a1a;
    border-color: #51cf66;
    color: #51cf66;
}

body.dark-mode .in-app-notification.error {
    background: #3a1a1a;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

body.dark-mode .in-app-notification.info {
    background: #1a2a3a;
    border-color: #74c0fc;
    color: #74c0fc;
}

/* Voice Section Dark Mode */
body.dark-mode .voice-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .voice-status,
body.dark-mode .voice-transcript,
body.dark-mode .voice-commands {
    background: rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

/* ML Predictions Dark Mode */
body.dark-mode .ml-predictions-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .ml-prediction-item {
    background: rgba(0, 0, 0, 0.2);
    border-left-color: rgba(255, 255, 255, 0.2);
}

/* Gesture Indicator Dark Mode */
body.dark-mode .gesture-indicator {
    background: rgba(102, 126, 234, 0.9);
}

/* Headings Dark Mode */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #e0e0e0;
}

/* Form Group Dark Mode */
body.dark-mode .form-group {
    background: transparent;
}

body.dark-mode .form-group[style*="background: #f5f5f5"] {
    background: #3a3a3a !important;
}

