/* ===== CAR CRASH DASHBOARD - MODERN STYLING ===== */

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* ===== HERO SECTION ===== */
.crash-hero {
    height: 50vh;
    min-height: 400px;
    background: url('../images/crash.jpg') center/cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 0;
}

.crash-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8));
}

.crash-hero-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    padding: 0 20px;
    color: white;
}

.crash-hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    color: white;
    text-align: center;
}

.hero-tagline {
    font-size: 1.3rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 0;
}

/* ===== MAIN CONTAINER ===== */
.crash-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===== INTRO SECTION ===== */
.intro-section {
    margin-bottom: 40px;
}

#intro-text {
    font-style: italic;
    font-weight: bold;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    color: #264ba9;
    margin: 18px 0 1rem 0;
    text-align: center;
}

#missing-data {
    font-style: italic; 
    font-family: 'Times New Roman', Times, serif; 
    color: rgb(225, 16, 16); 
    text-align: right;
    font-size: 1.2rem;
  }

.crash-safety-intro {
    background: linear-gradient(to right, #DC143C, #8B0000);
    border: none;
    border-radius: 10px;
    color: white;
    font-style: normal;
    font-size: 1.1rem;
    font-family: 'Montserrat', sans-serif;
    margin: 0 0 30px 0;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.safety-icon {
    font-size: 2.5rem;
    color: #FFD700;
    margin-top: 5px;
}

.crash-safety-intro p {
    margin: 0;
    line-height: 1.6;
}

/* ===== FILTERS SECTION ===== */
.filters-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.filters-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #DC143C;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    
}

.filter-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.filter-group select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg width='16' height='16' fill='none' stroke='%23DC143C' stroke-width='2' viewBox='0 0 24 24'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
}

.filter-group select:hover {
    border-color: #DC143C;
}

.filter-group select:focus {
    border-color: #DC143C;
    box-shadow: 0 0 0 3px rgba(220,20,60,0.2);
}

/* ===== VIOLATION TOGGLE - SPECIAL STYLING ===== */
.violation-toggle-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.violation-toggle-wrapper {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.violation-toggle {
    display: flex;
    position: relative;
    background: transparent;
    border-radius: 40px;
    overflow: hidden;
}

.violation-option {
    position: relative;
    z-index: 2;
    padding: 15px 35px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 35px;
    min-width: 120px;
    text-align: center;
}

.violation-option.active {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}


.violation-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #DC143C, #8B0000);
    border-radius: 35px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(220,20,60,0.4);
    z-index: 1;
}

.violation-slider.seatbelt {
    transform: translateX(100%);
    background: linear-gradient(135deg, #0047AB, #002c67);
    box-shadow: 0 4px 15px rgba(0,71,171,0.4);
}

/* Icon styling for toggle */
.violation-option i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* ===== CHARTS SECTION ===== */
.charts-container {
    display: grid;
    gap: 40px;
}

.choropleth-intro {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    max-width: 100%;
    margin-bottom: 30px;
    text-align: center;
  }

.chart-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.chart-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: #DC143C;
    font-family: 'Poppins', sans-serif;
    text-align: center;
    border-bottom: 3px solid #DC143C;
    padding-bottom: 15px;
}

.responsive-svg-container {
    width: 100%;
    margin: 0 auto;
    background: #fafbfc;
    border-radius: 8px;
    overflow: hidden;
    min-height: 400px;
    border: 1px solid #f0f2f5;
}

/* ===== FOOTER ===== */
.footer {
    background-color: #DC143C;
    color: white;
    text-align: center;
    padding: 30px 20px;
    font-size: 1rem;
    font-family: "Montserrat", sans-serif;
    margin-top: 60px;
    box-shadow: 0 -5px 10px rgba(0,0,0,0.2);
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
    .crash-hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1.2rem;
    }
    
    .filters {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .violation-toggle-wrapper {
        width: 100%;
        max-width: 350px;
    }
}

@media (max-width: 768px) {
    .crash-hero {
        min-height: 300px;
    }
    
    .crash-hero-content h1 {
        font-size: 2rem;
    }
    
    .crash-safety-intro {
        flex-direction: column;
        padding: 20px;
    }
    
    .safety-icon {
        margin-bottom: 15px;
    }
    
    .violation-option {
        padding: 12px 25px;
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .filters-container {
        padding: 20px;
    }
    
    .chart-section {
        padding: 20px;
    }
    
    .violation-toggle-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .reset-filters-btn {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .crash-container {
        padding: 20px 15px;
    }
    
    .filters-title {
        font-size: 1.5rem;
    }
    
    .chart-title {
        font-size: 1.4rem;
    }
    
    .violation-option {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .violation-option i {
        margin-right: 5px;
        font-size: 1rem;
    }
}

/* ===== LEGACY COMPATIBILITY ===== */
/* Keep existing IDs for JavaScript compatibility */
#crash-filters {
    /* This will be replaced by .filters-container */
    display: none;
}

#violation-toggle {
    /* Hidden select for JS compatibility */
    display: none !important;
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.violation-option:focus {
    outline: 2px solid #DC143C;
    outline-offset: 2px;
}

.filter-group select:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .violation-slider {
        border: 2px solid #000;
    }
    
    .chart-section {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .violation-slider {
        transition: none;
    }
    
    .chart-section {
        transition: none;
    }
    
    .fade-in {
        animation: none;
    }
}

/* Reset Filters Button */
.reset-filters-btn {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
    border-radius: 50px;
    padding: 12px 25px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.reset-filters-btn:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.reset-filters-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.reset-filters-btn i {
    font-size: 1rem;
    color: #DC143C;
}