/* News Dashboard */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.news-dashboard {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 20px;
}

/* Header */
.news-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  text-align: center;
}

.news-title {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  position: relative;
}

.news-title h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
}

.last-updated {
  margin: 8px 0 0;
  font-size: 14px;
  color: #888;
}

/* Source tabs */
.source-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 8px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.source-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #aaa;
}

.tab-btn.active {
  background: rgba(74, 144, 217, 0.25);
  border-color: rgba(74, 144, 217, 0.5);
  color: #7ab8f5;
}

/* Footer */
.news-footer {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 14px;
}

.news-footer p {
  margin: 0;
}

/* Content layout */
.news-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* Loading/Empty states */
.news-loading,
.news-empty {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 18px;
}

/* Hero card */
.hero-card {
  background: linear-gradient(135deg, #2d3a4f 0%, #1f2937 100%);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hero-category {
  display: inline-block;
  background: rgba(74, 144, 217, 0.3);
  color: #7ab8f5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.hero-headline {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.3;
}

.hero-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-expanded {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.hero-card.expanded .hero-expanded {
  display: block;
}

.hero-summary {
  font-size: 16px;
  line-height: 1.6;
  color: #ccc;
  margin: 0 0 16px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.expand-hint {
  font-size: 12px;
  color: #666;
  margin-top: 12px;
}

/* Story grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Story card */
.story-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.story-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.story-card.priority-2 {
  border-left: 3px solid #f59e0b;
}

.story-card.priority-3 {
  border-left: 3px solid #6b7280;
}

.story-category {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.story-headline {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}

.story-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.more-sources {
  font-size: 12px;
  color: #888;
}

.story-expanded {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.story-card.expanded .story-expanded {
  display: block;
}

.story-summary {
  font-size: 14px;
  line-height: 1.5;
  color: #bbb;
  margin: 0 0 12px;
}

.story-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Source badges */
.source-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.source-badge.left {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.source-badge.center {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.source-badge.right {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Source links */
.source-link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s;
}

.source-link.left {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.source-link.left:hover {
  background: rgba(59, 130, 246, 0.25);
}

.source-link.center {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

.source-link.center:hover {
  background: rgba(156, 163, 175, 0.25);
}

.source-link.right {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.source-link.right:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Topic badges (for specialty tab) */
.source-badge.science {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.source-badge.tech {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

/* Topic links (for specialty tab) */
.source-link.science {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.source-link.science:hover {
  background: rgba(34, 197, 94, 0.25);
}

.source-link.tech {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.source-link.tech:hover {
  background: rgba(168, 85, 247, 0.25);
}

/* Positive topic badges */
.source-badge.humanitarian {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.source-badge.uplifting {
  background: rgba(251, 113, 133, 0.2);
  color: #fb7185;
}

/* Positive topic links */
.source-link.humanitarian {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.source-link.humanitarian:hover {
  background: rgba(234, 179, 8, 0.25);
}

.source-link.uplifting {
  background: rgba(251, 113, 133, 0.15);
  color: #fb7185;
}

.source-link.uplifting:hover {
  background: rgba(251, 113, 133, 0.25);
}

/* Nature topic badges */
.source-badge.wildlife {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.source-badge.weather {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.source-badge.environment {
  background: rgba(20, 184, 166, 0.2);
  color: #2dd4bf;
}

/* Nature topic links */
.source-link.wildlife {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.source-link.wildlife:hover {
  background: rgba(16, 185, 129, 0.25);
}

.source-link.weather {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.source-link.weather:hover {
  background: rgba(56, 189, 248, 0.25);
}

.source-link.environment {
  background: rgba(20, 184, 166, 0.15);
  color: #2dd4bf;
}

.source-link.environment:hover {
  background: rgba(20, 184, 166, 0.25);
}

/* Entertainment topic badges */
.source-badge.film {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

.source-badge.music {
  background: rgba(217, 70, 239, 0.2);
  color: #d946ef;
}

.source-badge.gaming {
  background: rgba(129, 140, 248, 0.2);
  color: #818cf8;
}

/* Entertainment topic links */
.source-link.film {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.source-link.film:hover {
  background: rgba(251, 146, 60, 0.25);
}

.source-link.music {
  background: rgba(217, 70, 239, 0.15);
  color: #d946ef;
}

.source-link.music:hover {
  background: rgba(217, 70, 239, 0.25);
}

.source-link.gaming {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
}

.source-link.gaming:hover {
  background: rgba(129, 140, 248, 0.25);
}

/* Source type badges (for local tab) */
.source-badge.newspaper {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.source-badge.nonprofit {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.source-badge.radio {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.source-badge.tv {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}

.source-badge.government {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

.source-badge.community {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
}

/* Source type links (for local tab) */
.source-link.newspaper {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.source-link.newspaper:hover {
  background: rgba(59, 130, 246, 0.25);
}

.source-link.nonprofit {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.source-link.nonprofit:hover {
  background: rgba(34, 197, 94, 0.25);
}

.source-link.radio {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.source-link.radio:hover {
  background: rgba(168, 85, 247, 0.25);
}

.source-link.tv {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
}

.source-link.tv:hover {
  background: rgba(249, 115, 22, 0.25);
}

.source-link.government {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
}

.source-link.government:hover {
  background: rgba(156, 163, 175, 0.25);
}

.source-link.community {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
}

.source-link.community:hover {
  background: rgba(236, 72, 153, 0.25);
}

/* Share button */
.share-btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(74, 144, 217, 0.2);
  color: #7ab8f5;
  border: 1px solid rgba(74, 144, 217, 0.3);
  cursor: pointer;
  transition: background 0.2s;
}

.share-btn:hover {
  background: rgba(74, 144, 217, 0.35);
}

/* Share toast */
.share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 50, 0.95);
  color: #ccc;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1000;
}

.share-toast.visible {
  opacity: 1;
}

/* Highlighted card (deep link target) */
.highlighted {
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.6), 0 0 20px rgba(74, 144, 217, 0.3);
  animation: highlight-pulse 1s ease-in-out;
}

@keyframes highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.6), 0 0 20px rgba(74, 144, 217, 0.3); }
  50% { box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.8), 0 0 30px rgba(74, 144, 217, 0.5); }
}

/* Expired story banner */
.expired-banner {
  max-width: 1200px;
  margin: 0 auto 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #999;
}

.expired-dismiss {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.expired-dismiss:hover {
  color: #999;
}

/* Subscribe section — shared */
.subscribe-section {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 28px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-align: center;
}

.subscribe-heading {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.subscribe-subtext {
  margin: 0 0 16px;
  font-size: 14px;
  color: #888;
}

.subscribe-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.topic-pill {
  cursor: pointer;
}

.topic-pill input[type="checkbox"] {
  display: none;
}

.topic-pill span {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #888;
  transition: all 0.2s;
}

.topic-pill input:checked + span {
  background: rgba(74, 144, 217, 0.25);
  border-color: rgba(74, 144, 217, 0.5);
  color: #7ab8f5;
}

.subscribe-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  max-width: 400px;
  margin: 0 auto;
}

.subscribe-email {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.subscribe-email::placeholder {
  color: #666;
}

.subscribe-email:focus {
  border-color: rgba(74, 144, 217, 0.5);
}

.subscribe-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  background: rgba(74, 144, 217, 0.3);
  color: #7ab8f5;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.subscribe-btn:hover {
  background: rgba(74, 144, 217, 0.45);
}

.subscribe-feedback {
  margin-top: 12px;
  font-size: 13px;
  min-height: 20px;
}

.subscribe-feedback.success {
  color: #4ade80;
}

.subscribe-feedback.error {
  color: #f87171;
}

/* Variant B: compact CTA bar */
.subscribe-cta-bar {
  display: block;
  width: 100%;
  padding: 14px;
  background: none;
  border: none;
  color: #7ab8f5;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.subscribe-cta-bar:hover {
  color: #93c5fd;
}

/* Variant C: floating button */
.subscribe-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 28px;
  border: none;
  background: rgba(74, 144, 217, 0.9);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 900;
  transition: background 0.2s, transform 0.2s;
}

.subscribe-fab:hover {
  background: rgba(74, 144, 217, 1);
  transform: translateY(-2px);
}

/* Variant C: modal overlay */
.subscribe-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.subscribe-modal {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  position: relative;
  text-align: center;
}

.subscribe-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #666;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.subscribe-modal-close:hover {
  color: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .news-dashboard {
    padding: 16px;
  }

  .news-title h1 {
    font-size: 24px;
  }

  .news-title::after {
    content: '';
    position: absolute;
    right: 0;
    top: 44px;
    height: 34px;
    width: 40px;
    background: linear-gradient(to right, transparent, #1a1a2e);
    pointer-events: none;
    z-index: 1;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-headline {
    font-size: 22px;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .story-card {
    padding: 16px;
  }
}
