:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #0f172a;
  background-color: #f8fafc;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 1rem;
  backdrop-filter: blur(10px);
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.fetch-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-1);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.fetch-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.fetch-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.fetch-button:hover:not(:disabled) .btn-icon {
  transform: rotate(180deg);
}

.fetch-button.secondary {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.fetch-button.secondary:hover:not(:disabled) {
  background: #eff6ff;
  transform: translateY(-2px);
}

.last-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1.5rem 0 0 0;
  font-style: italic;
}

/* Curation Status Badges */
.curation-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 0.5rem;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.curation-badge.kept {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.curation-badge.removed {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.curation-badge.pending {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.news-row.client-removed {
  opacity: 0.4;
  filter: grayscale(0.8);
}

.dual-feed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.progress-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.progress-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.progress-icon {
  font-size: 1.5rem;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.progress-step .step-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.progress-step.active {
  color: #60a5fa;
  /* Brighter blue for contrast */
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.5rem;
}

.progress-step.completed {
  color: #34d399;
  /* Brighter green */
  font-weight: 600;
}

.progress-step.error {
  color: #f87171;
  /* Brighter red */
  font-weight: 700;
}

@media (max-width: 1200px) {
  .dual-feed {
    grid-template-columns: 1fr;
  }
}

/* New Table Layout */
.feed-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

.feed-header {
  display: grid;
  grid-template-columns: 1fr;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 1rem;
  font-weight: 700;
  color: #0f172a;
  /* High contrast dark color */
}

.news-row {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid #e2e8f0;
  min-height: 200px;
  transition: background-color 0.2s ease;
}

.news-row:hover {
  background-color: #f8fafc;
}

.news-row:last-child {
  border-bottom: none;
}

.col-original {
  padding: 1.5rem;
  border-right: none;
  background: #fff;
}

.col-rewritten {
  display: none;
}

/* Sensitivity Warning */
.sensitivity-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sensitivity-warning.political {
  border-left: 4px solid #ef4444;
}

.sensitivity-warning.religious {
  border-left: 44px solid #8b5cf6;
}

/* Tabs System */
.tab-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.5rem;
}

.tab-btn {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  color: #64748b;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #3b82f6;
  color: white;
}

.tab-btn:hover:not(.active) {
  background: #f1f5f9;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Consolidated layout into the section above */

/* Typography & Content */
.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.news-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.news-title a:hover {
  color: var(--primary);
}

.news-description,
.summary-content,
.summary-en p,
.summary-ko p {
  color: #334155;
  line-height: 1.6;
  font-size: 0.95rem;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

/* Status Badges */
.source-badge {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

/* Scraper Viewer */
.scraper-viewer {
  width: 100%;
  height: 400px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.scraper-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
}

/* PDF Export / Print Styles */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 10pt;
  }

  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .header-actions,
  .fetch-button,
  .progress-container,
  #export-pdf-btn,
  #ai-filter-toggle,
  .last-updated,
  .scraper-viewer,
  .scraper-overlay {
    display: none !important;
  }

  header {
    background: none !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
    border-bottom: 2px solid #eee !important;
    backdrop-filter: none !important;
  }

  h1 {
    -webkit-text-fill-color: black !important;
    color: black !important;
    font-size: 24pt !important;
    background: none !important;
  }

  .feed-container {
    box-shadow: none !important;
    border: none !important;
  }

  .news-row {
    break-inside: avoid !important;
    border-bottom: 2px solid #eee !important;
    margin-bottom: 2rem !important;
    min-height: auto !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }

  /* Force both summaries to show in print */
  .tab-container {
    display: none !important;
  }

  .tab-content {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .summary-ko {
    margin-top: 1.5rem !important;
    padding-top: 1.5rem !important;
    border-top: 1px dashed #ccc !important;
  }

  .summary-ko::before {
    content: "한국어 요약 (Korean Summary):" !important;
    font-weight: 700 !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.1rem !important;
    color: #000 !important;
  }

  .summary-en::before {
    content: "English Summary:" !important;
    font-weight: 700 !important;
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.1rem !important;
    color: #000 !important;
  }

  .col-original,
  .col-rewritten {
    background: white !important;
    padding: 1rem !important;
    filter: none !important;
    opacity: 1 !important;
    border: none !important;
  }

  .ai-badge {
    border: 1px solid #333 !important;
    color: black !important;
    background: #f0f0f0 !important;
    padding: 0.2rem 0.5rem !important;
  }

  .rejection-reason {
    background: #fdfdfd !important;
    border: 1px solid #ccc !important;
    color: #444 !important;
    box-shadow: none !important;
  }
}
/* Loading Components */
.loading {
  padding: 5rem 2rem;
  text-align: center;
  color: #64748b;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  background: white;
  min-height: 400px;
}

.loading .subtitle {
  font-size: 0.95rem;
  font-weight: 400;
  color: #94a3b8;
  max-width: 400px;
  line-height: 1.5;
}

/* Source Selector */
.source-selector {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: color 0.2s;
}

.source-item:hover {
  color: var(--primary);
}

.source-item input[type='checkbox'] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
