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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-hover: #1a1a25;
  --border: #1e1e2e;
  --text: #e0e0e8;
  --text-muted: #6b6b80;
  --accent: #7c5cfc;
  --accent-soft: #7c5cfc22;
  --ai: #7c5cfc;
  --games: #22c55e;
  --anime: #f43f5e;
  --tech: #3b82f6;
  --youtube: #ff0000;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

header .accent {
  color: var(--accent);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Navigation */
.digest-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.current-date {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 160px;
  text-align: center;
}

/* Greeting */
.greeting {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: none;
}

.greeting.visible {
  display: block;
}

/* Filters */
.filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Section titles */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* News Feed */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* News Card */
.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
  position: relative;
}

.news-card:hover {
  border-color: var(--border);
  background: var(--surface-hover);
}

.news-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  z-index: 1;
}

.news-card[data-category="ai"]::before { background: var(--ai); }
.news-card[data-category="games"]::before { background: var(--games); }
.news-card[data-category="anime"]::before { background: var(--anime); }
.news-card[data-category="tech"]::before { background: var(--tech); }

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  text-decoration: underline;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-badge[data-category="ai"] {
  background: #7c5cfc18;
  color: var(--ai);
}

.card-badge[data-category="games"] {
  background: #22c55e18;
  color: var(--games);
}

.card-badge[data-category="anime"] {
  background: #f43f5e18;
  color: var(--anime);
}

.card-badge[data-category="tech"] {
  background: #3b82f618;
  color: var(--tech);
}

.card-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.card-source {
  color: var(--text-muted);
}

.card-date {
  color: var(--text-muted);
  font-style: italic;
}

.card-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

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

.card-youtube-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--youtube);
  text-decoration: none;
  font-weight: 500;
}

.card-youtube-link:hover {
  text-decoration: underline;
}

/* Embedded YouTube */
.card-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}

.card-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Recommended Videos Section */
.videos-section {
  margin-top: 2.5rem;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}

.video-card:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.video-card .card-video {
  border-bottom: 1px solid var(--border);
}

.video-card .card-body {
  padding: 1rem 1.25rem;
}

.video-card .card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.video-card .card-title a {
  color: var(--text);
}

.video-channel {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.video-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.empty-state code {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--accent);
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .filters {
    gap: 0.35rem;
  }

  .filter-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }

  .card-image {
    height: 160px;
  }
}
