/* Custom styles for Waze Alerts Dashboard */

body {
    background-color: #f8f9fa;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card-header {
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Map popup styling */
.leaflet-popup-content {
    width: 250px;
    max-height: 300px;
    overflow-y: auto;
}

.alert-popup {
    padding: 5px;
}

.alert-popup h5 {
    margin-top: 0;
    color: #0d6efd;
}

.alert-popup table {
    width: 100%;
    font-size: 12px;
}

.alert-popup table th {
    text-align: left;
    width: 40%;
    padding: 3px;
}

.alert-popup table td {
    padding: 3px;
}

/* Custom markers */
.alert-marker {
    border-radius: 50%;
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.alert-marker:hover {
    transform: scale(1.5);
    z-index: 1000;
}

/* Colors for different alert types */
.jam-marker {
    background-color: #f44336;
    border: 2px solid #d32f2f;
}

.accident-marker {
    background-color: #ff9800;
    border: 2px solid #f57c00;
}

.hazard-marker {
    background-color: #ffeb3b;
    border: 2px solid #fbc02d;
}

.road-closed-marker {
    background-color: #9c27b0;
    border: 2px solid #7b1fa2;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #0d6efd;
    color: white !important;
    border-color: #0d6efd;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #0b5ed7;
    color: white !important;
    border-color: #0b5ed7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 0.75rem;
    }
    
    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Chart container height */
.chart-container {
    position: relative;
    height: 300px;
}

/* Alert details modal */
#alert-details-content {
    max-height: 500px;
    overflow-y: auto;
}

#alert-details-content table {
    width: 100%;
}

#alert-details-content th {
    width: 30%;
    text-align: right;
    padding-right: 10px;
}

/* Loading indicator */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dark mode styles */
body.dark-mode {
    background-color: #121212;
    color: #f0f0f0;
}

body.dark-mode .card {
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-color: #444;
}

body.dark-mode .navbar {
    background-color: #000000 !important;
}

body.dark-mode .card-header {
    background-color: #2e2e2e !important;
    color: #f0f0f0 !important;
    border-color: #444;
}

body.dark-mode .table {
    color: #f0f0f0;
}

body.dark-mode .modal-content {
    background-color: #1e1e1e;
    color: #f0f0f0;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #444;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #2e2e2e;
    color: #f0f0f0;
    border-color: #444;
}

body.dark-mode .loading {
    background-color: rgba(0, 0, 0, 0.7);
}

body.dark-mode .loading-spinner {
    border-color: #333;
    border-top-color: #0d6efd;
}

/* Theme switch */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Time slider */
#time-slider {
    margin: 20px 0;
}

.noUi-connect {
    background: #0d6efd;
}

.noUi-handle {
    border-radius: 50%;
    background: #0d6efd;
    box-shadow: none;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

#current-time-display {
    font-size: 16px;
    font-weight: bold;
}

/* Cluster markers */
.marker-cluster {
    background-color: rgba(255, 152, 0, 0.6);
}

.marker-cluster div {
    background-color: rgba(255, 152, 0, 0.8);
    color: white;
}

/* Corridor analysis */
.leaflet-draw-toolbar a {
    background-color: #0d6efd;
    color: white;
} 