/* ====================================
   WAZE-STYLE NAVIGATION SYSTEM CSS
   Modern, Clean, Professional Design
   ==================================== */

/* Navigation Modal Styles */
.navigation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #FAFAFA;
    z-index: 9999;
    overflow: hidden;
}

.navigation-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.navigation-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Navigation Header - Minimalist Design */
.navigation-header {
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
    padding: 20px 16px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-from-to {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFFFFF;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1.5px solid #E8EAED;
    transition: all 0.2s ease;
}

.nav-input-group:focus-within {
    border-color: #1A73E8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.nav-icon-start {
    color: #1A73E8;
    font-size: 14px;
    min-width: 14px;
}

.nav-icon-end {
    color: #EA4335;
    font-size: 18px;
    min-width: 18px;
}

.nav-input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 15px;
    color: #202124;
    outline: none;
    font-weight: 400;
}

.nav-input::placeholder {
    color: #80868B;
}

.nav-close-btn {
    background: #F1F3F4;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5F6368;
    font-size: 18px;
    transition: all 0.2s ease;
}

.nav-close-btn:hover {
    background: #E8EAED;
    transform: rotate(90deg);
}

/* Map Container */
.navigation-map {
    flex: 1;
    width: 100%;
    position: relative;
    background: #E5E3DF;
    overflow: hidden;
}

#navigationMap {
    width: 100%;
    height: 100%;
}

/* Compass Mode Toast Notification */
.compass-toast {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background: linear-gradient(135deg, #202124 0%, #3C4043 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.compass-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.compass-toast i {
    font-size: 16px;
}

/* Compass Indicator Overlay */
.compass-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.compass-indicator.active {
    display: flex;
}

.compass-needle {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 30px solid #EA4335;
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.compass-needle::after {
    content: 'N';
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: #202124;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* User location marker - Premium Design */
.user-location-marker {
    position: relative;
    width: 44px !important;
    height: 44px !important;
}

.user-location-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #1A73E8 0%, #0D47A1 100%);
    border: 3.5px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.5);
}

/* Heading arrow - REMOVED */
/* .user-location-marker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 22px solid #1A73E8;
    filter: drop-shadow(0 2px 6px rgba(26, 115, 232, 0.4));
} */

/* Destination marker */
.destination-marker {
    background: #ea4335;
    width: 12px;
    height: 12px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Navigation Panel */
.navigation-panel {
    position: absolute;
    top: 150px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

/* Direction Banner */
.nav-direction-banner {
    background: linear-gradient(135deg, #1e8e3e 0%, #34a853 100%);
    color: white;
    padding: 20px 24px;
    margin: 0 80px 0 16px; /* Add right margin to avoid map controls */
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nav-direction-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.nav-direction-text {
    flex: 1;
}

.nav-street-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-instruction {
    font-size: 14px;
    opacity: 0.95;
}

/* Next Step */
.nav-next-step {
    background: #1a73e8;
    color: white;
    padding: 16px 24px;
    margin: 12px 16px;
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    pointer-events: auto;
    font-size: 16px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(26,115,232,0.4);
}

.next-label {
    font-weight: 600;
}

.nav-next-icon {
    font-size: 18px;
}

/* Bottom Controls */
.nav-bottom-controls {
    margin-top: auto;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 20px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
    pointer-events: auto;
}

.nav-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.nav-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #5f6368;
}

.nav-stat i {
    font-size: 16px;
}

.nav-stat span {
    font-weight: 600;
    color: #202124;
}

.nav-speed {
    background: #f1f3f4;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 80px;
}

.speed-value {
    font-size: 32px;
    font-weight: 700;
    color: #202124;
    line-height: 1;
}

.speed-unit {
    font-size: 12px;
    color: #5f6368;
    margin-top: 4px;
}

/* Action Buttons */
.nav-action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-start-btn {
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    border: none;
    border-radius: 28px;
    padding: 14px 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: white;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(26,115,232,0.4);
    flex: 1;
    justify-content: center;
    min-width: 140px;
}

.nav-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,115,232,0.5);
    background: linear-gradient(135deg, #1765cc 0%, #0b3d8f 100%);
}

.nav-start-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26,115,232,0.4);
}

.nav-start-btn.active {
    background: linear-gradient(135deg, #34a853 0%, #1e8e3e 100%);
    box-shadow: 0 4px 12px rgba(52,168,83,0.4);
}

.nav-start-btn.active:hover {
    background: linear-gradient(135deg, #2d9248 0%, #1a7c37 100%);
    box-shadow: 0 6px 20px rgba(52,168,83,0.5);
}

.nav-start-btn i {
    font-size: 18px;
}

.nav-start-btn span {
    font-size: 16px;
    letter-spacing: 0.5px;
}

.nav-action-btn {
    background: white;
    border: 2px solid #e8eaed;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5f6368;
    font-size: 18px;
    transition: all 0.2s;
}

.nav-action-btn:hover {
    background: #f1f3f4;
    border-color: #dadce0;
}

.nav-action-btn.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

#compassModeBtn.active {
    background: #34a853;
    border-color: #34a853;
    color: white;
}

#toggle3DBtn.active {
    background: #9c27b0;
    border-color: #9c27b0;
    color: white;
}

#toggle3DBtn.active:hover {
    background: #7b1fa2;
    border-color: #7b1fa2;
}

#endNavigationBtn {
    background: #ea4335;
    border-color: #ea4335;
    color: white;
}

#endNavigationBtn:hover {
    background: #d33828;
    border-color: #d33828;
}

/* Pulse animation for recenter button */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(26, 115, 232, 0);
    }
}

.nav-action-btn.pulse {
    animation: pulse 2s infinite;
}

/* External navigation buttons */
.external-nav-container {
    display: none;
    gap: 12px;
    margin-top: 12px;
}

.external-nav-container.show {
    display: flex;
}

.external-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.external-nav-btn:hover {
    background: #f1f3f4;
    border-color: #1a73e8;
    color: #1a73e8;
}

.external-nav-btn.waze {
    border-color: #00d9ff;
    color: #00d9ff;
}

.external-nav-btn.waze:hover {
    background: #00d9ff;
    color: white;
}

.external-nav-btn.google {
    border-color: #4285f4;
    color: #4285f4;
}

.external-nav-btn.google:hover {
    background: #4285f4;
    color: white;
}

/* Mapbox Custom Styles */
.mapboxgl-ctrl-directions {
    display: none !important;
}

.mapboxgl-ctrl-top-left,
.mapboxgl-ctrl-top-right,
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
    z-index: 999 !important;
}

/* Hide Mapbox attribution in navigation mode */
.navigation-modal .mapboxgl-ctrl-attrib {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    /* Reduce header padding for compact mobile layout */
    .navigation-header {
        padding: 12px 12px 10px;
    }
    
    /* Reduce input group padding */
    .input-group {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .input-group i {
        font-size: 14px;
    }
    
    /* Smaller close button */
    .close-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    /* Compact direction banner */
    .nav-direction-banner {
        padding: 12px 16px;
        margin: 0 70px 0 12px; /* Add right margin for controls */
        gap: 12px;
    }
    
    .nav-direction-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .nav-street-name {
        font-size: 18px;
        margin-bottom: 2px;
    }
    
    .nav-instruction {
        font-size: 12px;
    }
    
    /* Compact next step indicator */
    .nav-next-step {
        padding: 10px 16px;
        margin: 8px 12px;
        font-size: 14px;
        border-radius: 20px;
        gap: 8px;
    }
    
    .nav-next-icon {
        font-size: 16px;
    }
    
    /* Reduce bottom controls padding */
    .nav-bottom-controls {
        padding: 14px 12px;
        border-radius: 20px 20px 0 0;
    }
    
    /* Compact stats section */
    .nav-stats {
        margin-bottom: 12px;
    }
    
    .nav-stat {
        font-size: 12px;
        gap: 6px;
    }
    
    .nav-stat i {
        font-size: 14px;
    }
    
    .nav-stat span {
        font-size: 12px;
    }
    
    /* Smaller speed display */
    .nav-speed {
        padding: 8px 14px;
        min-width: 60px;
    }
    
    .speed-value {
        font-size: 24px;
    }
    
    .speed-unit {
        font-size: 10px;
    }
    
    /* Compact action buttons */
    .nav-action-buttons {
        gap: 8px;
    }
    
    .nav-start-btn {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 20px;
        min-width: 120px;
    }
    
    .nav-start-btn i {
        font-size: 16px;
    }
    
    .nav-start-btn span {
        font-size: 14px;
    }
    
    .nav-action-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Smaller compass indicator */
    .compass-indicator {
        width: 48px;
        height: 48px;
        font-size: 12px;
    }
    
    .compass-arrow {
        width: 20px;
        height: 20px;
        border-width: 10px 6px 0 6px;
    }
    
    /* Smaller user location marker */
    .user-location-marker {
        width: 36px;
        height: 36px;
    }
    
    .user-location-marker::before {
        width: 16px;
        height: 16px;
    }
    
    /* .user-location-marker::after {
        width: 8px;
        height: 8px;
    } */
    
    /* Compact external nav buttons */
    .external-nav-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 6px;
    }
    
    /* Adjust navigation panel top position */
    .navigation-panel {
        top: 120px;
    }
}

/* Minimalistic Mobile Styles for Small Devices */
@media (max-width: 428px) {
    /* Ultra Compact Header */
    .navigation-header {
        padding: 10px;
    }
    
    .nav-input-group {
        padding: 8px 10px;
        gap: 8px;
        border-radius: 10px;
    }
    
    .nav-icon-start {
        font-size: 11px;
        min-width: 11px;
    }
    
    .nav-icon-end {
        font-size: 13px;
        min-width: 13px;
    }
    
    .nav-input {
        font-size: 12px;
    }
    
    .nav-close-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    /* Ultra Compact Direction Banner */
    .nav-direction-banner {
        padding: 10px 12px;
        margin: 0 10px;
        margin-right: 56px;
        gap: 10px;
        border-radius: 8px;
    }
    
    .nav-direction-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .nav-street-name {
        font-size: 14px;
        margin-bottom: 2px;
    }
    
    .nav-instruction {
        font-size: 10px;
    }
    
    /* Ultra Compact Next Step */
    .nav-next-step {
        padding: 8px 12px;
        margin: 6px 10px;
        border-radius: 16px;
        font-size: 11px;
        gap: 6px;
    }
    
    .nav-next-icon {
        font-size: 12px;
    }
    
    /* Ultra Compact Bottom Controls */
    .nav-bottom-controls {
        padding: 10px;
        border-radius: 14px 14px 0 0;
    }
    
    .nav-stats {
        margin-bottom: 8px;
    }
    
    .nav-stat {
        font-size: 11px;
        gap: 4px;
    }
    
    .nav-stat i {
        font-size: 12px;
    }
    
    .nav-speed {
        padding: 6px 10px;
        min-width: 50px;
        border-radius: 8px;
    }
    
    .speed-value {
        font-size: 20px;
    }
    
    .speed-unit {
        font-size: 9px;
    }
    
    /* Ultra Compact Vehicle Toggle */
    .vehicle-toggle {
        width: 40px;
        height: 40px;
    }
    
    .vehicle-toggle img,
    .vehicle-icon-svg,
    .vehicle-icon-svg svg {
        width: 22px;
        height: 22px;
    }
    
    /* Ultra Compact Action Buttons */
    .nav-action-buttons {
        gap: 6px;
    }
    
    .nav-start-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 100px;
        border-radius: 18px;
        gap: 6px;
    }
    
    .nav-start-btn i {
        font-size: 12px;
    }
    
    .nav-start-btn span {
        font-size: 12px;
    }
    
    .nav-action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    /* Ultra Compact Compass */
    .compass-indicator {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
    }
    
    .compass-needle {
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-bottom: 18px solid #EA4335;
    }
    
    .compass-needle::after {
        top: 20px;
        font-size: 8px;
    }
    
    /* Ultra Compact Toast */
    .compass-toast {
        top: 60px;
        padding: 8px 14px;
        font-size: 11px;
        border-radius: 20px;
        gap: 6px;
    }
    
    .compass-toast i {
        font-size: 12px;
    }
    
    /* Adjust panel for small screens */
    .navigation-panel {
        top: 90px;
    }
}

/* Extra Small Devices (iPhone SE, Galaxy S8, etc) */
@media (max-width: 375px) {
    .navigation-header {
        padding: 8px;
    }
    
    .nav-from-to {
        gap: 8px;
    }
    
    .nav-input-group {
        padding: 6px 8px;
    }
    
    .nav-input {
        font-size: 11px;
    }
    
    .nav-close-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .nav-direction-banner {
        padding: 8px 10px;
        margin: 0 8px;
        margin-right: 52px;
    }
    
    .nav-direction-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .nav-street-name {
        font-size: 13px;
    }
    
    .nav-instruction {
        font-size: 9px;
    }
    
    .nav-next-step {
        padding: 6px 10px;
        margin: 5px 8px;
        font-size: 10px;
    }
    
    .nav-bottom-controls {
        padding: 8px;
    }
    
    .nav-start-btn {
        padding: 6px 12px;
        font-size: 11px;
        min-width: 90px;
    }
    
    .nav-action-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .speed-value {
        font-size: 18px;
    }
    
    .nav-speed {
        padding: 5px 8px;
        min-width: 45px;
    }
    
    .compass-indicator {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
    }
    
    .navigation-panel {
        top: 80px;
    }
}
