body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    background-color: #f0f0f0;
}

#map {
    height: 100vh;
    width: 100vw;
    z-index: 1;
}

/* Splash Screen (Waze style) */
#loading-screen.real-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1976d2; /* Changed to a nice blue for the car theme, or keep red. Let's use blue */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

.splash-animation-container {
    position: relative;
    width: 200px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.splash-logo {
    position: absolute;
    z-index: 2;
    animation: driveIn 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.splash-puddle {
    position: absolute;
    bottom: -10px;
    z-index: 1;
    animation: puddleAppear 0.5s ease-out 0.7s both;
}

.droplet {
    animation: dropletFly 0.6s ease-out both;
}
.d1 { animation-delay: 0.75s; }
.d2 { animation-delay: 0.8s; }
.d3 { animation-delay: 0.85s; }
.d4 { animation-delay: 0.9s; }

@keyframes puddleAppear {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes dropletFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(0, -40px) scale(0); opacity: 0; }
}

@keyframes driveIn {
    0% { transform: translateX(-300px) translateY(-10px) scale(0.5); opacity: 0; }
    70% { transform: translateX(20px) translateY(0) scale(1.05); opacity: 1; }
    100% { transform: translateX(0) translateY(0) scale(1); opacity: 1; }
}

.splash-title {
    font-family: 'Arial Rounded MT Bold', 'Varela Round', Arial, sans-serif;
    color: white;
    font-size: 38px;
    font-weight: 900;
    margin-top: 15px;
    letter-spacing: 2px;
    animation: fadeIn 1s ease-out 0.6s both;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.splash-loading {
    margin-top: 40px;
    width: 200px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    animation: fadeIn 1s ease-out 0.8s both;
}

.loading-bar {
    width: 40%;
    height: 100%;
    background-color: white;
    border-radius: 10px;
    animation: loadProgress 1.5s infinite ease-in-out;
}

@keyframes loadProgress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

.splash-text {
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    animation: fadeIn 1s ease-out 1s both;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* UI Moderne (Top UI) */
.top-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 350px;
    max-width: 90%;
    z-index: 1000;
}

/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: white;
    z-index: 9998; /* Juste sous le splash screen */
    display: none; /* Masqué par défaut, affiché en JS */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Segoe UI', Roboto, sans-serif;
}
.welcome-content {
    padding: 30px;
    max-width: 400px;
}
.start-btn {
    background: #1976d2;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(25,118,210,0.4);
    width: 100%;
    transition: transform 0.2s, background 0.2s;
}
.start-btn:hover { transform: scale(1.05); background: #1565c0; }
.start-btn:active { transform: scale(0.95); }
.skip-btn {
    background: transparent;
    color: #888;
    border: none;
    padding: 10px;
    margin-top: 15px;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
}

/* Carte de recherche propre */
.search-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Autocomplete list */
.autocomplete-items {
    border-top: 1px solid #d4d4d4;
    background-color: #fff;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}
.autocomplete-items div {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}
.autocomplete-items div:hover {
    background-color: #f1f1f1;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.search-icon {
    width: 18px;
    height: 18px;
    margin-right: 12px;
}

.search-input-wrapper input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
    background: transparent;
}

.search-input-wrapper input::placeholder {
    color: #999;
}

.go-btn {
    background-color: #1976d2;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.4);
    transition: transform 0.2s, background-color 0.2s;
}

.go-btn:hover {
    background-color: #115293;
    transform: scale(1.05);
}

.divider {
    height: 1px;
    background-color: #f0f0f0;
    margin: 0 16px;
}

/* Filtres (Rayon) */
.filters-container {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background-color: #fafafa;
}

.filter-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
    margin-right: 10px;
}

.chip-group {
    display: flex;
    gap: 6px;
    flex-grow: 1;
    overflow-x: auto;
}

.chip {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.chip:hover {
    background: #f5f5f5;
}

.chip.active {
    background: #e53935;
    color: white;
    border-color: #e53935;
}

.recenter-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.2s;
    font-size: 16px;
}

.recenter-btn:hover {
    background: #f0f0f0;
}

/* Smooth Marker GPS */
.user-car-icon {
    transition: transform 0.3s linear;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.4));
}
.user-car-icon svg {
    transition: transform 0.5s ease-out;
}
.hydrant-icon {
    filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.6));
    transition: transform 0.2s;
}
.hydrant-icon:hover {
    transform: scale(1.1);
}

/* Boutons popup map */
.leaflet-popup-content button {
    margin-top: 10px;
    padding: 10px;
    background-color: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
}
.leaflet-popup-content button:hover {
    background-color: #115293;
}

/* Panel de navigation (Leaflet Routing Machine) */
.leaflet-routing-container {
    background-color: white !important;
    padding: 12px !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15) !important;
    max-height: 40vh;
    overflow-y: auto;
    font-family: inherit !important;
}

/* Traffic Toggle */
.traffic-toggle {
    margin-top: 15px;
}
.traffic-toggle button {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.2s;
    font-size: 14px;
}
.traffic-toggle button:hover {
    transform: scale(1.05);
}

/* Modal Pompier */
.firefighter-mode {
    position: absolute;
    bottom: 25px;
    left: 20px;
    z-index: 1000;
}
.firefighter-mode button {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
}
.firefighter-mode button:hover {
    transform: scale(1.05);
    background-color: #b71c1c;
}
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    font-family: inherit;
}
.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover { color: #333; }
#auth-section input {
    width: calc(100% - 24px);
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}
.auth-btn {
    width: 100%;
    padding: 12px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}
.auth-btn:hover { background: #b71c1c; }

/* Tactical Menu Pompier */
#tactical-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(30, 30, 30, 0.95);
    color: white;
    border: 2px solid #d32f2f;
    border-radius: 8px;
    width: 280px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    font-family: monospace;
}
.tactical-header {
    background: #d32f2f;
    padding: 10px;
    font-weight: bold;
    text-align: center;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    font-size: 16px;
}
.tactical-body {
    padding: 15px;
}
.tactical-row {
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #555;
    padding-bottom: 8px;
    font-size: 14px;
}
.tactical-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.scan-btn {
    width: 100%;
    background: #ff9800;
    color: black;
    border: none;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
}
.scan-btn:hover {
    background: #e65100;
    color: white;
}
.fire-icon {
    font-size: 32px;
    text-align: center;
    animation: flicker 1s infinite alternate;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.8));
}
@keyframes flicker {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0.8; }
}
