/**
 * DangerCenter — Custom Styles
 * Tailwind overrides, animations, map styles, print styles
 */

/* ===== Safety Gauge Animation ===== */
.safety-gauge-fill {
    animation: gaugeGrow 1.2s ease-out forwards;
}

@keyframes gaugeGrow {
    from {
        stroke-dashoffset: 1000;
    }
}

/* ===== Badge Glow Animation ===== */
.badge-glow {
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3) drop-shadow(0 0 6px rgba(234, 179, 8, 0.4));
    }
}

/* ===== Map Container ===== */
#safety-map,
#report-map,
#report-location-map,
#le-heatmap,
#le-report-map,
#profile-map,
#alert-map {
    z-index: 0;
    background-color: #111827;
}

/* Dark map popup overrides */
.leaflet-popup-content-wrapper {
    background-color: #1f2937;
    color: #d1d5db;
    border: 1px solid #374151;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-tip {
    background-color: #1f2937;
    border: 1px solid #374151;
}

.leaflet-popup-content h3 {
    color: #ffffff;
}

.leaflet-popup-content a {
    color: #3b82f6;
}

.leaflet-popup-close-button {
    color: #9ca3af !important;
}

.leaflet-popup-close-button:hover {
    color: #ffffff !important;
}

/* Custom marker styling */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

/* Map controls dark theme */
.leaflet-control-zoom a {
    background-color: #1f2937 !important;
    color: #d1d5db !important;
    border-color: #374151 !important;
}

.leaflet-control-zoom a:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

.leaflet-control-attribution {
    background-color: rgba(17, 24, 39, 0.8) !important;
    color: #6b7280 !important;
}

.leaflet-control-attribution a {
    color: #9ca3af !important;
}

/* ===== Custom Scrollbar (Dark Theme) ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: #374151 #0a0a0a;
}

/* ===== Form Focus Ring Override ===== */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* ===== Range Input Styling ===== */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #22c55e;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #030712;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #22c55e;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #030712;
}

/* Blue accent variant for LE/admin */
.bg-slate-950 input[type="range"]::-webkit-slider-thumb,
.bg-slate-950 input[type="range"]::-moz-range-thumb {
    background: #3b82f6;
}

/* ===== Severity Indicator Colors ===== */
.severity-1 { color: #22c55e; }
.severity-2 { color: #3b82f6; }
.severity-3 { color: #eab308; }
.severity-4 { color: #f97316; }
.severity-5 { color: #ef4444; }

/* ===== Transition Helpers ===== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #374151;
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Print Styles (LE Export) ===== */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    nav,
    footer,
    aside,
    .no-print,
    button,
    .leaflet-control-zoom {
        display: none !important;
    }

    main {
        padding: 0 !important;
    }

    .bg-gray-900,
    .bg-slate-900,
    .bg-gray-950,
    .bg-slate-950 {
        background-color: #ffffff !important;
        border-color: #cccccc !important;
    }

    .text-white,
    .text-gray-100,
    .text-gray-200,
    .text-gray-300 {
        color: #000000 !important;
    }

    .text-gray-400,
    .text-gray-500,
    .text-slate-400 {
        color: #666666 !important;
    }

    table {
        border-collapse: collapse;
    }

    th, td {
        border: 1px solid #cccccc;
        padding: 8px;
    }

    a {
        color: #000000 !important;
        text-decoration: underline;
    }

    @page {
        margin: 1cm;
    }
}
