/* Crime & Safety Stats - Custom Styles */
/* Material Blue Palette: #e3f2fd #bbdefb #90caf9 #64b5f6 #42a5f5 #2196f3 #1e88e5 #1976d2 #1565c0 #0d47a1 */

/* Card component */
.card {
    background: #ffffff;
    border: 1px solid #bbdefb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(13, 71, 161, 0.06);
}

.card-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e3f2fd;
}

/* KPI Card */
.kpi-card {
    background: #ffffff;
    border: 1px solid #bbdefb;
    border-top: 3px solid #1976d2;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(13, 71, 161, 0.06);
}

.kpi-card .kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.kpi-card .kpi-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #1976d2;
    flex-shrink: 0;
}

.kpi-card .kpi-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1565c0;
    margin-bottom: 0.25rem;
}

.kpi-card .kpi-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.kpi-card .kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: #0d47a1;
    letter-spacing: -0.025em;
}

.kpi-card .kpi-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.kpi-badge-green {
    color: #16a34a;
    background: #f0fdf4;
}

.kpi-badge-red {
    color: #dc2626;
    background: #fef2f2;
}

.kpi-badge-neutral {
    color: #1565c0;
    background: #e3f2fd;
}

.kpi-card .kpi-sub {
    font-size: 0.75rem;
    color: #64b5f6;
    margin-top: 0.25rem;
}

/* Safety score colors */
.score-green { color: #16a34a; }
.score-orange { color: #ea580c; }
.score-red { color: #dc2626; }

/* Tables inside cards */
.card table {
    width: 100%;
    font-size: 0.875rem;
    text-align: left;
    border-collapse: collapse;
}

.card table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1565c0;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #bbdefb;
    background: #e3f2fd;
    white-space: nowrap;
}

.card table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e3f2fd;
    color: #1565c0;
}

.card table tbody tr:last-child td {
    border-bottom: none;
}

.card table tbody tr:hover {
    background: #e3f2fd;
}

.card table a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

.card table a:hover {
    color: #0d47a1;
    text-decoration: underline;
}

/* Category rows in crime tables */
.category-row {
    background: #e3f2fd;
}

.category-row td {
    font-weight: 600;
    color: #0d47a1;
}

/* State grid for browse-by-state */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.state-grid a {
    display: block;
    padding: 0.625rem 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1565c0;
    background: #ffffff;
    border: 1px solid #bbdefb;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.state-grid a:hover {
    background: #bbdefb;
    border-color: #1976d2;
    color: #0d47a1;
}

/* Search results dropdown */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: #ffffff;
    border: 1px solid #bbdefb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(13, 71, 161, 0.1), 0 4px 6px -4px rgba(13, 71, 161, 0.1);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
}

#search-results a {
    display: block;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: #1565c0;
    text-decoration: none;
    border-bottom: 1px solid #e3f2fd;
    transition: background 0.1s;
}

#search-results a:hover {
    background: #e3f2fd;
    color: #1976d2;
}

#search-results a:last-child {
    border-bottom: none;
}

/* Ad slots */
.ad-slot {
    max-width: 728px;
    margin: 1.5rem auto;
    text-align: center;
    overflow: hidden;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64b5f6;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #42a5f5;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: #1976d2;
}

.breadcrumb .separator {
    color: #90caf9;
}

.breadcrumb .current {
    color: #0d47a1;
    font-weight: 500;
}

/* FAQ details/summary */
.faq-list details {
    border-bottom: 1px solid #e3f2fd;
}

.faq-list details:last-child {
    border-bottom: none;
}

.faq-list summary {
    font-weight: 500;
    font-size: 0.9375rem;
    color: #0d47a1;
    cursor: pointer;
    padding: 1rem 0;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: '+';
    font-size: 1.25rem;
    color: #90caf9;
    font-weight: 400;
    flex-shrink: 0;
}

.faq-list details[open] summary::after {
    content: '\2212';
}

.faq-list details p {
    padding: 0 0 1rem;
    color: #1976d2;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Comparison cards grid */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.comparison-grid a {
    display: block;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1565c0;
    background: #ffffff;
    border: 1px solid #bbdefb;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.comparison-grid a:hover {
    border-color: #1976d2;
    color: #0d47a1;
    background: #e3f2fd;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 280px;
    margin-bottom: 1rem;
}

/* Responsive table wrapper */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Crime map */
#crime-map { background: #e3f2fd; }

.crime-map-popup .leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(13, 71, 161, 0.1);
    border: 1px solid #bbdefb;
}
.crime-map-popup .leaflet-popup-tip {
    background: #fff;
    border: 1px solid #bbdefb;
}

@media (max-width: 640px) {
    #crime-map { height: 320px !important; }
}

/* Text utilities */
.text-center { text-align: center; }
.text-positive { color: #16a34a; }
.text-negative { color: #dc2626; }
