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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f1f5f9;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.header-left h1 {
  font-size: 2rem;
  margin-bottom: 5px;
}

.subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #334155;
  border-radius: 9999px;
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  animation: pulse 2s infinite;
}

.status-badge.connected .status-dot {
  background: #10b981;
}

.status-badge.error .status-dot {
  background: #ef4444;
}

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

.refresh-btn {
  padding: 10px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.refresh-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid #475569;
}

.stat-icon {
  font-size: 2rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #f8fafc;
}

.stat-label {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Section Titles */
.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3b82f6;
}

/* News Grid */
.news-grid {
  display: grid;
  gap: 15px;
}

/* News Card */
.news-card {
  background: linear-gradient(135deg, #1e293b 0%, #283548 100%);
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #3b82f6;
  transition: all 0.3s;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.news-card.high {
  border-left-color: #ef4444;
}

.news-card.medium {
  border-left-color: #f59e0b;
}

.news-card.low {
  border-left-color: #10b981;
}

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

.news-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.impact-badge {
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.impact-badge.high {
  background: #ef4444;
  color: white;
}

.impact-badge.medium {
  background: #f59e0b;
  color: #1e293b;
}

.impact-badge.low {
  background: #10b981;
  color: white;
}

.news-time {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.time-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #3b82f6;
}

.countdown {
  background: #334155;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.countdown.urgent {
  background: #ef4444;
  animation: pulse 1s infinite;
}

.countdown.warning {
  background: #f59e0b;
  color: #1e293b;
}

.countdown.safe {
  background: #10b981;
}

/* Impact Info */
.impact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.impact-stat {
  background: #0f172a;
  padding: 10px;
  border-radius: 8px;
}

.impact-stat-label {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 5px;
}

.impact-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Action Box */
.action-box {
  background: #0f172a;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
}

.action-box.high {
  border: 2px solid #ef4444;
}

.action-box.medium {
  border: 2px solid #f59e0b;
}

.action-title {
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-list {
  list-style: none;
  padding: 0;
}

.action-list li {
  padding: 5px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.action-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #3b82f6;
  font-weight: bold;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #334155;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

/* Error */
.error-message {
  text-align: center;
  padding: 40px;
  background: #1e293b;
  border-radius: 12px;
  border: 2px solid #ef4444;
}

.error-message h3 {
  color: #ef4444;
  margin-bottom: 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  border-left: 4px solid #3b82f6;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
}

.toast.high {
  border-left-color: #ef4444;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast-title {
  font-weight: 700;
  margin-bottom: 5px;
}

.toast-message {
  font-size: 0.9rem;
  color: #cbd5e1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Settings */
.settings-card {
  background: #1e293b;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.settings-card label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.label-text {
  font-weight: 500;
}

.settings-card select,
.settings-card input[type="checkbox"] {
  padding: 8px 12px;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 0.9rem;
}

.settings-card input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .news-header {
    flex-direction: column;
  }
}
