/* Custom styles for the Red Flag Emergency Response System */

/* SOS Button styles */
.sos-button {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: #e53e3e;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sos-button:hover {
    transform: scale(1.05);
    background-color: #c53030;
}

.sos-button:active {
    transform: scale(0.95);
    background-color: #9b2c2c;
}

.sos-button .pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    opacity: 0;
    transform: scale(1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.7;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Map container */
.map-container {
    height: 400px;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10; /* Lower than header (40) and sidebar (40) */
}

/* Fix Leaflet map layers and controls z-index */
.leaflet-map-pane {
    z-index: 10 !important;
}

.leaflet-tile-pane {
    z-index: 11 !important;
}

.leaflet-overlay-pane {
    z-index: 12 !important;
}

.leaflet-shadow-pane {
    z-index: 13 !important;
}

.leaflet-marker-pane {
    z-index: 14 !important;
}

.leaflet-tooltip-pane {
    z-index: 15 !important;
}

.leaflet-popup-pane {
    z-index: 16 !important;
}

.leaflet-control-container {
    z-index: 17 !important;
}

.leaflet-top, .leaflet-bottom {
    z-index: 18 !important;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fbd38d;
    color: #723b13;
}

.status-dispatched {
    background-color: #90cdf4;
    color: #2a4365;
}

.status-en-route {
    background-color: #9ae6b4;
    color: #22543d;
}

.status-on-site {
    background-color: #81e6d9;
    color: #234e52;
}

.status-resolved {
    background-color: #9ae6b4;
    color: #22543d;
}

.status-false-alarm {
    background-color: #e2e8f0;
    color: #2d3748;
}

/* Alert notification */
.alert-notification {
    animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
    10%, 90% {
        transform: translate3d(-1px, 0, 0);
    }
    
    20%, 80% {
        transform: translate3d(2px, 0, 0);
    }
    
    30%, 50%, 70% {
        transform: translate3d(-4px, 0, 0);
    }
    
    40%, 60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #e53e3e;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c53030;
}

/* Fix for header and sidebar stacking context */
.app-header {
    position: relative;
    z-index: 50 !important;
}

#sidebar {
    z-index: 60 !important; /* Higher than overlay (z-40) */
}

/* Sidebar overlay */
#sidebar-overlay {
    z-index: 40;
}

/* Mobile sidebar adjustments */
@media (max-width: 768px) {
    #sidebar {
        padding-top: 5rem; /* Extra padding to avoid header overlap */
    }
    
    /* Ensure elements within sidebar are clickable */
    #sidebar * {
        position: relative;
        z-index: 1;
    }
    
    /* Fix for sidebar toggle button to stay above all */
    #sidebar-toggle {
        z-index: 70 !important;
    }
}

/* Loading spinner */
.loading-spinner {
    border: 4px solid rgba(229, 62, 62, 0.1);
    border-left-color: #e53e3e;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form styles */
.form-input {
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.2);
}

/* Progress bar */
.progress-container {
    height: 8px;
    width: 100%;
    background-color: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #e53e3e;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Dashboard cards hover effect */
.dashboard-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Custom tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #2d3748;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
} 