/* ==========================================================================
   Verbrechensatlas — Frontend Styles
   ========================================================================== */

.verbrechensatlas-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

/* ---------- Tabs ---------- */

.va-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 12px;
}

.va-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.va-tab:hover { color: #1e293b; }
.va-tab--active { color: #1e293b; border-bottom-color: #3b82f6; }

.va-tab-spacer { flex: 1; }

.va-tab-search {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
}

.va-tab-search input {
    padding: 8px 12px;
    border: none;
    font-size: 14px;
    width: 180px;
    outline: none;
    color: #1e293b;
}

.va-tab-search button {
    padding: 8px 14px;
    background: #3b82f6;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.va-tab-search button:hover { background: #2563eb; }

.va-panel { display: none; }
.va-panel--active { display: block; }

/* ---------- Filter ---------- */

.va-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.va-filter-group:first-child { margin-right: auto; }

.va-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.va-filter-group select {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    min-width: 130px;
    height: 42px;
    cursor: pointer;
}

.va-filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Chips */

.va-checkbox-group { display: flex; gap: 8px; flex-wrap: wrap; }

.va-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.va-chip input[type="checkbox"] { display: none; }
.va-chip:has(input:checked) { color: #fff; font-weight: 600; }
.va-chip--einbruch:has(input:checked) { background: #DC2626; border-color: #DC2626; }
.va-chip--ueberfall:has(input:checked) { background: #F59E0B; border-color: #F59E0B; }
.va-chip--autodiebstahl:has(input:checked) { background: #2563EB; border-color: #2563EB; }
.va-chip:not(:has(input:checked)) { background: #fff; color: #64748b; }
.va-chip:hover { opacity: 0.85; }

/* ---------- Karte + Ticker Row ---------- */

.va-map-row {
    display: flex;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.va-map-row #va-map {
    flex: 1;
    min-width: 0;
    border: none;
    border-radius: 0;
}

/* ---------- Live-Ticker ---------- */

.va-live-ticker {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    overflow: hidden;
}

.va-live-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.va-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    animation: va-pulse-dot 1.5s ease-in-out infinite;
}

@keyframes va-pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.va-live-list { flex: 1; overflow-y: auto; scrollbar-width: thin; }

.va-live-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.15s;
}

.va-live-item:hover { background: #f0fdf4; }

.va-live-item-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }

.va-live-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.va-live-item-title { font-size: 13px; font-weight: 600; color: #1e293b; white-space: normal; line-height: 1.3; }
.va-live-item-meta { font-size: 11px; color: #64748b; }

/* ---------- Karte ---------- */

#va-map { border-radius: 8px; border: 1px solid #e2e8f0; z-index: 1; }

/* Puls-Animation für aktuelle Daten */
@keyframes va-pulse {
    0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
    70% { box-shadow: 0 0 0 12px transparent; opacity: 0.8; }
    100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

.va-marker-fresh > div { animation: va-pulse 2s ease-out infinite; width: 16px !important; height: 16px !important; border-width: 3px !important; }

/* Popup */
.va-popup { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; line-height: 1.5; min-width: 220px; }
.va-popup-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.va-popup-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.va-popup-row { display: flex; justify-content: space-between; padding: 2px 0; }
.va-popup-label { color: #64748b; }
.va-popup-value { font-weight: 600; }
.va-popup-source { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e2e8f0; font-size: 12px; }
.va-popup-source a { color: #3b82f6; text-decoration: none; }
.va-popup-source a:hover { text-decoration: underline; }

/* ---------- Stats ---------- */

.va-stats {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    margin: 12px 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.va-stat { flex: 1; text-align: center; }
.va-stat-value { display: block; font-size: 22px; font-weight: 700; line-height: 1.2; }
.va-stat-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }

.va-color-einbruch { color: #DC2626; }
.va-color-ueberfall { color: #F59E0B; }
.va-color-autodiebstahl { color: #2563EB; }

/* ---------- Tabelle ---------- */

.va-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 8px; }
.va-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.va-table thead { background: #f1f5f9; }
.va-table th { padding: 10px 14px; text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; white-space: nowrap; border-bottom: 2px solid #e2e8f0; }
.va-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
.va-table tbody tr:hover { background: #f8fafc; }
.va-table .va-loading { text-align: center; padding: 40px; color: #94a3b8; font-style: italic; }

.va-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #fff; }
.va-badge--einbruch { background: #DC2626; }
.va-badge--ueberfall { background: #F59E0B; }
.va-badge--autodiebstahl { background: #2563EB; }

.va-table .va-source-link { color: #3b82f6; text-decoration: none; font-size: 12px; }
.va-table .va-source-link:hover { text-decoration: underline; }

/* ---------- Footer ---------- */

/* Post-Datum ausblenden auf Verbrechensatlas-Seite */
.verbrechensatlas-wrap ~ .entry-date,
.post-date,
time.entry-date,
.w-post-elm.post_date,
section.l-section time.entry-date { display: none !important; }

.va-footer { margin-top: 12px; padding: 10px 16px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 12px; color: #64748b; line-height: 1.5; }

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .va-tabs { flex-wrap: wrap; }
    .va-tab-search { width: 100%; margin-top: 8px; }
    .va-tab-search input { flex: 1; width: auto; }
    .va-filters { flex-direction: column; }
    .va-filter-group select { min-width: 100%; }
    .va-map-row { flex-direction: column; }
    .va-map-row #va-map { min-height: 400px !important; height: 400px !important; }
    .va-live-ticker { width: 100%; max-height: 250px; border-left: none; border-top: 1px solid #e2e8f0; }
    .va-stats { flex-wrap: wrap; }
    .va-stat { min-width: 45%; }
    .va-stat-value { font-size: 18px; }
}
