/* ── Header ──────────────────────────────────────────────────────────────── */
.header-section { text-align: center; margin-bottom: 40px; color: white; }
.header-section h1 { font-size: 2.4rem; margin-bottom: 8px; letter-spacing: -0.5px; }
.tagline { font-size: 1.1rem; color: #94a3b8; margin: 0 0 8px; }
.header-sub { font-size: 0.95rem; color: #64748b; max-width: 680px; margin: 0 auto 14px; line-height: 1.6; }
.header-notice { font-size: 0.82rem; color: #475569; max-width: 680px; margin: 0 auto; line-height: 1.5; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */
.toolbar {
  background: var(--card);
  padding: 18px 20px;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3);
  flex-wrap: wrap;
}
input, select {
  background: #1e293b;
  border: 1px solid #475569;
  color: white;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 14px;
  flex: 1;
  min-width: 150px;
}
input:focus, select:focus { outline: none; border-color: #3b82f6; }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

/* ── Loading / meta text ─────────────────────────────────────────────────── */
.meta { font-size: 0.83rem; color: #94a3b8; }
.load-msg { padding: 40px; text-align: center; color: #64748b; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid #334155;
}
.card:hover {
  transform: translateY(-7px);
  border-color: #3b82f6;
  box-shadow: 0 20px 30px -8px rgba(0,0,0,0.45);
}
.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 3px solid #3b82f6;
  background: #1e293b;
  display: block;
}
.card-info { padding: 16px 18px 18px; }
.card-info h3 { margin: 0 0 5px; font-size: 1.1rem; color: var(--accent); }
.claim-badge {
  display: inline-block;
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.28);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  margin: 6px 0 4px;
  font-weight: 600;
}
.timestamp-meta { margin-top: 5px; font-size: 11px; color: #475569; }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}
.empty-state p { font-size: 1rem; margin: 0 0 16px; }
.clear-filters-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}
.clear-filters-btn:hover { background: #2563eb; }

/* ── Modal Shell ─────────────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 1003;
  padding: 20px;
}
.modal-content {
  background: #0f172a;
  width: 100%;
  max-width: 820px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  border: 1px solid #334155;
  animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 13px; right: 13px;
  background: rgba(0,0,0,0.65);
  color: white;
  border: 2px solid #475569;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1010;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.modal-close:hover { background: #ef4444; border-color: #ef4444; }

.modal-body { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 460px; }

/* ── Carousel ────────────────────────────────────────────────────────────── */
.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 300px;
}
.modal-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.prev-img, .next-img {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: 1px solid rgba(255,255,255,0.22);
  padding: 13px 10px;
  cursor: pointer;
  font-size: 20px;
  z-index: 1005;
  transition: background 0.2s;
  user-select: none;
  line-height: 1;
}
.prev-img:hover, .next-img:hover { background: rgba(0,0,0,0.9); }
.prev-img { left: 0;  border-radius: 0 6px 6px 0; }
.next-img { right: 0; border-radius: 6px 0 0 6px; }

.img-counter {
  position: absolute;
  bottom: 10px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 0.8px;
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
}

/* ── Modal Text ──────────────────────────────────────────────────────────── */
.modal-text { padding: 26px 24px; overflow-y: auto; max-height: 520px; color: #e2e8f0; }

/* ── Claim vs Truth ──────────────────────────────────────────────────────── */
.claim-truth-container {
  margin-top: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #334155;
}
.flip-tabs { display: flex; }
.flip-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  background: #1e293b;
  color: #64748b;
  transition: background 0.18s, color 0.18s;
}
.flip-tab:hover:not(.active) { background: #334155; color: #e2e8f0; }
#claimTab.active { background: #7f1d1d; color: #fca5a5; }
#truthTab.active { background: #14532d; color: #86efac; }

.claim-panel {
  background: rgba(127,29,29,0.14);
  padding: 13px 15px;
  border-top: 1px solid #7f1d1d;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #fca5a5;
}
.truth-panel {
  background: rgba(20,83,45,0.14);
  padding: 13px 15px;
  border-top: 1px solid #14532d;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #86efac;
}
.claim-panel p, .truth-panel p { margin: 0 0 8px; }
.claim-panel p:last-child, .truth-panel p:last-child { margin-bottom: 0; }

/* ── Sources ─────────────────────────────────────────────────────────────── */
.sources-section { margin-top: 11px; padding-top: 11px; border-top: 1px solid #334155; }
.sources-label {
  display: block;
  margin-bottom: 6px;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.source-link {
  display: inline-block;
  background: #1e293b;
  color: #60a5fa;
  text-decoration: none;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
  border: 1px solid #334155;
  transition: background 0.18s;
}
.source-link:hover { background: #334155; color: #93c5fd; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-content { max-width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 14px; }
  .carousel-container { height: 250px; min-height: 200px; }
  .toolbar { flex-direction: column; gap: 10px; }
  .header-section h1 { font-size: 1.9rem; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .modal-text { padding: 18px 16px; }
}
