/* css/safemap.css */

body {
    margin: 0;
    overflow: hidden;
    /* Prevent scrolling, map will handle dragging */
    background-color: #f0f9ff;
}

.map-wrapper {
    position: relative;
    height: 100vh;
    width: 100vw;
}

/* Header floating over map */
.map-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* Leaflet map z-index is 400, header must be higher */
    padding: 20px;
    pointer-events: none;
    /* Let clicks pass through to the map except for child elements */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.1);
    pointer-events: auto;
    /* Enable clicks on the header box itself */
    max-width: 600px;
    margin: 0 auto;
}

.header-content h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
}

.icon-circle {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #475569;
    cursor: pointer;
}

/* The Map */
#safeMap {
    height: 100%;
    width: 100%;
    z-index: 1;
    /* Base layer */
}

/* Floating Controls (Right Side) */
/* Purane Map Controls me se police/hospital hata diya */
.map-controls {
    position: absolute;
    right: 20px;
    bottom: 160px;
    /* Thoda upar shift kiya taaki report box se na takraye */
    z-index: 1000;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s;
}

.locate-btn {
    background: #2563eb;
    font-size: 1.4rem;
    border: 3px solid white;
}

/* Reporting Box Styling */
.report-container {
    position: absolute;
    bottom: 90px;
    /* Nav bar ke theek upar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    text-align: center;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.report-title {
    font-size: 0.95rem;
    margin-bottom: 2px;
    font-weight: 700;
    color: #1e293b;
}

.report-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 12px;
}

.report-btns {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.report-btn {
    border: none;
    padding: 12px;
    border-radius: 14px;
    color: white;
    cursor: pointer;
    flex: 1;
    font-size: 1.3rem;
    transition: transform 0.2s, filter 0.2s;
}

.report-btn:active {
    transform: scale(0.95);
}

.report-btn:hover {
    filter: brightness(1.1);
}

.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Temporary Pin Icon (Jab user map pe click karega) */
.temp-pin-icon {
    color: #334155;
    font-size: 2rem;
    text-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%);
}

/* Red */

/* ========================================= */
/* 🌟 BOTTOM NAV (Reused from Dashboard) 🌟  */
/* ========================================= */
.bottom-nav {
    position: absolute;
    /* Fixed to absolute for map integration */
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 560px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px 10px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-item.active {
    color: #2563eb;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

/* Custom Map Marker CSS */
.user-marker-pulse {
    background-color: #2563eb;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 rgba(37, 99, 235, 0.4);
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

/* ========================================= */
/* 💻 DESKTOP RESPONSIVENESS (CARD LAYOUT) 💻*/
/* ========================================= */

@media (min-width: 768px) {
    body {
        background-color: #e2e8f0;
        /* Dashboard jaisa dark outer background */
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    .map-wrapper {
        max-width: 900px;
        /* Dashboard wale box ki width */
        width: 100%;
        height: calc(100vh - 80px);
        /* Upar-neeche thodi jagah chhodne ke liye */
        margin: auto;
        border-radius: 25px;
        /* Same rounded corners */
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        /* IMPORTANT: Map ko gol kono (rounded corners) ke andar rakhne ke liye */
        position: relative;
    }

    /* Map ke upar wala header box */
    .header-content {
        max-width: calc(100% - 60px);
        margin: 20px auto 0;
    }

    /* Floating Bottom Nav - Center mein chhota aur pyara */
    .bottom-nav {
        max-width: 450px;
        bottom: 30px;
    }

    /* Report karne wala box */
    .report-container {
        bottom: 120px;
        /* Nav bar ke theek upar */
        max-width: 450px;
    }

    /* Locate Me button thoda aur andar shift kiya */
    .map-controls {
        right: 30px;
        bottom: 180px;
    }
}

/* Search UI Styling */
.search-container {
    position: absolute;
    top: 90px;
    /* Header ke niche */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.input-wrapper i {
    margin-right: 10px;
    font-size: 0.9rem;
}

.source-icon {
    color: #2563eb;
}

.dest-icon {
    color: #ef4444;
}

.input-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
    color: #1e293b;
}

.route-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.route-btn:hover {
    background: #1e40af;
}