/* Base styles */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #f5f5f5;
}

#map-container {
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Speed info display */
#speed-info {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    z-index: 1000;
    text-align: right;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    min-width: 180px;
}

.speed-value {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.speed-limit {
    font-size: 16px;
    color: #e74c3c;
    font-weight: 600;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #ffffff;
    margin: 5vh auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.close {
    color: #7f8c8d;
    float: right;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: #e74c3c;
    background-color: #f8f9fa;
    transform: rotate(90deg);
}

#poi-title {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

#poi-description {
    margin: 0 0 25px 0;
    color: #34495e;
    line-height: 1.6;
    font-size: 16px;
}

#poi-link {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

#poi-link:hover {
    background: linear-gradient(135deg, #2980b9, #2573a6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

#poi-link:active {
    transform: translateY(0);
}

#poi-image {
    width: 100%;
    height: auto;
    max-height: 40vh;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Services bar */
#services-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: rgba(44, 62, 80, 0.9);
    padding: 5px 15px;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.service-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    cursor: pointer;
    padding: 12px 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
}

.service-icon:hover {
    transform: translateY(-5px) scale(1.05);
}

.service-icon:active {
    transform: translateY(0) scale(0.98);
}

.service-icon i {
    font-size: 32px;
    color: white;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    width: 40px; /* To maintain layout */
    text-align: center;
}

.service-icon:hover i {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.service-icon .distance {
    font-size: 14px;
    margin-top: 8px;
    color: #3498db;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-height: 20px;
}

.service-icon .distance:empty::after {
    content: "Loading...";
    color: #bdc3c7;
    font-style: italic;
    font-size: 12px;
}

/* Audio controls */
#audio-controls {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

#audio-toggle {
    padding: 14px 32px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
    letter-spacing: 0.5px;
}

#audio-toggle:hover {
    background: linear-gradient(135deg, #229954, #28b463);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.5);
}

#audio-toggle:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 3px 15px rgba(46, 204, 113, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 25% auto;
        padding: 25px;
    }
    
    #speed-info {
        top: 15px;
        right: 15px;
        padding: 12px 15px;
        min-width: 150px;
    }
    
    .speed-value {
        font-size: 24px;
    }
    
    .service-icon i {
        font-size: 30px;
    }
    
    .service-icon .distance {
        font-size: 13px;
        margin-top: 6px;
    }
    
    #audio-toggle {
        padding: 12px 25px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #speed-info {
        top: 10px;
        right: 10px;
        padding: 10px 12px;
    }
    
    .speed-value {
        font-size: 22px;
    }
    
    .service-icon i {
        font-size: 28px;
    }
    
    .service-icon .distance {
        font-size: 12px;
    }
}


/* Custom marker styles */
.user-location-icon {
    background: transparent !important;
    border: none !important;
}

.poi-icon {
    background: transparent !important;
    border: none !important;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.loading-screen p {
    margin: 0 0 30px 0;
    font-size: 16px;
    opacity: 0.9;
    text-align: center;
    max-width: 80%;
}

/* Animation for loading */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Error states */
.error-state {
    background: #e74c3c;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
}

/* POI Label Styles */
.poi-label {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    box-shadow: none;
    white-space: nowrap;
}

/* Success states */
.success-state {
    background: #27ae60;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
}