/* Pixels.li - Modern CSS Styles */

/* Tooltip Styles */
.tooltip {
  position: fixed;
  background-color: #1e293b;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  word-wrap: break-word;
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
}

.tooltip-arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1e293b;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
}

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --background-color: #f8fafc;
  --card-background: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --border-radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  overflow-x: hidden;
  word-wrap: break-word;
  box-sizing: border-box;
}

.header {
  background: var(--card-background);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
  background-color: var(--background-color);
}

.main {
  padding: 2rem 0;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* Cards */
.card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--background-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-body {
  padding: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #059669;
}

.btn-warning {
  background-color: var(--warning-color);
  color: white;
}

.btn-warning:hover {
  background-color: #d97706;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  margin: 1rem 0;
}

/* Article Content Containers - Prevent Overflow */
.article-content-row td,
.compact-article-content-row {
  max-width: 0;
  overflow: hidden;
}

.article-full-content,
.ai-rewrite-container,
.rewritten-edit-container {
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.article-full-content * {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Ensure tables within articles don't overflow */
.article-full-content table,
.prose table {
  width: 100%;
  table-layout: fixed;
  word-wrap: break-word;
}

.article-full-content td,
.article-full-content th,
.prose td,
.prose th {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 0;
}

/* Apply 50/50 split only when AI panel is visible (has class 'ai-panel-open') */
.ai-rewrite-container.ai-panel-open .original-content,
.rewritten-edit-container.edit-panel-open .rewritten-content-preview {
  flex: 0 0 calc(50% - 10px);
  width: calc(50% - 10px);
  max-width: calc(50% - 10px);
}

/* Ensure content within AI panels respects boundaries when panels are open */
.ai-rewrite-container.ai-panel-open .original-content .article-full-content,
.rewritten-edit-container.edit-panel-open .rewritten-content-preview .article-full-content {
  max-width: 100%;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.ai-rewrite-container.ai-panel-open .original-content .article-full-content *,
.rewritten-edit-container.edit-panel-open .rewritten-content-preview .article-full-content * {
  max-width: 100% !important;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

.ai-rewrite-panel *,
.rewritten-edit-panel * {
  max-width: 100% !important;
  box-sizing: border-box;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background-color: var(--background-color);
  font-weight: 600;
  color: var(--text-primary);
}

.table tbody tr:hover {
  background-color: var(--background-color);
}

/* Article Cards */
.article-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.article-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.article-thumbnail {
  width: 200px;
  height: 150px;
  object-fit: cover;
  background-color: var(--background-color);
  flex-shrink: 0;
}

.article-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.article-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.article-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.article-title a:hover {
  color: var(--primary-color);
}

.article-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.article-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Article List/Table View */
.article-read {
  background-color: var(--background-color);
  opacity: 0.8;
}

.article-unread {
  background-color: var(--card-background);
}

/* Active article row highlighting */
.table tbody tr.active {
  background-color: #e0f2fe !important;
  border-left: 4px solid var(--primary-color);
}

.table thead tr.active th {
  background-color: #e0f2fe;
  color: var(--primary-color);
  font-weight: 700;
}

.article-title-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.article-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.3;
}

.article-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.article-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.article-excerpt-small {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
}

.status-badges {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.date-cell {
  font-size: 0.875rem;
}

.action-buttons {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.action-buttons .btn {
  min-width: 32px;
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.action-buttons .btn:hover {
  background-color: var(--background-color);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Filters */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

/* Loading spinner */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border-color);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav {
    width: 100%;
    justify-content: center;
  }
  
  .article-card {
    flex-direction: column;
  }
  
  .article-thumbnail {
    width: 100%;
    height: 200px;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group {
    justify-content: space-between;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
}

/* Scraper Status */
.scraper-status {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-left: 4px solid var(--primary-color);
}

.scraper-running {
  border-left-color: var(--warning-color);
  background: linear-gradient(135deg, #fef3c7, #fed7aa);
}

.scraper-success {
  border-left-color: var(--success-color);
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.scraper-error {
  border-left-color: var(--danger-color);
  background: linear-gradient(135deg, #fee2e2, #fecaca);
}

/* Button states */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:disabled:hover {
  background-color: inherit;
  transform: none;
}

/* Status text */
.text-sm {
  font-size: 0.875rem;
}

.text-secondary {
  color: var(--text-secondary);
}

/* Prose/Markdown Content Styling */
.prose {
  padding: 1.5rem;
  color: var(--text-primary);
  line-height: 1.7;
  max-width: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.prose p {
  margin-bottom: 1rem;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  line-height: 1.25;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.prose h1 {
  font-size: 1.875rem;
}

.prose h2 {
  font-size: 1.5rem;
}

.prose h3 {
  font-size: 1.25rem;
}

.prose h4 {
  font-size: 1.125rem;
}

.prose ul, .prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
  padding-left: 0;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose a {
  color: var(--primary-color);
  text-decoration: underline;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.prose a:hover {
  color: var(--primary-hover);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 1rem 0;
}

.prose blockquote {
  border-left: 4px solid var(--border-color);
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.prose code {
  background-color: var(--background-color);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-size: 0.875rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.prose pre {
  background-color: var(--background-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin: 1rem 0;
  max-width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.prose table th,
.prose table td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: left;
}

.prose table th {
  background-color: var(--background-color);
  font-weight: 600;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

/* Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Button group */
.btn-group {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.btn-group .btn {
  border-radius: 4px;
  font-size: 0.75rem;
  padding: 0.375rem 0.5rem;
}

/* Responsive table */
@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.75rem;
  }
  
  .article-title-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .article-thumb {
    width: 30px;
    height: 30px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .action-buttons .btn {
    min-width: 28px;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
  }
  
  .status-badges {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1050;
}

.toast {
  background-color: #333;
  color: #fff;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.3s;
}

.toast.show {
  opacity: 1;
}

.toast-success {
  background-color: #28a745;
  border-left: 4px solid #1e7e34;
}

.toast-error {
  background-color: #dc3545;
  border-left: 4px solid #c82333;
}

.toast-info {
  background-color: #333;
  border-left: 4px solid #555;
}

/* AI Rewrite Components */
.ai-rewrite-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  box-sizing: border-box;
}

.original-content {
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.ai-rewrite-panel {
  flex: 0 0 calc(50% - 10px);
  width: calc(50% - 10px);
  max-width: calc(50% - 10px);
  border-left: 2px solid #e9ecef;
  padding-left: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.ai-rewrite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.ai-form-group {
  margin-bottom: 15px;
}

.ai-form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 13px;
}

.ai-form-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
}

.ai-form-textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  min-height: 150px;
  resize: vertical;
}

.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  font-style: italic;
  justify-content: center;
  padding: 40px;
}

.ai-loading.hidden {
  display: none !important;
}

.ai-buttons {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.tab-button {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  font-weight: 500;
  color: #666;
  transition: all 0.3s ease;
}

.tab-button:hover {
  color: #333;
  background-color: #f8f9fa;
}

.tab-button.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Article page specific styles */
.article-title-large {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.article-subtitle-large {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 2rem;
}

.article-header {
  margin-bottom: 3rem;
}

.article-badges {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.article-body {
  max-width: none;
}

.article-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

/* Inline style replacements */
.page-title-centered {
  margin-bottom: 25px;
  text-align: center;
}

.form-select-auto {
  width: auto;
}

.scraper-output-container {
  margin-top: 4px;
}

.scraper-output-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.scraper-output-text {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  font-size: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.article-title-cell-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-thumb-large {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.article-thumb-placeholder {
  width: 60px;
  height: 60px;
  background: #f0f0f0;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
}

.article-title-content {
  flex: 1;
  min-width: 0;
}

.article-link-main {
  font-weight: 500;
  color: #333;
  text-decoration: none;
  display: block;
  line-height: 1.4;
}

.article-excerpt-main {
  color: #666;
  font-size: 0.9em;
  margin-top: 4px;
  line-height: 1.3;
}

.original-content-header {
  margin: 0 0 15px 0;
  color: #333;
}

.article-full-content-scrollable {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.error-state-container {
  margin: 4rem 0;
}

.error-state-title {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.error-state-text {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.article-image-container {
  margin-bottom: 3rem;
}

.article-image-main {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.article-footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-main {
  background: var(--card-background);
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  padding: 2rem 0;
}

.footer-content {
  text-align: center;
  color: var(--text-secondary);
}

.footer-links {
  margin-top: 0.5rem;
}

/* Rewritten Article Edit Form */
.rewritten-edit-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  width: 100%;
  box-sizing: border-box;
}

.rewritten-content-preview {
  flex: 1;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.rewritten-edit-panel {
  flex: 0 0 calc(50% - 10px);
  width: calc(50% - 10px);
  max-width: calc(50% - 10px);
  border-left: 2px solid #e9ecef;
  padding-left: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.rewritten-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.rewritten-edit-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.rewritten-edit-buttons {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.rewritten-edit-buttons .btn {
  flex: 1;
}

/* Articles Header and View Toggle */
.articles-container-wrapper {
  position: relative;
}

.articles-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

/* Compact Articles View */
.compact-articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.compact-article-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.compact-article-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.compact-article-row.active {
  border-left-color: var(--primary-color);
  background-color: #e0f2fe;
}

.compact-article-row.article-read {
  background-color: var(--background-color);
  opacity: 0.8;
}

.compact-article-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.compact-favicon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 3px;
}

.compact-article-title {
  flex: 1;
  min-width: 0;
}

.compact-article-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.3;
  display: block;
}

.compact-article-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.compact-article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.compact-site-name {
  background-color: var(--background-color);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  color: var(--primary-color);
}

.compact-date {
  white-space: nowrap;
}

.compact-favorite {
  color: var(--warning-color);
  font-weight: bold;
}

.compact-action-buttons {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  margin-left: 1rem;
}

.compact-action-buttons .btn {
  min-width: 28px;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}

.compact-article-content-row {
  margin-top: 0.5rem;
  padding: 1.5rem;
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
}

/* Responsive compact view */
@media (max-width: 768px) {
  .compact-article-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .compact-article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .compact-action-buttons {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}

/* Config Modal Styles */
.config-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.config-modal-content {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-xl);
  max-width: 90vw;
  max-height: 90vh;
  width: 800px;
  display: flex;
  flex-direction: column;
}

.config-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.config-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.config-modal-body {
  padding: 1.5rem;
  overflow: auto;
  flex: 1;
}

.config-text {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-x: auto;
  margin: 0;
}

/* Sources Tab Styles */
.source-name-cell {
  display: flex;
  flex-direction: column;
}

.source-name {
  font-weight: 600;
  color: var(--text-primary);
}

.source-yaml {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.article-count {
  text-align: center;
}

.article-count strong {
  color: var(--primary-color);
}