/* ============================================================
   current.css — Current Affairs page only
   Global component styles (.topic, .content, tables, boxes,
   .exam-badge, .ch-chip, etc.) are already in main.css.
   This file adds only the page-specific live-feed styles.
   ============================================================ */

/* ── Live update banner ── */
.update-banner {
  background: linear-gradient(135deg, var(--primary, #0d47a1) 0%, var(--secondary, #1565c0) 100%);
  color: #fff;
  border-radius: var(--radius-md, 10px);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.update-banner .pulse-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #69f0ae; flex-shrink: 0;
  animation: pulse 1.6s ease-in-out infinite;
}
.update-banner strong { color: #69f0ae; }

/* ── Feed tabs ── */
.feed-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.feed-tab {
  padding: 6px 16px; border-radius: 20px; font-size: 0.78rem; font-weight: 700;
  border: 2px solid var(--divider-light, #e0e8f5); cursor: pointer;
  background: var(--surface-alt, #f0f4fb); color: var(--content-primary, #1a3c6e);
  display: flex; align-items: center; gap: 6px;
  transition: all var(--dur-normal, 0.25s);
}
.feed-tab.active { background: var(--content-primary, #1a3c6e); color: #fff; border-color: var(--content-primary, #1a3c6e); }
.feed-tab:hover:not(.active) { background: var(--surface-hover, #dce8ff); }
.feed-source-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Feed panels ── */
.feed-panel { display: none; }
.feed-panel.active { display: block; }

/* ── News grid & cards ── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 10px 0 16px; }
.news-card {
  background: var(--bg, #fff);
  border: 1px solid var(--divider-light, #e0e8f5);
  border-radius: var(--radius-md, 10px);
  padding: 14px 16px;
  transition: box-shadow var(--dur-normal), transform var(--dur-normal);
  display: flex; flex-direction: column; gap: 8px;
}
.news-card:hover { box-shadow: 0 6px 20px rgba(74,144,226,0.18); transform: translateY(-2px); }
.news-card-title { font-size: 0.88rem; font-weight: 600; color: var(--content-primary, #1a3c6e); line-height: 1.45; }
.news-card-title a { color: inherit; text-decoration: none; }
.news-card-title a:hover { text-decoration: underline; color: var(--content-accent, #4a90e2); }
.news-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.74rem; color: #666; }
.news-card-desc { font-size: 0.81rem; color: var(--text-secondary, #444); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Category tags ── */
.cat-tag { display: inline-block; border-radius: 3px; padding: 1px 7px; font-size: 0.71rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; }
.cat-national { background: #e3f2fd; color: #0d47a1; }
.cat-intl     { background: #f3e5f5; color: #6a1b9a; }
.cat-economy  { background: #e8f5e9; color: #1b5e20; }
.cat-science  { background: #fff3e0; color: #e65100; }
.cat-sports   { background: #fce4ec; color: #880e4f; }
.cat-awards   { background: #fffde7; color: #f57f17; }
.cat-appoint  { background: #e0f2f1; color: #00695c; }
.cat-defence  { background: #fbe9e7; color: #bf360c; }
.cat-ranking  { background: #e8eaf6; color: #283593; }

/* ── Source / date metadata ── */
.source-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-alt, #f0f4fb); border-radius: 10px; padding: 2px 8px; font-size: 0.7rem; font-weight: 600; color: var(--content-primary, #1a3c6e); white-space: nowrap; }
.date-tag { font-size: 0.72rem; color: #888; }

/* ── Feed controls ── */
.feed-controls { display: flex; gap: 10px; align-items: center; margin: 8px 0 4px; flex-wrap: wrap; }
.btn-refresh { padding: 7px 18px; border-radius: var(--radius-sm, 6px); font-size: 0.82rem; font-weight: 600; cursor: pointer; border: none; background: var(--content-primary, #1a3c6e); color: #fff; transition: all var(--dur-normal); }
.btn-refresh:hover { background: var(--primary, #0d47a1); }
.feed-status { font-size: 0.78rem; color: #666; font-style: italic; }
.feed-empty { text-align: center; padding: 30px; color: #888; font-size: 0.9rem; grid-column: 1/-1; }

/* ── Search ── */
.feed-search-wrap { position: relative; margin-bottom: 12px; }
.feed-search {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--divider-light, #e0e8f5); font-size: 0.86rem;
  color: var(--content-primary, #1a3c6e); background: #f8faff; outline: none; box-sizing: border-box;
  transition: border-color var(--dur-normal), background var(--dur-normal);
}
.feed-search:focus { border-color: var(--content-accent, #4a90e2); background: var(--bg, #fff); }
.feed-search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--content-accent, #4a90e2); font-size: 0.9rem; pointer-events: none; }

/* ── Science sub-tabs ── */
.sci-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sci-subtab {
  padding: 4px 12px; border-radius: 14px; font-size: 0.74rem; font-weight: 700;
  border: 1.5px solid var(--divider-light, #e0e8f5); cursor: pointer;
  background: var(--surface-alt, #f0f4fb); color: var(--content-primary, #1a3c6e);
  transition: all var(--dur-normal);
}
.sci-subtab.active { background: #4a148c; color: #fff; border-color: #4a148c; }
.sci-subtab:hover:not(.active) { background: #ede7f6; }

/* ── Skeleton loading ── */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 10px 0; }
.skeleton-card { background: var(--surface-alt, #f0f4fb); border-radius: var(--radius-md, 10px); padding: 14px 16px; animation: shimmer 1.4s ease-in-out infinite alternate; }
.skeleton-line { height: 12px; background: var(--surface-hover, #dce8ff); border-radius: 4px; margin: 6px 0; }
.skeleton-line.short  { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* ── Animations ── */
@keyframes shimmer { 0% { opacity: 0.6; } 100% { opacity: 1; } }
@keyframes pulse   { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.6; } }

/* ── Dark mode ── */
[data-theme="dark"] .news-card { background: #1a1a2e; border-color: var(--divider-light); }
[data-theme="dark"] .news-card-title,
[data-theme="dark"] .news-card-title a { color: var(--content-primary); }
[data-theme="dark"] .news-card-title a:hover { color: var(--secondary); }
[data-theme="dark"] .news-card-meta { color: #aaaaaa; }
[data-theme="dark"] .news-card-desc { color: #bbbbbb; }
[data-theme="dark"] .date-tag { color: #888888; }
[data-theme="dark"] .feed-tab { background: #1a2a44; color: var(--content-primary); border-color: var(--divider-light); }
[data-theme="dark"] .feed-tab.active { background: #0d2137; color: #fff; border-color: var(--content-accent); }
[data-theme="dark"] .feed-tab:hover:not(.active) { background: var(--surface-hover); }
[data-theme="dark"] .feed-search { background: #1a1a2e; color: var(--text); border-color: var(--divider-light); }
[data-theme="dark"] .feed-search:focus { border-color: var(--content-accent); background: #0d1a2e; }
[data-theme="dark"] .feed-status { color: #aaaaaa; }
[data-theme="dark"] .source-badge { background: #1a2a44; color: var(--content-primary); }
[data-theme="dark"] .skeleton-card { background: #1a2a44; }
[data-theme="dark"] .skeleton-line { background: var(--divider-light); }
[data-theme="dark"] .cat-national { background: #0d1f33; color: var(--content-primary); }
[data-theme="dark"] .cat-intl     { background: #1e0a2a; color: #ce93d8; }
[data-theme="dark"] .cat-economy  { background: #0d2a13; color: #a5d6a7; }
[data-theme="dark"] .cat-science  { background: #2a1800; color: #ffcc80; }
[data-theme="dark"] .cat-sports   { background: #2a0d1a; color: #f48fb1; }
[data-theme="dark"] .cat-awards   { background: #2a2200; color: #ffe082; }
[data-theme="dark"] .cat-appoint  { background: #002a25; color: #80cbc4; }
[data-theme="dark"] .cat-defence  { background: #2a1000; color: #ffab91; }
[data-theme="dark"] .cat-ranking  { background: #0d1133; color: #9fa8da; }
[data-theme="dark"] .sci-subtab { background: #1a2a44; color: var(--content-primary); border-color: var(--divider-light); }
[data-theme="dark"] .sci-subtab.active { background: #4a148c; color: #fff; border-color: #4a148c; }
[data-theme="dark"] .sci-subtab:hover:not(.active) { background: #1e0a2a; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
  .feed-tabs { gap: 5px; }
  .sci-subtabs { gap: 4px; }
}
