/* =============================================
   World Map Styles - Global Crisis Visualization
   ============================================= */

/* World Map Container */
.world-map-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 1rem;
    height: calc(100vh - 300px);
    min-height: 500px;
}

.world-map-wrapper {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.world-map {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a1628 0%, #1a2744 100%);
    position: relative;
    overflow: hidden;
}

.world-map svg {
    width: 100%;
    height: 100%;
}

/* Map Countries */
.world-map .country {
    fill: #1e3a5f;
    stroke: #2d5a87;
    stroke-width: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.world-map .country:hover {
    fill: #2a5298;
    stroke: #4a90d9;
}

.world-map .country.highlighted {
    fill: #3b82f6;
    stroke: #60a5fa;
}

.world-map .country.affected {
    fill: rgba(239, 68, 68, 0.3);
    stroke: #ef4444;
}

/* Crisis Markers */
.crisis-marker {
    position: absolute;
    cursor: pointer;
    z-index: 10;
    transform: translate(-50%, -50%);
}

.crisis-marker .marker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    position: relative;
    animation: markerPulse 2s ease-in-out infinite;
}

.crisis-marker .marker-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: markerRipple 2s ease-out infinite;
}

/* Marker Types */
.crisis-marker.cyber .marker-dot {
    background: #3b82f6;
    box-shadow: 0 0 15px #3b82f6;
}

.crisis-marker.cyber .marker-dot::before {
    border: 2px solid #3b82f6;
}

.crisis-marker.diplomatic .marker-dot {
    background: #8b5cf6;
    box-shadow: 0 0 15px #8b5cf6;
}

.crisis-marker.diplomatic .marker-dot::before {
    border: 2px solid #8b5cf6;
}

.crisis-marker.military .marker-dot {
    background: #ef4444;
    box-shadow: 0 0 15px #ef4444;
}

.crisis-marker.military .marker-dot::before {
    border: 2px solid #ef4444;
}

.crisis-marker.terrorism .marker-dot {
    background: #f97316;
    box-shadow: 0 0 15px #f97316;
}

.crisis-marker.terrorism .marker-dot::before {
    border: 2px solid #f97316;
}

.crisis-marker.natural .marker-dot {
    background: #10b981;
    box-shadow: 0 0 15px #10b981;
}

.crisis-marker.natural .marker-dot::before {
    border: 2px solid #10b981;
}

/* Severity Indicators */
.crisis-marker.critical .marker-dot {
    animation: markerPulse 0.5s ease-in-out infinite;
}

.crisis-marker.high .marker-dot {
    animation: markerPulse 1s ease-in-out infinite;
}

/* Marker Label */
.crisis-marker .marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    font-size: 0.7rem;
    color: white;
    margin-top: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.crisis-marker:hover .marker-label {
    opacity: 1;
}

/* Connection Lines */
.connection-line {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1;
    stroke-dasharray: 5, 5;
    fill: none;
    animation: dashMove 20s linear infinite;
}

.connection-line.active {
    stroke: #f59e0b;
    stroke-width: 2;
    stroke-dasharray: none;
}

@keyframes markerPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes markerRipple {
    0% { width: 16px; height: 16px; opacity: 1; }
    100% { width: 50px; height: 50px; opacity: 0; }
}

@keyframes dashMove {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 100; }
}

/* Map Legend Panel */
.map-legend-panel {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-width: 180px;
    z-index: 20;
}

.map-legend-panel h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.map-legend-panel .legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.map-legend-panel .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.map-legend-panel .marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.map-legend-panel .marker.cyber { background: #3b82f6; }
.map-legend-panel .marker.diplomatic { background: #8b5cf6; }
.map-legend-panel .marker.military { background: #ef4444; }
.map-legend-panel .marker.terrorism { background: #f97316; }
.map-legend-panel .marker.natural { background: #10b981; }

.map-legend-panel .severity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.map-legend-panel .severity-dot.critical {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}
.map-legend-panel .severity-dot.high { background: #f97316; }
.map-legend-panel .severity-dot.medium { background: #f59e0b; }
.map-legend-panel .severity-dot.low { background: #10b981; }

.map-legend-panel hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.75rem 0;
}

/* Crisis Timeline Panel */
.crisis-timeline-panel {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    width: 280px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 20;
}

.crisis-timeline-panel h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crisis-timeline-panel h4 i {
    color: var(--primary-light);
}

.crisis-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.timeline-event {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.timeline-event:hover {
    background: var(--bg-card);
}

.timeline-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 45px;
}

.timeline-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.timeline-location {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Crisis Details Panel */
.crisis-details-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.crisis-details-panel .panel-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.crisis-details-panel .panel-header h4 i {
    color: var(--primary-light);
}

.crisis-details-content {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.crisis-details-content .placeholder-text {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

/* Crisis Detail Card */
.crisis-detail-card {
    animation: fadeIn 0.3s ease;
}

.crisis-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.crisis-type-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.crisis-type-icon.cyber { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.crisis-type-icon.diplomatic { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.crisis-type-icon.military { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.crisis-type-icon.terrorism { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.crisis-type-icon.natural { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.crisis-detail-title {
    flex: 1;
}

.crisis-detail-title h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.crisis-detail-title .crisis-type-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.crisis-severity-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.crisis-severity-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.crisis-severity-badge.high {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.crisis-severity-badge.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.crisis-severity-badge.low {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.crisis-detail-info {
    margin-bottom: 1rem;
}

.crisis-detail-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.crisis-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.crisis-meta-item {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.crisis-meta-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.crisis-meta-item span {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.crisis-actors {
    margin-top: 1rem;
}

.crisis-actors h5 {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.actor-tag {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.actor-tag i {
    font-size: 0.7rem;
}

/* Crisis Actions */
.crisis-actions {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.crisis-actions button {
    flex: 1;
}

/* Actors Panel */
.actors-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    overflow: hidden;
}

.actors-list {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    overflow-x: auto;
}

.actor-card {
    min-width: 200px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.actor-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.actor-card .actor-flag {
    width: 40px;
    height: 30px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.actor-card .actor-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.actor-card .actor-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.actor-card .actor-involvement {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.actor-card .actor-involvement.ally {
    color: var(--success-color);
}

.actor-card .actor-involvement.neutral {
    color: var(--warning-color);
}

.actor-card .actor-involvement.adversary {
    color: var(--danger-color);
}

/* Mini World Map (Dashboard) */
.mini-world-map {
    height: 250px;
    background: linear-gradient(180deg, #0a1628 0%, #1a2744 100%);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.mini-world-map svg {
    width: 100%;
    height: 100%;
}

.mini-world-map .crisis-marker .marker-dot {
    width: 10px;
    height: 10px;
}

.mini-world-map .crisis-marker .marker-label {
    display: none;
}

/* Map Controls */
.map-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* =============================================
   Leaflet Map Integration Styles
   ============================================= */

.leaflet-container-wrapper {
    position: relative;
}

.leaflet-map-container {
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    z-index: 1;
}

.leaflet-map-container.loading::after {
    content: 'Duke ngarkuar hartën...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    padding: 1rem 2rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    z-index: 1000;
}

/* Leaflet overrides for dark theme */
.leaflet-container {
    background: #0a1628;
    font-family: inherit;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: rgba(30, 41, 59, 0.9) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.leaflet-control-zoom-in {
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
}

.leaflet-control-attribution {
    background: rgba(15, 23, 42, 0.8) !important;
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
    border-radius: var(--radius-sm) 0 0 0 !important;
}

.leaflet-control-attribution a {
    color: var(--primary-light) !important;
}

/* Custom popup styling */
.leaflet-popup-content-wrapper {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-tip {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    font-size: 20px !important;
    padding: 8px !important;
}

.leaflet-popup-close-button:hover {
    color: var(--text-primary) !important;
}

/* Glass panels over map */
.glass-panel {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Real-time stats panel */
.realtime-stats-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    padding: 1rem 1.25rem;
    min-width: 200px;
}

.realtime-stats-panel h4 {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.realtime-stats-panel h4 i {
    color: var(--primary-light);
}

.realtime-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.realtime-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.realtime-stat:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.realtime-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.realtime-stat.critical .stat-value {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.realtime-stat.high .stat-value {
    color: #f97316;
}

.realtime-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.last-updated {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.last-updated i {
    color: var(--success-color);
}

/* Crisis details panel enhancements */
.crisis-details-panel {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    position: relative;
}

.crisis-details-panel.active {
    transform: translateX(0);
}

.crisis-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.crisis-detail-header .crisis-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.crisis-detail-header .crisis-icon.cyber { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.crisis-detail-header .crisis-icon.diplomatic { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.crisis-detail-header .crisis-icon.military { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.crisis-detail-header .crisis-icon.terrorism { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.crisis-detail-header .crisis-icon.natural { background: rgba(16, 185, 129, 0.2); color: #10b981; }

.crisis-detail-header .crisis-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.crisis-detail-header .crisis-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crisis-detail-header .crisis-severity {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.crisis-detail-header .crisis-severity.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.crisis-detail-header .crisis-severity.high { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.crisis-detail-header .crisis-severity.medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.crisis-detail-header .crisis-severity.low { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.crisis-details-content h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.crisis-details-content .crisis-location,
.crisis-details-content .crisis-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.crisis-details-content .crisis-location i,
.crisis-details-content .crisis-date i {
    color: var(--primary-light);
    width: 16px;
}

.crisis-details-content .crisis-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-light);
}

.crisis-details-content .crisis-actors {
    margin-top: 1rem;
}

.crisis-details-content .crisis-actors h5 {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crisis-details-content .crisis-actors h5 i {
    color: var(--primary-light);
}

.crisis-details-content .crisis-actors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crisis-details-content .crisis-actors li {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crisis-details-content .crisis-actors li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--primary-light);
    border-radius: 50%;
}

.crisis-details-content .crisis-source {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crisis-details-content .crisis-source i {
    color: var(--text-muted);
}

/* Data sources panel */
.data-sources-panel {
    margin-top: 1rem;
}

.data-sources-list {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
}

.data-source {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.data-source:hover {
    border-color: var(--primary-light);
}

.data-source i {
    font-size: 1.1rem;
    color: var(--primary-light);
}

.source-status {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.source-status.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Timeline item styling */
.timeline-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.timeline-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.timeline-item.critical {
    border-left-color: #ef4444;
}

.timeline-item.high {
    border-left-color: #f97316;
}

.timeline-item.medium {
    border-left-color: #eab308;
}

.timeline-item.low {
    border-left-color: #22c55e;
}

.timeline-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.timeline-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.timeline-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-country {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .world-map-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .crisis-details-panel {
        max-height: 400px;
    }

    .map-legend-panel,
    .crisis-timeline-panel {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        width: 100%;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .actors-list {
        flex-direction: column;
    }

    .actor-card {
        min-width: auto;
    }
}

/* =============================================
   Charts and Statistics Styles
   ============================================= */

/* Crisis Activity Chart in Stats Panel */
.crisis-activity-chart {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.crisis-activity-chart h5 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crisis-activity-chart canvas {
    width: 100% !important;
    height: 100px !important;
}

/* Chart Containers */
.chart-container {
    position: relative;
    height: 250px;
    width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Report Card Chart Specific */
.report-card .chart-container {
    padding: 1rem 0;
}

.report-card.large .chart-container {
    height: 300px;
}

/* Activity Chart */
.activity-chart {
    position: relative;
    height: 200px;
}

.activity-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Loading State */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.chart-loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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

/* Mini Charts for Dashboard Cards */
.mini-chart {
    height: 60px;
    margin-top: 0.5rem;
}

.mini-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Tooltip Enhancements */
.chart-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Doughnut Chart Center Text */
.doughnut-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

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

.doughnut-center-text .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================
   Advanced Map Controls Styles
   ============================================= */

/* Region filter dropdown */
#crisis-region-filter {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#crisis-region-filter:hover {
    border-color: var(--primary-light);
}

#crisis-region-filter:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Map control buttons */
.map-control-buttons {
    display: flex;
    gap: 0.5rem;
}

.map-control-buttons .btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-control-buttons .btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.map-control-buttons .btn-icon.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.5);
}

.map-control-buttons .btn-icon i {
    font-size: 1rem;
}

/* Heatmap layer styles */
.leaflet-heatmap-layer {
    opacity: 0.8;
}

/* Circle heatmap (fallback) */
.circle-heatmap-marker {
    pointer-events: none;
}

/* Cluster marker styles */
.marker-cluster {
    background: transparent !important;
}

.cluster-marker {
    transition: all 0.3s ease;
    cursor: pointer;
}

.cluster-marker:hover {
    transform: scale(1.1);
}

.cluster-marker.small {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.6);
}

.cluster-marker.medium {
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.6);
}

.cluster-marker.large {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    animation: clusterPulse 2s infinite;
}

@keyframes clusterPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Cluster popup */
.cluster-popup {
    padding: 0.5rem;
}

.cluster-popup h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.cluster-popup ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cluster-popup li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.cluster-popup li:last-child {
    border-bottom: none;
}

/* Crisis popup enhancements */
.crisis-popup {
    min-width: 250px;
    padding: 0.5rem;
}

.crisis-popup .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.crisis-popup .popup-type {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.crisis-popup .popup-type.cyber { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.crisis-popup .popup-type.diplomatic { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.crisis-popup .popup-type.military { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.crisis-popup .popup-type.terrorism { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.crisis-popup .popup-type.natural { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.crisis-popup .popup-type.earthquake { background: rgba(220, 38, 38, 0.2); color: #dc2626; }
.crisis-popup .popup-type.flood { background: rgba(8, 145, 178, 0.2); color: #0891b2; }
.crisis-popup .popup-type.wildfire { background: rgba(234, 88, 12, 0.2); color: #ea580c; }
.crisis-popup .popup-type.storm { background: rgba(124, 58, 237, 0.2); color: #7c3aed; }
.crisis-popup .popup-type.volcano { background: rgba(185, 28, 28, 0.2); color: #b91c1c; }
.crisis-popup .popup-type.drought { background: rgba(202, 138, 4, 0.2); color: #ca8a04; }

.crisis-popup .popup-severity {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.crisis-popup .popup-severity.critical { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.crisis-popup .popup-severity.high { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.crisis-popup .popup-severity.medium { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.crisis-popup .popup-severity.low { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.crisis-popup h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.crisis-popup .popup-country {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.crisis-popup .popup-country i {
    color: var(--primary-light);
    font-size: 0.75rem;
}

.crisis-popup .popup-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
    line-height: 1.5;
}

.crisis-popup .popup-source {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.crisis-popup .popup-source i {
    color: var(--text-muted);
}

.crisis-popup .popup-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--primary-light);
    text-decoration: none;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.crisis-popup .popup-link:hover {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

/* Crisis magnitude and warnings */
.crisis-details-content .crisis-magnitude {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.crisis-details-content .crisis-magnitude i {
    color: var(--primary-light);
}

.crisis-details-content .crisis-magnitude strong {
    color: var(--text-primary);
    font-size: 1.1rem;
}

.crisis-details-content .crisis-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #ef4444;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
    animation: warningPulse 1.5s infinite;
}

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

.crisis-details-content .crisis-warning i {
    color: #ef4444;
}

/* Search input for crises */
.crisis-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.crisis-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.crisis-search-wrapper {
    position: relative;
}

.crisis-search-wrapper i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Export button */
.btn-export {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: #10b981;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

/* Filter pills */
.filter-pills {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.filter-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--primary-light);
}

.filter-pill .remove-filter {
    cursor: pointer;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 0.6rem;
    transition: all 0.2s ease;
}

.filter-pill .remove-filter:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Pulse animation for critical markers */
@keyframes pulse-critical {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

@keyframes pulse-marker {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Marker animation overrides based on type */
.custom-marker .marker-container.earthquake {
    animation: pulse-critical 1s infinite !important;
}

.custom-marker .marker-container.wildfire {
    animation: pulse-critical 1.2s infinite !important;
}

.custom-marker .marker-container.military.critical {
    animation: pulse-critical 0.8s infinite !important;
}

/* Map loading overlay */
.leaflet-map-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.8);
    z-index: 999;
}

.leaflet-map-container.loading::after {
    content: 'Duke ngarkuar të dhënat...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    padding: 1.5rem 2.5rem;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.95rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.leaflet-map-container.loading::after {
    animation: loadingPulse 1.5s ease-in-out infinite;
}

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