﻿
:root {
    --sr-navy: #12243a;
    --sr-blue: #1764d8;
    --sr-background: #f3f6fb;
    --sr-border: #e3e9f2;
}

/* GENERAL PAGE */
body {
    background: var(--sr-background);
}

.incident-page {
    width: 100%;
    min-width: 0;
    padding: 28px 0 48px;
}

.incident-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}

    .incident-header h1 {
        color: var(--sr-navy);
        font-weight: 750;
        margin: 8px 0;
    }

    .incident-header p {
        color: #66758a;
        margin-bottom: 0;
    }

.eyebrow {
    color: var(--sr-blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

/* INCIDENT CARDS */
.incident-card {
    background: #fff;
    border: 1px solid var(--sr-border);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 6px 24px rgba(20, 40, 70, 0.04);
    width: 100%;
    min-width: 0;
    height: 100%;
}

.incident-page .row > * {
    min-width: 0;
}

.incident-card h4 {
    font-weight: 700;
    color: var(--sr-navy);
    margin-bottom: 20px;
}

/* FORM STYLING */
.form-label {
    font-weight: 600;
    color: #35445a;
}

.form-control,
.form-select {
    border-radius: 9px;
    padding: 11px 13px;
    border-color: #d6dfeb;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--sr-blue);
        box-shadow: 0 0 0 3px rgba(23, 100, 216, 0.12);
    }

.btn-primary {
    background: var(--sr-blue);
    border-color: var(--sr-blue);
    border-radius: 9px;
    font-weight: 600;
}

/* LEAFLET MAP CONTAINERS */
#incidentMap,
#detailsMap {
    display: block;
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 390px;
    overflow: hidden;
    border: 1px solid var(--sr-border);
    border-radius: 12px;
    background: #e9eef5;
    isolation: isolate;
}

/* Prevent global image styles affecting map tiles */
.leaflet-container img {
    max-width: none !important;
}

/* Preserve Leaflet's own positioning and transforms */
.leaflet-container {
    font-family: inherit;
}

/* INCIDENT DESCRIPTION */
.incident-description {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* TABLE STYLING */
.table thead th {
    color: #5b6b7f;
    font-size: 13px;
    font-weight: 700;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

/* TABLET AND MOBILE */
@media (max-width: 768px) {
    .incident-page {
        padding-top: 16px;
    }

    .incident-header {
        gap: 12px;
        margin-bottom: 18px;
    }

    .incident-card {
        padding: 18px;
    }

    #incidentMap,
    #detailsMap {
        height: 310px;
    }
}

/* SMALL PHONES */
@media (max-width: 480px) {
    .incident-card {
        padding: 14px;
    }

    #incidentMap,
    #detailsMap {
        height: 280px;
    }
}

/* ========================================
   SAFEROUTE SA - PREMIUM GPS LOCATION MAP
   ======================================== */

#incidentMap {
    width: 100%;
    height: 440px;
    min-height: 320px;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #dbe4f0;
    background: #e8eef5;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
    z-index: 0;
}

#detectLocation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 20px;
    border: none;
    border-radius: 11px;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

    #detectLocation:hover:not(:disabled) {
        background: #1d4ed8;
        transform: translateY(-1px);
    }

    #detectLocation:disabled {
        opacity: 0.65;
        cursor: wait;
    }

#locationMessage {
    display: block;
    margin-top: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #475569;
}

    #locationMessage[data-status="success"] {
        color: #15803d;
    }

    #locationMessage[data-status="error"] {
        color: #b91c1c;
    }

/* Blue custom pin */
.sr-location-marker {
    background: transparent;
    border: none;
}

.sr-marker-pin {
    position: absolute;
    top: 2px;
    left: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    border: 4px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    z-index: 2;
}

.sr-marker-pulse {
    position: absolute;
    top: -4px;
    left: -2px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.15);
    animation: sr-map-pulse 2.4s infinite;
}

@keyframes sr-map-pulse {
    0% {
        transform: scale(0.75);
        opacity: 0.85;
    }

    70% {
        transform: scale(1.3);
        opacity: 0;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Zoom controls */
#incidentMap .leaflet-control-zoom {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.15);
}

    #incidentMap .leaflet-control-zoom a {
        width: 38px;
        height: 38px;
        line-height: 38px;
        color: #1e293b;
        background: #ffffff;
        font-size: 20px;
    }

        #incidentMap .leaflet-control-zoom a:hover {
            background: #eff6ff;
            color: #2563eb;
        }

/* Location status and coordinates */
.sr-location-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    flex-wrap: wrap;
}

.sr-location-info-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#selectedCoordinates {
    display: block;
    margin-top: 5px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

#locationStatus {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

    #locationStatus[data-status="success"] {
        background: #dcfce7;
        color: #166534;
    }

    #locationStatus[data-status="error"] {
        background: #fee2e2;
        color: #991b1b;
    }

.sr-gps-loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 768px) {
    #incidentMap {
        height: 340px;
        border-radius: 14px;
    }

    #detectLocation {
        width: 100%;
    }

    .sr-location-info {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sr-marker-pulse {
        animation: none;
    }
}
/* GPS map wrapper */
.sr-map-wrapper {
    position: relative;
    width: 100%;
    border-radius: 18px;
    overflow: hidden;
    background: #e8eef5;
}

/* Keep Leaflet map controls above map tiles */
#incidentMap .leaflet-control-container {
    position: relative;
    z-index: 500;
}

/* Make the map responsive */
@media (max-width: 768px) {
    .sr-map-wrapper {
        border-radius: 14px;
    }
}

