:root {
    --primary-color: #1a237e;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-bg: #1a1a2e;
    --card-bg: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #0d1117;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    margin: 0;
}

.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.map-container {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 450px;
}

#map {
    width: 100%;
    height: 100%;
}

.map-overlay-stats {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.overlay-stat {
    background: rgba(26, 26, 46, 0.9);
    border-radius: 8px;
    padding: 10px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 90px;
}

.overlay-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.overlay-stat .stat-label {
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-overlay-trends {
    position: absolute;
    top: 80px;
    left: 10px;
    width: 280px;
    z-index: 10;
}

.map-overlay-distribution {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 200px;
    z-index: 10;
}

.map-overlay-states {
    position: absolute;
    top: 80px;
    right: 10px;
    width: 220px;
    z-index: 10;
}

.overlay-card {
    background: rgba(26, 26, 46, 0.92);
    border-radius: 10px;
    padding: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.overlay-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overlay-card canvas {
    max-height: 150px;
}

.data-section {
    background: #0d1117;
    padding: 15px;
}

.data-section .card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
}

.data-section .card-header {
    background: #21262d;
    border-bottom: 1px solid #30363d;
    color: #c9d1d9;
    padding: 0.75rem 1rem;
}

.data-section .card-header h6 {
    color: #c9d1d9;
    margin: 0;
}

.data-section .card-body {
    background: #161b22;
    color: #c9d1d9;
}

.news-container {
    max-height: 300px;
    overflow-y: auto;
}

.news-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #30363d;
}

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

.news-item h6 {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    color: #c9d1d9;
}

.news-item h6 a {
    color: #58a6ff;
    text-decoration: none;
}

.news-item h6 a:hover {
    text-decoration: underline;
}

.news-meta {
    font-size: 0.7rem;
    color: #8b949e;
}

.event-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.event-badge.riot {
    background-color: #dc3545;
    color: white;
}

.event-badge.protest {
    background-color: #ffc107;
    color: #333;
}

.event-badge.strike {
    background-color: #17a2b8;
    color: white;
}

.event-badge.civil_commotion {
    background-color: #6c757d;
    color: white;
}

.data-section .table {
    color: #c9d1d9;
    font-size: 0.8rem;
    margin-bottom: 0;
}

.data-section .table th {
    background-color: #21262d;
    font-weight: 600;
    color: #8b949e;
    border-bottom: 1px solid #30363d;
    font-size: 0.75rem;
    padding: 0.5rem;
}

.data-section .table td {
    border-color: #30363d;
    vertical-align: middle;
    padding: 0.4rem 0.5rem;
}

.data-section .table tbody tr:hover {
    background-color: #21262d;
}

.data-section .table a {
    color: #58a6ff;
}

.footer {
    background: #0d1117;
    border-top: 1px solid #30363d;
}

.footer a {
    color: #58a6ff;
}

.btn-group-sm .btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
}

#country-toggle .btn {
    font-weight: 600;
    letter-spacing: 0.3px;
}

#country-toggle .btn.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.mapboxgl-popup-content {
    background: rgba(26, 26, 46, 0.95);
    border-radius: 8px;
    padding: 12px;
    min-width: 180px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mapboxgl-popup-content h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 0.9rem;
}

.mapboxgl-popup-content p {
    margin: 0.25rem 0;
    font-size: 0.8rem;
    color: #ccc;
}

.mapboxgl-popup-tip {
    border-top-color: rgba(26, 26, 46, 0.95);
}

.marker-protest {
    background-color: #ffc107;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.6);
}

.marker-riot {
    background-color: #dc3545;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.6);
}

.marker-strike {
    background-color: #17a2b8;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(23, 162, 184, 0.6);
}

.marker-civil_commotion {
    background-color: #6c757d;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(108, 117, 125, 0.6);
}

.pulse-marker {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

#status-badge {
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

::-webkit-scrollbar-track {
    background: #21262d;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #484f58;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6e7681;
}

@media (max-width: 992px) {
    .map-container {
        height: 50vh;
        min-height: 400px;
    }
    
    .map-overlay-stats {
        flex-wrap: wrap;
        width: 90%;
        justify-content: center;
    }
    
    .overlay-stat {
        padding: 8px 12px;
        min-width: 70px;
    }
    
    .overlay-stat .stat-value {
        font-size: 1.2rem;
    }
    
    .map-overlay-trends,
    .map-overlay-states {
        width: 200px;
    }
    
    .map-overlay-distribution {
        width: 160px;
    }
}

@media (max-width: 768px) {
    .map-container {
        height: 45vh;
        min-height: 350px;
    }
    
    .map-overlay-trends,
    .map-overlay-states,
    .map-overlay-distribution {
        display: none;
    }
    
    .map-overlay-stats {
        top: 5px;
        gap: 8px;
    }
    
    .overlay-stat {
        padding: 6px 10px;
        min-width: 60px;
    }
    
    .overlay-stat .stat-value {
        font-size: 1rem;
    }
    
    .overlay-stat .stat-label {
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 0.85rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }
}

.risk-section {
    background: #0d1117;
    padding: 15px;
    padding-top: 0;
}

.risk-card {
    background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
    border: 1px solid #30363d;
}

.risk-card .card-header {
    background: #21262d;
    border-bottom: 1px solid #30363d;
}

.risk-card .card-header h6 {
    color: #c9d1d9;
}

.risk-indicator {
    text-align: center;
    padding: 10px;
}

.risk-score {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.risk-score.low { color: #3fb950; }
.risk-score.moderate { color: #d29922; }
.risk-score.high { color: #f85149; }
.risk-score.critical { color: #ff4757; text-shadow: 0 0 10px rgba(255, 71, 87, 0.5); }

.risk-score-label {
    font-size: 0.75rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.risk-scale {
    height: 8px;
    background: linear-gradient(90deg, #3fb950 0%, #d29922 33%, #f85149 66%, #ff4757 100%);
    border-radius: 4px;
    position: relative;
    margin-bottom: 5px;
}

.risk-bar {
    position: absolute;
    width: 4px;
    height: 16px;
    background: #fff;
    border-radius: 2px;
    top: -4px;
    transition: left 0.5s ease;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

.risk-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #6e7681;
}

.risk-factors {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.risk-factor {
    background: rgba(33, 38, 45, 0.8);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #30363d;
}

.factor-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.factor-header i {
    color: #58a6ff;
    font-size: 1rem;
}

.factor-title {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c9d1d9;
}

.factor-value {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.factor-value.low { background: rgba(63, 185, 80, 0.2); color: #3fb950; }
.factor-value.moderate { background: rgba(210, 153, 34, 0.2); color: #d29922; }
.factor-value.high { background: rgba(248, 81, 73, 0.2); color: #f85149; }
.factor-value.critical { background: rgba(255, 71, 87, 0.2); color: #ff4757; }

.factor-reasoning {
    font-size: 0.7rem;
    color: #8b949e;
    line-height: 1.4;
}

.risk-summary {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 0.8rem;
    color: #c9d1d9;
}

.risk-summary.elevated {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.3);
}

.risk-summary.critical {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.4);
}

#risk-level-badge.bg-success { background-color: #3fb950 !important; }
#risk-level-badge.bg-warning { background-color: #d29922 !important; color: #000; }
#risk-level-badge.bg-danger { background-color: #f85149 !important; }
#risk-level-badge.bg-critical { background-color: #ff4757 !important; animation: pulse-badge 1s infinite; }

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@media (max-width: 768px) {
    .risk-factors {
        grid-template-columns: 1fr;
    }
    
    .risk-score {
        font-size: 2.5rem;
    }
}

.influencers-section {
    background: #0d1117;
    padding: 15px;
    padding-top: 0;
    padding-bottom: 30px;
}

.influencers-card {
    background: linear-gradient(135deg, #161b22 0%, #1c2128 100%);
    border: 1px solid #30363d;
}

.influencers-card .card-header {
    background: #21262d;
    border-bottom: 1px solid #30363d;
}

.influencers-card .card-header h6 {
    color: #c9d1d9;
}

.influencer-category {
    background: rgba(33, 38, 45, 0.8);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #30363d;
    height: 100%;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
}

.category-header i {
    color: #58a6ff;
    font-size: 1.1rem;
}

.category-header span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #c9d1d9;
}

.influencer-list {
    min-height: 150px;
}

.influencer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

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

.influencer-name {
    font-size: 0.8rem;
    color: #c9d1d9;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.influencer-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(88, 166, 255, 0.15);
    color: #58a6ff;
    margin-left: 8px;
}

.influencer-bar {
    height: 4px;
    background: #30363d;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.influencer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #58a6ff, #3fb950);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.topic-tag {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 15px;
    font-size: 0.75rem;
    color: #58a6ff;
}

.topic-tag.hot {
    background: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.4);
    color: #f85149;
}

.topic-tag.rising {
    background: rgba(210, 153, 34, 0.15);
    border-color: rgba(210, 153, 34, 0.4);
    color: #d29922;
}

.influencer-insight {
    background: rgba(88, 166, 255, 0.08);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 0.8rem;
    color: #8b949e;
}

.influencer-insight i {
    color: #d29922;
}
