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

:root {
  /* Updated color palette for journalism style - softer, more accessible */
  --primary-bg: #faf8ff;
  --secondary-bg: #f0ebff;
  --accent-bg: #e6d9ff;
  --primary-purple: #8b5cf6;
  --secondary-purple: #7c3aed;
  --light-purple: #a78bfa;
  --text-primary: #374151;
  --text-secondary: #6b7280;
  --border-color: #d1d5db;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --card-bg: #ffffff;
}

html,
body {
  height: 100%;
  /* Changed from monospace to more readable fonts for journalism */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
}

.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styles */
.header {
  /* Softer header styling, less aggressive gradient */
  background: linear-gradient(90deg, var(--primary-purple), var(--secondary-purple));
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

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

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

.logo-text {
  /* Updated logo styling for owon branding */
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  text-shadow: none;
  letter-spacing: -0.02em;
}

.tagline {
  /* Added tagline styling */
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
}

.status-indicator {
  width: 12px;
  height: 12px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Removed scan-line animation for cleaner journalism look */

/* Main content takes remaining space */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Added search container styles */
.search-container {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
}

.country-search {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.country-search:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin-top: 0.5rem;
}

.search-result-item {
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background: var(--secondary-bg);
}

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

/* Updated main content layout to remove left column */
.main-content-grid {
  display: grid;
  grid-template-columns: 2fr 400px;
  gap: 1.5rem;
}

/* Added news ticker styles */
.news-ticker-container {
  flex: 1;
  max-width: 600px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
}

.news-ticker {
  white-space: nowrap;
  overflow: hidden;
}

.ticker-content {
  display: inline-block;
  color: white;
  font-size: 0.9rem;
  animation: scroll-left 60s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Added clock styles */
.clock-container {
  text-align: right;
  color: white;
}

.clock {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: "Courier New", monospace;
}

.date {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Control Panel */
.control-panel {
  /* Card-like styling for journalism interface */
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.panel-section {
  margin-bottom: 1.5rem;
}

.panel-section h3 {
  /* Softer heading styling */
  color: var(--primary-purple);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  border-bottom: 2px solid var(--light-purple);
  padding-bottom: 0.5rem;
}

/* Map Container */
.map-container {
  /* Clean card styling */
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}

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

.map-header h2 {
  /* More readable heading */
  color: var(--primary-purple);
  font-size: 1.5rem;
  font-weight: 600;
}

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

.target-info span:first-child {
  color: var(--primary-purple);
  font-weight: 600;
}

/* World map takes full available space */
.world-map {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 500px;
  position: relative;
  overflow: hidden;
}

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

/* Styled map zoom controls */
.zoom-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.zoom-btn {
  /* Cleaner button styling */
  width: 44px;
  height: 44px;
  background: var(--card-bg);
  color: var(--primary-purple);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zoom-btn:hover {
  background: var(--primary-purple);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.2);
}

/* Country styles */
.country {
  /* Softer country styling */
  fill: var(--accent-bg);
  stroke: var(--border-color);
  stroke-width: 0.05px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.country:hover {
  fill: var(--light-purple);
  stroke: var(--primary-purple);
  stroke-width: 0.1px;
}

.country.selected {
  fill: var(--light-purple);
  stroke: var(--secondary-purple);
  stroke-width: 0.05px;
}

.country-label {
  /* More readable labels */
  fill: var(--primary-purple);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  font-size: 11px;
  transition: opacity 0.3s ease, font-size 0.3s ease;
}

.country-label:hover {
  fill: var(--secondary-purple);
}

.labels-group {
  z-index: 2;
}

.countries-group {
  z-index: 1;
}

/* News Panel */
.news-panel {
  /* Renamed from intelligence-panel and updated styling */
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.panel-header {
  background: var(--primary-purple);
  color: white;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}

.news-container {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(110vh - 300px);
}

.welcome-message {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.welcome-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.welcome-message h4 {
  /* Updated welcome message styling */
  color: var(--primary-purple);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.welcome-message p {
  font-size: 1rem;
  line-height: 1.5;
}

.news-item {
  /* Improved news item styling */
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.news-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.1);
  border-color: var(--light-purple);
}

.news-item h4 {
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
}

.news-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.news-source {
  font-weight: 600;
  color: var(--primary-purple);
}

.read-more {
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.read-more:hover {
  color: var(--secondary-purple);
  text-decoration: underline;
}

/* Loading Animation */
.loading {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-purple);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

.hidden {
  display: none;
}

/* Footer */
.footer {
  background: var(--secondary-bg);
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 2rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-tagline {
  /* Updated footer tagline styling */
  font-style: italic;
  color: var(--primary-purple);
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes scroll-left {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-content {
    grid-template-columns: 250px 1fr 350px;
  }
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
  }

  .control-panel {
    order: 3;
  }

  .map-container {
    order: 1;
  }

  .news-panel {
    order: 2;
  }

  .world-map {
    height: 400px;
  }

  .header {
    padding: 1rem;
  }

  .logo-text {
    font-size: 2rem;
  }
}

/* Added styles for sources page and footer link */
.sources-link {
  color: #8b5cf6;
  text-decoration: none;
  margin-left: 20px;
  padding: 5px 10px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.sources-link:hover {
  background-color: rgba(139, 92, 246, 0.1);
  text-decoration: underline;
}

.sources-main {
  flex: 1;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.sources-container {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.sources-container h2 {
  color: #7c3aed;
  margin-bottom: 10px;
  font-size: 2.5rem;
}

.sources-intro {
  color: #6b7280;
  font-size: 1.1rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.source-category {
  background: #f8f4ff;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #8b5cf6;
}

.source-category h3 {
  color: #7c3aed;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.source-category ul {
  list-style: none;
  padding: 0;
}

.source-category li {
  margin-bottom: 10px;
  padding-left: 15px;
  position: relative;
  color: #4b5563;
  line-height: 1.5;
}

.source-category li:before {
  content: "•";
  color: #8b5cf6;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.disclaimer {
  background: #fef3c7;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.disclaimer h3 {
  color: #d97706;
  margin-bottom: 10px;
}

.disclaimer p {
  color: #92400e;
  line-height: 1.6;
  margin: 0;
}

.nav-back {
  display: flex;
  align-items: center;
}

.back-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

.back-link:hover {
  background-color: rgba(139, 92, 246, 0.1);
}

/* Added styles for contribute page */
.step-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d8b4fe;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(139, 92, 246, 0.1);
}

.step-card h3 {
  color: #7c3aed;
  margin-bottom: 12px;
  font-size: 1.2em;
  font-weight: 600;
}

.code-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  font-family: "Courier New", monospace;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  white-space: pre-wrap;
}

.code-block code {
  color: #1e293b;
  font-size: 14px;
  line-height: 1.5;
}

.guidelines-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

.guideline-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  padding: 20px;
}

.guideline-card h4 {
  margin-bottom: 12px;
  font-size: 1.1em;
}

.guideline-card ul {
  margin: 0;
  padding-left: 20px;
}

.guideline-card li {
  margin-bottom: 8px;
  color: #4b5563;
}

.contribute-section ol {
  padding-left: 20px;
}

.contribute-section ol li {
  margin-bottom: 8px;
  color: #4b5563;
}

@media (max-width: 768px) {
  .guidelines-grid {
    grid-template-columns: 1fr;
  }
}
