/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.app-container {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Modern navigation card styles */
.controls {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: white;
    padding: 8px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
    max-width: 400px;
    width: 90%;
    transition: transform 0.3s, opacity 0.3s;
}

.controls.hidden {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
    pointer-events: none;
}

.controls h2 {
    margin: 0;
    color: #333;
    font-size: 16px;
    flex: 1;
}

.route-progress {
    font-weight: bold;
    font-size: 14px;
    color: #555;
    padding: 0 10px;
    border-left: 1px solid #eee;
}

#start-navigation {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#start-navigation:hover {
    background: #0056b3;
}

#start-navigation:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* Google Maps style navigation instructions */
.instructions-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 10;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, opacity 0.3s;
    overflow: hidden;
    max-height: 40vh;
}

.instructions-panel.hide {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.instructions-panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.instructions-panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.next-instruction {
    padding: 20px;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.instruction-icon {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    background: #007bff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.instruction-text {
    flex: 1;
}

.instruction-main {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.instruction-distance {
    color: #666;
    font-size: 14px;
}

#instructions {
    padding: 0;
    overflow-y: auto;
    max-height: calc(40vh - 180px);
}

.instruction {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.instruction-number {
    width: 24px;
    height: 24px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 12px;
    color: #495057;
}

.instruction.summary {
    background: #f8f9fa;
    font-weight: bold;
    padding: 15px 20px;
}

.distance {
    margin-left: auto;
    color: #6c757d;
    font-size: 13px;
}

/* Route marker styling */
.marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #ff4500;
    border: 2px solid white;
    text-align: center;
    color: white;
    font-weight: bold;
    line-height: 24px;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.marker.active {
    background-color: #4CAF50;
    width: 30px;
    height: 30px;
    line-height: 30px;
    z-index: 6;
    font-size: 12px;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background-color: rgba(33, 37, 41, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 80%;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Custom bike marker */
#bike-marker-custom {
    position: absolute;
    width: 24px;
    height: 24px;
    z-index: 9999;
    pointer-events: none;
    transform-origin: center center;
    transition: transform 0.3s ease, left 0.3s ease, top 0.3s ease;
}

#bike-marker-custom svg {
    filter: drop-shadow(0px 0px 8px rgba(0,0,0,0.5));
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Orientation permission button */
.orientation-btn {
    position: absolute;
    bottom: 40vh;
    left: 50%;
    transform: translateX(-50%);
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.orientation-btn:hover {
    background-color: #0056b3;
}

/* Navigation info display */
.navigation-info {
    position: fixed;
    top: 70px;
    left: 10px;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 10px 15px;
    max-width: 260px;
    transform-origin: top left;
    transition: transform 0.3s, opacity 0.3s;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

.navigation-info.hide {
    transform: scale(0.8);
    opacity: 0;
    pointer-events: none;
}

.navigation-info strong {
    color: #007bff;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

/* Toggle info button */
.toggle-info-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    color: #333;
    padding: 10px;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.toggle-info-btn:hover {
    transform: scale(1.1);
}

/* Adjustments for mobile screens */
@media (max-width: 768px) {
    .controls {
        top: 10px;
        padding: 8px 12px;
    }
    
    .route-progress {
        display: none;
    }
    
    .instructions-panel {
        max-height: 50vh;
    }
    
    .next-instruction {
        padding: 15px;
    }
    
    .instruction-main {
        font-size: 16px;
    }
}
