:root {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent-blue: #003471;
    --accent-blue-transparent: rgba(0, 52, 113, 0.1);
    --accent-green: #17bf63;
    --accent-red: #bf0033;
    --accent-orange: #ff8c00;
    --accent-purple: #794bc4;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --header-bg: linear-gradient(135deg, #bf0033 0%, #8a0026 100%);
    --card-bg: #ffffff;
    --input-bg: #f5f5f5;
    --tag-morte: #c41e3a;
    --tag-cv: #e0245e;
    --tag-tcp: #17bf63;
    --tag-ada: #ffad1f;
    --tag-milicia: #1da1f2;
    --tag-disputa: #794bc4;
    --tag-default: #8899a6;
    --badge-rss: #1da1f2;
    --badge-telegram: #0088cc;
    --badge-fogocruzado: #ff5722;
    --badge-verified: #22c55e;
    --badge-trusted: #3b82f6;
    --badge-pending: #f59e0b;
    --badge-unverified: #ef4444;
    --badge-official: #a855f7;
    --flash-color: #ff4d6d;
    --chart-grid: rgba(0, 0, 0, 0.1);
    --chart-text: #666666;
}

.dark-theme {
    --bg-primary: #0f1419;
    --bg-secondary: #192734;
    --bg-tertiary: #22303c;
    --text-primary: #ffffff;
    --text-secondary: #8899a6;
    --accent-blue: #4a90d9;
    --accent-blue-transparent: rgba(74, 144, 217, 0.1);
    --accent-red: #ff4d6d;
    --accent-orange: #ffad1f;
    --accent-green: #17bf63;
    --accent-purple: #794bc4;
    --border-color: #38444d;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --header-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --card-bg: #192734;
    --input-bg: #22303c;
    --tag-morte: #ff6b6b;
    --tag-cv: #ff6b9d;
    --tag-tcp: #4ade80;
    --tag-ada: #fbbf24;
    --tag-milicia: #60a5fa;
    --tag-disputa: #c084fc;
    --tag-default: #9ca3af;
    --badge-rss: #38bdf8;
    --badge-telegram: #22d3ee;
    --badge-fogocruzado: #fb923c;
    --badge-verified: #4ade80;
    --badge-trusted: #60a5fa;
    --badge-pending: #fbbf24;
    --badge-unverified: #f87171;
    --badge-official: #c084fc;
    --flash-color: #ff6b6b;
    --chart-grid: rgba(56, 68, 77, 0.5);
    --chart-text: #8899a6;
}

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

*:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible,
.map-tab:focus-visible,
.alert-card:focus-visible,
.pagination button:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: background 0.3s ease;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.logo-icict {
    height: 40px;
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-icict-label {
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin: 0;
}

.logo-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.3;
}

.update-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.btn-notifications {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, border-color 0.2s;
}

.btn-notifications:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-notifications:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.connection-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-right: 1rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #ff8c00;
    box-shadow: 0 0 10px #ff8c00, 0 0 20px #ff8c00;
    animation: led-pulse-fast 1s ease-in-out infinite;
}

@keyframes led-pulse-fast {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px #ff8c00, 0 0 20px #ff8c00;
    }
    50% { 
        opacity: 0.5;
        box-shadow: 0 0 5px #ff8c00, 0 0 10px #ff8c00;
    }
}

.status-connected .status-dot {
    background: #17bf63;
    box-shadow: 0 0 10px #17bf63, 0 0 20px #17bf63;
    animation: led-pulse 2s ease-in-out infinite;
}

@keyframes led-pulse {
    0%, 100% { 
        opacity: 1;
        box-shadow: 0 0 10px #17bf63, 0 0 20px #17bf63;
    }
    50% { 
        opacity: 0.6;
        box-shadow: 0 0 5px #17bf63, 0 0 10px #17bf63;
    }
}

.status-reconnecting .status-dot {
    background: #ff8c00;
    box-shadow: 0 0 10px #ff8c00, 0 0 20px #ff8c00;
    animation: led-pulse-fast 1s ease-in-out infinite;
}

.status-error .status-dot {
    background: #bf0033;
    box-shadow: 0 0 10px #bf0033, 0 0 20px #bf0033;
    animation: led-pulse 2s ease-in-out infinite;
}

.btn-theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 0.5rem;
    transition: background 0.2s, border-color 0.2s;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-refresh {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 0.5rem;
    transition: background 0.2s, border-color 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.new-alert {
    animation: pulse 2s ease-in-out;
    border: 2px solid var(--accent-blue);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 52, 113, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 52, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 52, 113, 0); }
}

.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.period-filter label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.period-filter select {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 160px;
}

.period-filter select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.metrics-section {
    margin-bottom: 2rem;
}

.metrics-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.metrics-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.period-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
    background: transparent;
    border: none;
    width: auto;
}

.kpis-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.carousel-arrow:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.carousel-arrow.prev { left: -20px; }
.carousel-arrow.next { right: -20px; }

.kpi-carousel, .charts-carousel {
    position: relative;
    margin-bottom: 2rem;
}

.carousel-viewport {
    overflow: hidden;
    width: 100%;
}

.carousel-arrow {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    transition: transform 0.5s ease-in-out;
}

.kpi-carousel .carousel-track .kpi-card {
    flex: 0 0 280px;
    min-width: 280px;
}

.charts-carousel .carousel-track .chart-container {
    flex: 0 0 400px;
    min-width: 400px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: var(--accent-blue);
    transform: scale(1.2);
}

@media (max-width: 768px) {
    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    .carousel-arrow.prev { left: 5px; }
    .carousel-arrow.next { right: 5px; }
    .kpi-carousel .carousel-track .kpi-card {
        flex: 0 0 240px;
        min-width: 240px;
    }
    .charts-carousel .carousel-track .chart-container {
        flex: 0 0 300px;
        min-width: 300px;
    }
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    height: 100px;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
}

.kpi-front, .kpi-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    backface-visibility: hidden;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-front {
    background: var(--card-bg);
    border-radius: 12px;
    border-left: 4px solid;
}

.kpi-front.total { border-left-color: var(--accent-blue); }
.kpi-front.relevant { border-left-color: var(--accent-red); }
.kpi-front.rate { border-left-color: var(--accent-green); }
.kpi-front.today { border-left-color: var(--accent-orange); }
.kpi-front.lead-time { border-left-color: var(--accent-purple); }
.kpi-front.antecipation { border-left-color: var(--accent-blue); }
.kpi-front.false-positive { border-left-color: var(--accent-red); }
.kpi-front.geoaccuracy { border-left-color: var(--accent-green); }

.kpi-back {
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 12px;
    transform: rotateY(180deg);
    font-size: 0.8rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.kpi-card:hover .kpi-front {
    transform: rotateY(180deg);
}

.kpi-card:hover .kpi-back {
    transform: rotateY(0deg);
}

.kpi-card:hover .kpi-back.total {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #002a5c 100%);
    color: white;
    border-color: var(--accent-blue);
}

.kpi-card:hover .kpi-back.relevant {
    background: linear-gradient(135deg, var(--accent-red) 0%, #8a0026 100%);
    color: white;
    border-color: var(--accent-red);
}

.kpi-card:hover .kpi-back.rate {
    background: linear-gradient(135deg, var(--accent-green) 0%, #149c4d 100%);
    color: white;
    border-color: var(--accent-green);
}

.kpi-card:hover .kpi-back.today {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #cc7000 100%);
    color: white;
    border-color: var(--accent-orange);
}

.kpi-card:hover .kpi-back.lead-time {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #4a2c7a 100%);
    color: white;
    border-color: var(--accent-purple);
}

.kpi-card:hover .kpi-back.antecipation {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #002a5c 100%);
    color: white;
    border-color: var(--accent-blue);
}

.kpi-card:hover .kpi-back.false-positive {
    background: linear-gradient(135deg, var(--accent-red) 0%, #8a0026 100%);
    color: white;
    border-color: var(--accent-red);
}

.kpi-card:hover .kpi-back.geoaccuracy {
    background: linear-gradient(135deg, var(--accent-green) 0%, #149c4d 100%);
    color: white;
    border-color: var(--accent-green);
}

.kpi-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.kpi-data {
    display: flex;
    flex-direction: column;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .kpi-card {
        height: 80px;
    }
    .kpi-front, .kpi-back {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    .kpi-icon {
        font-size: 1.5rem;
    }
    .kpi-back {
        font-size: 0.7rem;
    }
}

.chart-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
    min-height: 280px;
}

.chart-container h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chart-info-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chart-info-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.chart-tooltip {
    display: none;
    position: absolute;
    top: 50px;
    right: 10px;
    background: var(--card-bg);
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    padding: 12px;
    max-width: 280px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chart-tooltip.active {
    display: block;
}

.chart-container {
    position: relative;
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.map-section {
    margin-bottom: 2rem;
}

.map-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.map-container h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.map-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

#map .map-filters {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    background: var(--card-bg);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.map-filters label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.map-filters input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Map tabs */
.map-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.map-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
}

.map-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.map-tab.active {
    color: var(--accent-blue);
    background: var(--bg-tertiary);
}

.map-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-blue);
    border-radius: 3px 3px 0 0;
}

.map-tab-content {
    display: none;
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
}

.map-tab-content.active {
    display: block;
}

#map {
    height: 450px;
    width: 100%;
    border-radius: 8px;
}

/* === Zones Map === */
#zones-map {
    display: none;
    height: 500px;
    width: 100%;
    border-radius: 8px;
    position: relative;
}

#zones-map.active {
    display: block;
}

#zones-map-container {
    height: calc(100% - 60px);
    width: 100%;
}

.zones-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    min-height: 44px;
}

.zones-tool-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zones-tool-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.zones-tool-btn.active {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.zones-tool-select {
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

.zones-tool-select:hover {
    background: var(--accent-blue);
    color: white;
}

.zones-legend {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.8rem;
    margin-left: auto;
}

.zones-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.zones-legend-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.zones-legend-invasion {
    background: #e0245e;
}

.zones-legend-fogocruzado {
    background: #ff6b35;
}

.zones-legend-operacao {
    background: #1da1f2;
}

/* === Componentes Reutilizáveis === */

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Botões */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.btn-primary:hover {
    background: #002a5c;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.btn-danger:hover {
    background: #8a0026;
}

.btn-success {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.btn-success:hover {
    background: #149c4d;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Risk Panel === */
.risk-panel {
    position: absolute;
    top: 70px;
    right: 10px;
    width: 320px;
    max-height: calc(100% - 80px);
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.risk-panel.show {
    display: block;
}

.risk-panel-header {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.risk-panel-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.risk-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.risk-panel-close:hover {
    color: var(--text-primary);
}

.risk-panel-body {
    padding: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.risk-panel-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
}

.risk-panel-filter {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.risk-panel-filter select {
    width: 100%;
    padding: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.risk-item {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: transform 0.2s;
}

.risk-item:hover {
    transform: translateX(5px);
}

.risk-item-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.risk-item-stats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.risk-item-level {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.risk-level-alto {
    background: rgba(191, 0, 51, 0.2);
    color: var(--accent-red);
}

.risk-level-medio {
    background: rgba(255, 140, 0, 0.2);
    color: var(--accent-orange);
}

.risk-level-baixo {
    background: rgba(23, 191, 99, 0.2);
    color: var(--accent-green);
}

.risk-level-nenhum {
    background: rgba(136, 153, 166, 0.2);
    color: var(--text-secondary);
}

.alerts-header {
    margin-bottom: 1rem;
}

.alerts-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.alerts-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.alerts-filters input,
.alerts-filters select {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.alerts-filters input:focus,
.alerts-filters select:focus {
    border-color: var(--accent-blue);
}

.alerts-filters input {
    min-width: 200px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: visible;
}

.alert-card {
    background: var(--input-bg);
    border-radius: 8px;
    padding: 0.75rem;
    border-left: 3px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.alert-card:hover {
    background: var(--bg-tertiary);
}

.alert-card.relevant {
    border-left-color: var(--accent-red);
}

.alert-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.alert-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
    padding-right: 1rem;
}

.alert-card-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.alert-card-summary {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.alert-card-original-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.alert-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.tag.category-tiroteio { background: rgba(191, 0, 51, 0.15); color: var(--accent-red); }
.tag.category-operacao { background: rgba(0, 52, 113, 0.15); color: var(--accent-blue); }
.tag.category-prisao { background: rgba(121, 75, 196, 0.15); color: var(--accent-purple); }
.tag.category-apreensao { background: rgba(255, 140, 0, 0.15); color: var(--accent-orange); }
.tag.category-morte { background: rgba(191, 0, 51, 0.2); color: var(--tag-morte); }
.tag.category-conflict { background: rgba(23, 191, 99, 0.15); color: var(--accent-green); }

.tag.faccao-cv { background: rgba(224, 36, 94, 0.2); color: var(--tag-cv); border: 1px solid rgba(224, 36, 94, 0.4); }
.tag.faccao-tcp { background: rgba(23, 191, 99, 0.2); color: var(--tag-tcp); border: 1px solid rgba(23, 191, 99, 0.4); }
.tag.faccao-ada { background: rgba(255, 173, 31, 0.2); color: var(--tag-ada); border: 1px solid rgba(255, 173, 31, 0.4); }
.tag.faccao-milicia { background: rgba(29, 161, 242, 0.2); color: var(--tag-milicia); border: 1px solid rgba(29, 161, 242, 0.4); }
.tag.faccao-disputa { background: rgba(121, 75, 196, 0.2); color: var(--tag-disputa); border: 1px solid rgba(121, 75, 196, 0.4); }
.tag.faccao-default { background: rgba(56, 68, 77, 0.2); color: var(--tag-default); }

.relevance-badge {
    background: rgba(191, 0, 51, 0.15);
    color: var(--accent-red);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.relevance-badge.cross-post {
    background: rgba(0, 52, 113, 0.15);
    color: var(--accent-blue);
}

.relevance-badge.duplicate-badge {
    background: rgba(255, 165, 0, 0.15);
    color: #cc7700;
    cursor: help;
}

/* Secao de fontes alternativas no card original */
.duplicate-sources {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 165, 0, 0.06);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.duplicate-sources-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #8899a6);
    white-space: nowrap;
}

.duplicate-source-item {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 4px;
    color: var(--accent-blue, #1da1f2);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.duplicate-source-item:hover {
    background: rgba(29, 161, 242, 0.1);
    border-color: var(--accent-blue);
}

/* Banner de repetido no modal */
.duplicate-banner {
    background: rgba(255, 165, 0, 0.12);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #cc7700;
    line-height: 1.4;
}

.duplicate-banner a {
    color: var(--accent-blue, #1da1f2);
    font-weight: 600;
    text-decoration: none;
}

.duplicate-banner a:hover {
    text-decoration: underline;
}

/* Secao de fontes no modal */
.duplicate-modal-sources {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(29, 161, 242, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-color, #e1e8ed);
}

.duplicate-modal-sources strong {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted, #8899a6);
}

.duplicate-modal-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.duplicate-modal-item {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e1e8ed);
    border-radius: 4px;
    color: var(--text-color, #14171a);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.duplicate-modal-item:hover {
    background: rgba(29, 161, 242, 0.08);
    border-color: var(--accent-blue);
}

/* Mapa de impacto no modal de alerta */
.modal-impact-map {
    height: 320px;
    width: 100%;
    border-radius: 10px;
    margin: 0 0 1rem 0;
    border: 1px solid var(--border-color, #e1e8ed);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: none;
}

.modal-impact-map.visible {
    display: block;
}

/* Marcador pulsante do incidente */
.pulse-dot {
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: modal-pulse 1.5s ease-in-out infinite;
}

@keyframes modal-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Legenda do mapa modal */
.modal-map-legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    line-height: 1.6;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

.modal-map-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.modal-map-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ai-summary-section {
    background: rgba(156, 163, 175, 0.08);
    border-left: 3px solid rgba(156, 163, 175, 0.3);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0 6px 6px 0;
}

.ai-summary-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.impact-badge {
    background: rgba(255, 140, 0, 0.15);
    color: var(--accent-orange);
    font-size: 0.75rem;
    font-weight: 600;
    animation: flash-red 1.5s ease-in-out infinite;
}

@keyframes flash-red {
    0%, 100% { 
        background: rgba(255, 140, 0, 0.15);
        color: var(--accent-orange);
    }
    50% { 
        background: rgba(191, 0, 51, 0.3);
        color: var(--flash-color);
    }
}

.source-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

.source-badge.rss {
    background: rgba(29, 161, 242, 0.15);
    color: var(--badge-rss);
    border: 1px solid rgba(29, 161, 242, 0.3);
}

.source-badge.telegram {
    background: rgba(0, 136, 204, 0.15);
    color: var(--badge-telegram);
    border: 1px solid rgba(0, 136, 204, 0.3);
}

.source-badge.fogocruzado {
    background: rgba(255, 87, 34, 0.15);
    color: var(--badge-fogocruzado);
    border: 1px solid rgba(255, 87, 34, 0.3);
}

.verification-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.verification-badge.verified {
    background: rgba(34, 197, 94, 0.15);
    color: var(--badge-verified);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.verification-badge.trusted {
    background: rgba(59, 130, 246, 0.15);
    color: var(--badge-trusted);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.verification-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--badge-pending);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.verification-badge.unverified {
    background: rgba(239, 68, 68, 0.15);
    color: var(--badge-unverified);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.verification-badge.official {
    background: rgba(121, 75, 196, 0.15);
    color: var(--badge-official);
    border: 1px solid rgba(121, 75, 196, 0.3);
}

.source-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Controle de raio ajustavel */
.radius-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #8899a6);
}

.radius-label {
    white-space: nowrap;
}

.radius-slider {
    width: 120px;
    height: 4px;
    accent-color: var(--accent-orange, #ff8c00);
    cursor: pointer;
}

.radius-value {
    font-weight: 700;
    color: var(--accent-orange, #ff8c00);
    min-width: 3ch;
    display: inline-block;
    text-align: right;
}

.impact-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
}

.impact-section h4 {
    color: var(--warning-color, #ffc107);
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.impact-subheader {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0.25rem 0;
}

.impact-subheader span {
    font-weight: 600;
}

.impact-list {
    list-style: none;
    margin: 0.25rem 0 0.75rem 0;
    padding: 0;
}

.impact-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.impact-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.impact-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.impact-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.impact-distance {
    font-size: 0.75rem;
    color: var(--warning-color, #ffc107);
    font-weight: 600;
    white-space: nowrap;
}

.source-badge {
    display: inline-block;
    background: rgba(0, 52, 113, 0.15);
    color: var(--accent-blue);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.original-alert-info {
    background: rgba(29, 161, 242, 0.1);
    border: 1px solid var(--accent-blue);
    border-radius: 6px;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.original-alert-info .label {
    display: block;
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.original-alert-info a {
    color: var(--text-primary);
    text-decoration: underline;
    font-size: 0.9rem;
}

.original-alert-info a:hover {
    color: var(--accent-blue);
}

.original-alert-info .date {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.pagination button {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.pagination button:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
}

.pagination button.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #ffffff;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: background 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.modal-body .original-title-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body .original-title-subtitle .label {
    font-style: normal;
    font-weight: 600;
}

.modal-body .meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-body .text {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-body .link {
    display: inline-block;
    color: var(--accent-blue);
    text-decoration: none;
    margin-top: 0.5rem;
}

.modal-body .link:hover {
    text-decoration: underline;
}

.modal-body .link:hover {
    text-decoration: underline;
}

/* About Modal */
.about-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.about-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.about-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.about-header h2 {
    margin: 0;
    color: var(--accent-blue);
}

.about-content h1 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.about-content h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--accent-blue);
}

.about-content h3 {
    font-size: 1.1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.about-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.about-content ul, .about-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.about-content li {
    margin-bottom: 0.5rem;
}

.about-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.about-content th, .about-content td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.about-content th {
    background: var(--bg-secondary);
}

.about-content a {
    color: var(--accent-blue);
}

.about-content strong {
    font-weight: 600;
}

.btn-about {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-about:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .alerts-filters {
        width: 100%;
    }
    
    .alerts-filters input,
    .alerts-filters select {
        width: 100%;
    }
    
    #map {
        height: 350px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

.metrics-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
    margin-top: 1.5rem;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.metrics-content {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.metric-item {
    display: flex;
    gap: 4px;
}

.beta-notice {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
}

.version-text {
    font-weight: 600;
}

.beta-text {
    white-space: nowrap;
}

.metric-item strong {
    color: var(--text-primary);
}

@media (max-width: 600px) {
    .metrics-content {
        gap: 12px;
        font-size: 12px;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-width: 100%;
        padding: 1.25rem;
        border-radius: 8px;
    }
    
    .modal-body {
        text-align: left;
    }
    
    .modal-body h3 {
        font-size: 1.1rem;
        text-align: center;
    }
    
    .modal-body .original-title-subtitle,
    .modal-body .meta,
    .modal-body .text {
        text-align: left;
    }
}

/* ==========================================
   ANIMAÇÕES E TRANSIÇÕES ELABORADAS
   ========================================== */

/* === Keyframes de Entrada === */
@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px) scale(0.95);
    }
    70% {
        transform: translateX(5px) scale(1.02);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Keyframes de Efeito === */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(191, 0, 51, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(191, 0, 51, 0.8), 0 0 40px rgba(191, 0, 51, 0.4);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

@keyframes borderGlow {
    0%, 100% {
        border-color: var(--accent-red);
        box-shadow: 0 0 5px rgba(191, 0, 51, 0.3);
    }
    50% {
        border-color: #ff4d6d;
        box-shadow: 0 0 15px rgba(191, 0, 51, 0.6);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* === Classes de Animação de Entrada === */
.animate-slide-down {
    animation: slideDownIn 0.6s ease-out forwards;
}

.animate-fade-up {
    opacity: 0;
    animation: fadeUpIn 0.8s ease-out forwards;
}

.animate-scale-in {
    opacity: 0;
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-slide-left {
    opacity: 0;
    animation: slideInLeft 0.5s ease-out forwards;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
}

/* === Delays para stagger === */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* === Header Animado === */
.header {
    animation: slideDownIn 0.6s ease-out;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.5) 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

/* === KPIs Animados === */
.kpi-card {
    opacity: 0;
    animation: fadeUpIn 0.6s ease-out forwards;
    transform-origin: center bottom;
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }
.kpi-card:nth-child(4) { animation-delay: 0.4s; }

.kpi-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.kpi-card.total:hover {
    box-shadow: 0 8px 30px rgba(0, 52, 113, 0.2);
}

.kpi-card.relevant:hover {
    box-shadow: 0 8px 30px rgba(191, 0, 51, 0.2);
}

.kpi-card.rate:hover {
    box-shadow: 0 8px 30px rgba(23, 191, 99, 0.2);
}

.kpi-card.today:hover {
    box-shadow: 0 8px 30px rgba(255, 140, 0, 0.2);
}

/* === Gráficos Animados === */
.chart-container {
    opacity: 0;
    animation: fadeUpIn 0.6s ease-out forwards;
    transform-origin: center top;
}

.chart-container:nth-child(1) { animation-delay: 0.5s; }
.chart-container:nth-child(2) { animation-delay: 0.6s; }
.chart-container:nth-child(3) { animation-delay: 0.7s; }
.chart-container:nth-child(4) { animation-delay: 0.8s; }
.chart-container:nth-child(5) { animation-delay: 0.9s; }
.chart-container:nth-child(6) { animation-delay: 1.0s; }

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* === Mapa Animado === */
.map-section {
    opacity: 0;
    animation: fadeUpIn 0.7s ease-out forwards;
    animation-delay: 1.1s;
}

.map-container {
    overflow: hidden;
    border-radius: 12px;
}

#map {
    opacity: 0;
    animation: fadeIn 0.5s ease-out forwards;
    animation-delay: 1.3s;
}

/* === Timeline Animada === */
.alerts-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-top: 1.5rem;
    transition: background 0.3s ease;
    opacity: 0;
    animation: fadeUpIn 0.7s ease-out forwards;
    animation-delay: 1.2s;
}

.alert-card {
    opacity: 0;
    transform: translateX(-30px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.alert-card.visible {
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.alert-card.visible:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-left-color: var(--accent-red);
}

.alert-card.relevant.visible {
    border-left: 3px solid var(--accent-red);
    box-shadow: 0 0 10px rgba(191, 0, 51, 0.3);
}

.alert-card.relevant.visible:hover {
    box-shadow: 0 10px 40px rgba(191, 0, 51, 0.2);
    border-left-color: var(--accent-red);
}

/* === Novo Alerta (WebSocket) === */
.alert-card.new-alert {
    animation: slideInLeft 0.5s ease-out, pulseGlow 2s ease-in-out;
}

/* === Modal Animado === */
.modal {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-content {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal.show .modal-body {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.modal-body {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    padding: 1.5rem;
    text-align: left;
}

/* === Botões e Interações === */
button, .btn-refresh, .btn-theme-toggle, .btn-notifications {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

button:active, .btn-refresh:active, .btn-theme-toggle:active {
    transform: scale(0.95);
}

/* Ripple effect */
button::after, .btn-refresh::after, .btn-theme-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

button:active::after, .btn-refresh:active::after, .btn-theme-toggle:active::after {
    width: 200px;
    height: 200px;
}

/* === Filtros Animados === */
.alerts-filters {
    transition: background 0.3s ease, border-color 0.3s ease;
}

.alerts-filters select, .alerts-filters input {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.alerts-filters select:focus, .alerts-filters input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 52, 113, 0.1);
}

/* === Paginação Animada === */
#pagination button {
    transition: all 0.2s ease;
}

#pagination button:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

#pagination button.active {
    background: var(--accent-blue);
    color: white;
    transform: scale(1.1);
}

/* === Mapa Markers Animados === */
.leaflet-marker-icon {
    transition: transform 0.3s ease;
}

.leaflet-marker-icon:hover {
    transform: scale(1.2);
}

/* === Loading States === */
.loading-skeleton {
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 25%, 
        var(--bg-secondary) 50%, 
        var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* === Dashboard Loading === */
.dashboard-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.dashboard-loading.active {
    display: flex;
}

.dashboard-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.dashboard-loading-text {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.dashboard-loading-subtext {
    color: var(--text-secondary);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* === Footer Animado === */
.metrics-footer {
    opacity: 0;
    animation: fadeUpIn 0.5s ease-out forwards;
    animation-delay: 1.5s;
}

/* === KPIs Contador Animado === */
.kpi-value {
    transition: transform 0.3s ease;
}

.kpi-value.updating {
    animation: countUp 0.3s ease-out;
}

/* === Toast Notifications === */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--accent-green);
}

.toast.error {
    border-left: 4px solid var(--accent-red);
}

.toast.info {
    border-left: 4px solid var(--accent-blue);
}

/* === Dark Theme Ajustes === */
.dark-theme .kpi-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.dark-theme .alert-card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.dark-theme .modal::before {
    background: rgba(0, 0, 0, 0.85);
}

/* === Leaflet Popups Dark Theme === */
.dark-theme .leaflet-popup-content-wrapper {
    background: #192734 !important;
}

.dark-theme .leaflet-popup-content {
    color: #ffffff !important;
}

.dark-theme .leaflet-popup-content strong {
    color: #4a90d9 !important;
}

.dark-theme .leaflet-popup-content hr {
    border-top-color: #38444d;
}

.dark-theme .leaflet-popup-content .risk-section {
    border-top-color: #38444d;
}

.dark-theme .leaflet-popup-content .edit-hint {
    color: #8899a6;
}

.dark-theme .impact-type {
    background: rgba(0, 0, 0, 0.2);
}

.dark-theme .impact-badge {
    color: #ffad1f !important;
    background: rgba(255, 173, 31, 0.15);
}

.popup-units {
    margin-top: 10px;
    padding: 8px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
}

.popup-units strong {
    color: #333;
}

.dark-theme .popup-units {
    background: #2d3a47;
    color: #ffffff;
}

.dark-theme .popup-units strong {
    color: #ffffff;
}

.dark-theme .modal-map-legend {
    background: rgba(25, 39, 52, 0.95) !important;
    color: #ffffff !important;
}

/* === Transições Suaves Globais === */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Prevenir FOUC === */
body {
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.loaded {
    opacity: 1;
}

/* === Leaflet Popups Customizados === */
.leaflet-popup-content-wrapper {
    background: var(--card-bg) !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 320px;
}

@media (max-width: 480px) {
    .leaflet-popup-content-wrapper {
        max-width: 240px;
    }
}

.leaflet-popup-content {
    margin: 1rem;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 280px;
}

.leaflet-popup-content strong {
    color: var(--accent-blue) !important;
    font-size: 1rem;
}

.leaflet-popup-content hr {
    border: none;
    border-top: 1px solid var(--border-color) !important;
    margin: 0.5rem 0;
}

.leaflet-popup-content .risk-section {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
}

.leaflet-popup-content .risk-item {
    display: block;
    margin: 1px 0;
    font-size: 0.7rem;
    line-height: 1.1;
}

.leaflet-popup-content .edit-hint {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 4px;
    display: block;
}

.text-muted {
    color: var(--text-secondary);
}

/* === Favela Popup === */
.favela-popup {
    min-width: 140px;
    max-width: 180px;
    font-size: 0.75rem;
    line-height: 1.2;
}

.favela-popup strong {
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}

.favela-popup em {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.invasion-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invasion-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #e0245e;
    opacity: 0;
    animation: invasion-pulse 2s ease-out infinite;
}

.invasion-icon {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

@keyframes invasion-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.operacao-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.operacao-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #1da1f2;
    opacity: 0;
    animation: operacao-pulse 2s ease-out infinite;
}

.operacao-icon {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

@keyframes operacao-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.leaflet-control-layers-list label {
    margin-bottom: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
html {
        scroll-behavior: auto;
    }
}

#smart-search-map {
    display: none;
    height: 520px;
    width: 100%;
    border-radius: 8px;
    position: relative;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#smart-search-map.active {
    display: flex;
    flex-direction: column;
}

.smart-search-ui {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-shrink: 0;
}

.smart-search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.smart-search-box input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.smart-search-box input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.smart-search-btn {
    padding: 0.6rem 1rem;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.smart-search-btn:hover {
    background: #a3002a;
}

.smart-search-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.smart-search-suggestions {
    margin-bottom: 0.5rem;
}

.smart-search-suggestions select {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.smart-search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.smart-search-filters select {
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.smart-date-filter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.smart-date-filter input {
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
    width: 110px;
}

#smart-search-results-container {
    flex-shrink: 0;
    max-height: 100px;
    overflow-y: auto;
}

.smart-search-summary {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-y: auto;
    max-height: 100%;
    word-wrap: break-word;
}

.smart-search-summary:empty {
    display: none;
}

.smart-search-summary p {
    margin: 0 0 0.5rem 0;
}

.smart-search-summary p:last-child {
    margin-bottom: 0;
}

.smart-search-summary ul {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
}

.smart-search-summary li {
    margin-bottom: 0.25rem;
}

.smart-search-summary strong {
    color: var(--accent-blue);
}

.smart-search-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.smart-search-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.smart-search-map-container {
    flex: 1;
    min-height: 180px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.smart-search-cards {
    display: none;
}

.smart-search-history {
    flex-shrink: 0;
    max-height: 80px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.8rem;
}

.smart-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.smart-history-header h4 {
    font-size: 0.85rem;
    color: var(--text-primary);
}

.smart-history-clear {
    padding: 0.2rem 0.4rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
}

.smart-history-clear:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.smart-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.smart-history-item {
    padding: 0.3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.smart-history-item:hover {
    border-color: var(--accent-blue);
}

.smart-history-item-query {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.smart-history-item-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.smart-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: var(--text-secondary);
}

.smart-search-loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

.smart-search-error {
    padding: 0.5rem;
    background: rgba(191, 0, 51, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 6px;
    color: var(--accent-red);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .smart-search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-search-filters select,
    .smart-search-filters input {
        width: 100%;
    }

    .smart-search-map-container {
        min-height: 150px;
    }
}
}

.smart-search-ui {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.smart-search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.smart-search-box input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.smart-search-box input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.smart-search-box input::placeholder {
    color: var(--text-secondary);
}

.smart-search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.smart-search-btn:hover {
    background: #a3002a;
}

.smart-search-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

.smart-search-suggestions {
    margin-bottom: 0.75rem;
}

.smart-search-suggestions select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.smart-search-filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.smart-search-filters select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 150px;
}

.smart-date-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.smart-date-filter input {
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

#smart-search-results-container {
    margin-bottom: 1rem;
}

.smart-search-summary {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.smart-search-summary:empty {
    display: none;
}

.smart-search-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.smart-search-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

#smart-search-map {
    display: none;
    height: 520px;
    width: 100%;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

#smart-search-map.active {
    display: flex;
    flex-direction: column;
}

.smart-search-ui {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-shrink: 0;
}

.smart-search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.smart-search-box input {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.smart-search-box input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.smart-search-btn {
    padding: 0.6rem 1rem;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.smart-search-btn:hover {
    background: #a3002a;
}

.smart-search-suggestions {
    margin-bottom: 0.5rem;
}

.smart-search-suggestions select {
    width: 100%;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.smart-search-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.smart-search-filters select {
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.smart-date-filter {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.smart-date-filter input {
    padding: 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
    width: 110px;
}

#smart-search-results-container {
    flex-shrink: 0;
    max-height: 100px;
    overflow-y: auto;
}

.smart-search-summary {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow-y: auto;
    max-height: 100%;
    word-wrap: break-word;
}

.smart-search-summary:empty {
    display: none;
}

.smart-search-summary p {
    margin: 0 0 0.5rem 0;
}

.smart-search-summary p:last-child {
    margin-bottom: 0;
}

.smart-search-summary ul {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
}

.smart-search-summary li {
    margin-bottom: 0.25rem;
}

.smart-search-summary strong {
    color: var(--accent-blue);
}

.smart-search-stats {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.smart-search-map-container {
    flex: 1;
    min-height: 180px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.smart-search-cards {
    display: none;
}

.smart-search-history {
    flex-shrink: 0;
    max-height: 60px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.8rem;
}

#smart-search-map {
    display: none;
    width: 100%;
    border-radius: 8px;
    position: relative;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

#smart-search-map.active {
    display: block;
}

.smart-search-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
}

.smart-search-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .smart-search-main {
        flex-direction: row;
    }

    .smart-search-main > div:first-child {
        flex: 1;
        min-width: 300px;
    }

    .smart-search-main > div:last-child {
        flex: 1;
        min-width: 300px;
    }
}

.smart-search-map-container {
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.smart-search-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.smart-search-card {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smart-search-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.smart-search-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.smart-search-card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.smart-search-card-meta .tag {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
}

.smart-search-history {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.smart-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.smart-history-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
}

.smart-history-clear {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smart-history-clear:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.smart-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.smart-history-item {
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smart-history-item:hover {
    border-color: var(--accent-blue);
}

.smart-history-item-query {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.smart-history-item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.smart-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.smart-search-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

.smart-search-error {
    padding: 1rem;
    background: rgba(191, 0, 51, 0.1);
    border: 1px solid var(--accent-red);
    border-radius: 8px;
    color: var(--accent-red);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .smart-search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-search-filters select,
    .smart-search-filters input {
        width: 100%;
    }

    .smart-search-map-container {
        height: 300px;
    }

    .smart-search-cards {
        grid-template-columns: 1fr;
    }
}

.smart-search-modal-content {
    max-width: 900px;
}

.smart-search-modal-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.smart-search-modal-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.smart-modal-summary {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.smart-modal-summary p {
    margin: 0 0 0.5rem 0;
}

.smart-modal-summary p:last-child {
    margin-bottom: 0;
}

.smart-modal-summary ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.smart-modal-summary li {
    margin-bottom: 0.25rem;
}

.smart-modal-summary strong {
    color: var(--accent-blue);
}

.smart-modal-summary-hint {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--accent-blue-transparent);
    border-left: 3px solid var(--accent-blue);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.smart-modal-map {
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.smart-modal-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.smart-modal-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.smart-modal-alerts {
    max-height: 200px;
    overflow-y: auto;
}

.smart-modal-alert-item {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.smart-modal-alert-item:hover {
    border-color: var(--accent-blue);
}

.smart-modal-alert-item:last-child {
    margin-bottom: 0;
}

.smart-modal-alert-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.smart-modal-alert-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.smart-modal-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

@media (max-width: 600px) {
    .smart-search-modal-content {
        max-width: 100%;
        margin: 0.5rem;
    }

    .smart-modal-map {
        height: 200px;
    }

    .smart-modal-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ==========================================
   PRIVACY CONSENT STYLES - LGPD COMPLIANCE
   ========================================== */

.cookie-consent-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.5rem;
    z-index: 10000;
    transition: bottom 0.3s ease;
    border-top: 3px solid var(--accent-blue);
}

.cookie-consent-banner.cookie-consent-visible {
    bottom: 0;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-consent-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.cookie-consent-text {
    flex: 1;
    min-width: 250px;
}

.cookie-consent-text strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.cookie-consent-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-consent-text a {
    color: var(--accent-blue);
    text-decoration: underline;
}

.cookie-consent-text a:hover {
    color: var(--accent-red);
}

.cookie-consent-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cookie-btn-primary {
    background: var(--accent-blue);
    color: white;
}

.cookie-btn-primary:hover {
    background: var(--accent-red);
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.cookie-btn-secondary:hover {
    background: var(--border-color);
}

.cookie-btn-link {
    background: transparent;
    color: var(--accent-blue);
    padding: 0.6rem 0.5rem;
}

.cookie-btn-link:hover {
    color: var(--accent-red);
    text-decoration: underline;
}

/* Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cookie-settings-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cookie-settings-close:hover {
    color: var(--accent-red);
}

.cookie-settings-body {
    padding: 1.5rem;
}

.cookie-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cookie-setting-item:last-child {
    border-bottom: none;
}

.cookie-setting-info {
    flex: 1;
    padding-right: 1rem;
}

.cookie-setting-info strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.cookie-setting-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.cookie-switch {
    position: relative;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cookie-switch input:checked + .cookie-slider {
    background-color: var(--accent-blue);
}

.cookie-switch input:disabled + .cookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(24px);
}

.cookie-settings-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Document Modal */
.cookie-document-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

.cookie-document-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-document-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--card-bg);
}

.cookie-document-header h2 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cookie-document-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cookie-document-close:hover {
    color: var(--accent-red);
}

.cookie-document-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.cookie-document-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
}

.cookie-document-body h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-red);
}

.cookie-document-body h2 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
}

.cookie-document-body h3 {
    font-size: 1rem;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.cookie-document-body p {
    margin-bottom: 0.75rem;
}

.cookie-document-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.cookie-document-body th,
.cookie-document-body td {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.cookie-document-body th {
    background: var(--bg-tertiary);
}

.cookie-document-body ul,
.cookie-document-body ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.cookie-document-body li {
    margin-bottom: 0.25rem;
}

.cookie-document-body strong {
    color: var(--accent-blue);
}

.cookie-document-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Footer Privacy Links */
footer .privacy-link {
    display: inline-flex;
    gap: 0.5rem;
    font-size: 0.85rem;
}

footer .privacy-link a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

footer .privacy-link a:hover {
    color: var(--accent-blue);
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-consent-icon {
        font-size: 1.5rem;
    }

    .cookie-consent-buttons {
        justify-content: center;
        width: 100%;
    }

    .cookie-settings-footer {
        flex-direction: column;
        gap: 0.75rem;
    }

    .cookie-settings-footer .cookie-btn {
        width: 100%;
    }

    .cookie-setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .cookie-setting-info {
        padding-right: 0;
    }
}