const cssStyles = `
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    overflow-x: hidden;
}

.dashboard {
    min-height: 100vh;
    padding: 20px;
}

/* Header */
.header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.last-update {
    font-size: 0.9em;
    opacity: 0.8;
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.status-indicators {
    display: flex;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.indicator-dot.cyber { background: #e74c3c; }
.indicator-dot.weather { background: #3498db; }
.indicator-dot.transport { background: #f39c12; }
.indicator-dot.business { background: #2ecc71; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.refresh-btn:hover {
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}

/* Controls */
.controls {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group label {
    font-weight: 600;
    margin-right: 5px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.region-select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
}

.region-select option {
    background: #2a5298;
    color: white;
}

.source-filter-group {
    align-items: flex-start;
}

.source-toggle {
    padding: 6px 14px;
    font-size: 0.85em;
}

.source-filter-panel {
    margin-top: 8px;
    width: 100%;
}

.source-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 520px;
}

.source-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 0.85em;
    cursor: pointer;
    user-select: none;
}

.source-option input {
    accent-color: #667eea;
}

.view-toggle {
    margin-left: auto;
    display: flex;
    gap: 10px;
}

.view-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.view-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Main Content */
.main-content {
    position: relative;
    min-height: 600px;
}

.list-view, .map-view {
    display: none;
}

.list-view.active, .map-view.active {
    display: block;
}

/* Events Container */
.events-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    grid-column: 1 / -1;
}

/* Event Card */
.event-card {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

.event-card.cyber::before { background: #e74c3c; }
.event-card.weather::before { background: #3498db; }
.event-card.transport::before { background: #f39c12; }
.event-card.business::before { background: #2ecc71; }
.event-card.news::before { background: #9b59b6; }

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.event-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.category-cyber { background: #e74c3c; }
.badge.category-weather { background: #3498db; }
.badge.category-transport { background: #f39c12; }
.badge.category-business { background: #2ecc71; }
.badge.category-news { background: #9b59b6; }

.event-time {
    font-size: 0.85em;
    opacity: 0.7;
}

.event-title {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.event-description {
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
}

.event-region {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.8;
}

.event-source {
    opacity: 0.6;
    font-style: italic;
}

/* Map View */
#map {
    height: 700px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-popup-content-wrapper {
    background: rgba(0, 0, 0, 0.9);
    color: white;
}

.leaflet-popup-content {
    margin: 15px;
}

.popup-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.popup-category {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    margin-bottom: 8px;
}

.popup-description {
    font-size: 0.9em;
    margin-bottom: 8px;
    line-height: 1.4;
}

.popup-link {
    color: #3498db;
    text-decoration: none;
}

.popup-link:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .events-container {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }

    .header-left, .header-right {
        width: 100%;
    }

    .status-indicators {
        flex-wrap: wrap;
    }

    .events-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-left h1 {
        font-size: 1.8em;
    }

    .controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-toggle {
        margin-left: 0;
        width: 100%;
    }

    .source-filter {
        max-width: 100%;
    }
}

/* Animation for new events */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-card {
    animation: slideIn 0.5s ease-out;
}
