/* Variables Estilo Waze */
:root {
    --waze-blue: #33ccff;
    --waze-dark-blue: #0099cc;
    --waze-orange: #ff9900;
    --waze-yellow: #ffcc00;
    --waze-white: #ffffff;
    --waze-gray-light: #f2f2f2;
    --waze-gray-dark: #666666;
    --waze-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e5e3df; /* Fondo mapa por defecto */
}

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

/* Base de Paneles Superpuestos */
.overlay-panel {
    z-index: 10;
    background-color: var(--waze-white);
    border-radius: 20px;
    box-shadow: var(--waze-shadow);
    color: var(--waze-gray-dark);
}

/* Buscador Estilo Waze (Panel Flotante) */
#search-panel {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    padding: 10px;
}

#origin-input, #destination-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 15px;
    border: 1px solid #eee;
    background: #f9f9f9;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    outline: none;
    margin-bottom: 8px;
}

#origin-input::placeholder, #destination-input::placeholder {
    color: #aaa;
}

#search-btn {
    width: 100%;
    padding: 12px;
    border-radius: 15px;
    background-color: var(--waze-blue);
    color: white;
    box-shadow: none;
    font-weight: bold;
}

#search-results {
    width: 100%;
    list-style: none;
    margin-top: 15px;
    background: white;
    border-radius: 15px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#search-results li {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

#search-results li:hover {
    background: #f9f9f9;
}

/* Contenedor de Velocidad (Abajo Izquierda) */
#speed-container {
    position: absolute;
    bottom: 30px;
    left: 20px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    z-index: 10;
}

#speedometer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: white;
    border: 4px solid var(--waze-blue);
    box-shadow: var(--waze-shadow);
    transition: border-color 0.3s, background-color 0.3s;
}

#speedometer.overspeed {
    border-color: #FF453A;
    background-color: #ffeeee;
}

#speed-value {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    color: #333;
}

#speed-unit {
    font-size: 0.7rem;
    font-weight: bold;
    color: #888;
}

/* Límite de Velocidad (Señal Europea) */
#speed-limit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: white;
    border: 6px solid #FF453A;
    box-shadow: var(--waze-shadow);
}

#limit-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: #000;
}

/* Botones Flotantes Superiores */
.fab-btn-small {
    position: absolute;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--waze-white);
    color: #333;
    font-size: 1.5rem;
    box-shadow: var(--waze-shadow);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.fab-btn-small:active {
    transform: scale(0.9);
}

#settings-btn {
    top: 40px;
}

#layer-btn {
    top: 100px;
}

/* Panel de Perfil Oculto/Lateral */
#truck-profile-panel {
    position: absolute;
    top: 160px;
    right: 20px;
    width: 220px;
    padding: 20px;
}

#truck-profile-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fafafa;
    color: #333;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Botones Grandes */
button {
    border: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

button:active {
    transform: scale(0.95);
}

/* Estilo Botón Principal (IR / PARAR) */
.main-btn {
    flex: 1;
    height: 60px;
    border-radius: 30px;
    background-color: var(--waze-blue);
    color: white;
    font-size: 1.4rem;
    font-weight: 900;
    box-shadow: 0 6px 0 var(--waze-dark-blue), var(--waze-shadow);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-btn:active {
    box-shadow: 0 2px 0 var(--waze-dark-blue), var(--waze-shadow);
    transform: translate(-50%, 4px) !important; /* Mantiene el centrado si es necesario */
}

/* El transform: translateX(-50%) está en .bottom-controls, 
   pero el :active añade translateY, así que hay que tener cuidado. 
   Re-ajustamos .bottom-controls para usar flexbox y gap. */

.stop-btn {
    background-color: #FF453A !important;
    box-shadow: 0 6px 0 #cc372f, var(--waze-shadow) !important;
}

.stop-btn:active {
    box-shadow: 0 2px 0 #cc372f, var(--waze-shadow) !important;
}

#save-profile-btn {
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    background-color: var(--waze-blue);
    color: white;
    margin-top: 10px;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Controles Inferiores */
.bottom-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 10;
    display: flex;
    gap: 15px;
}

/* FAB de Reporte (Abajo a la Derecha) */
#report-btn {
    position: absolute;
    bottom: 30px;
    right: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--waze-yellow);
    color: #333;
    font-size: 2rem;
    box-shadow: 0 6px 0 #ccaa00, var(--waze-shadow);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

#report-btn:active {
    box-shadow: 0 2px 0 #ccaa00, var(--waze-shadow);
    transform: translateY(4px);
}

/* Marcador del Camión */
.truck-marker {
    font-size: 40px;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.4));
    margin-top: -20px;
}
