:root {
  /* Primary colors */
  --primary-color: #626ee3;
  --secondary-color: #4f57bd;
  --accent-color: #b02cce; /* Logo color remains unchanged */

  /* Background colors */
  --bg-color: #f8f9fc;
  --bg-lighter: #ffffff;
  --bg-darker: #eef1f8;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;

  /* Text colors */
  --text-color: #2d3748;
  --text-muted: #718096;

  /* Status colors */
  --success-color: #48bb78;
  --warning-color: #f6ad55;
  --error-color: #e53e3e;
  --pending-color: #a0aec0;

  /* Additional colors */
  --link-color: #4c6ef5;
  --hover-color: #7950f2;
  --modal-overlay: rgba(0, 0, 0, 0.4);

  /* Logo-derived colors */
  --logo-color: var(--accent-color);
  --gradientstart-color: var(--accent-color);
  --gradientend-color: #9333ea;

  /* Utils */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --transition-normal: all 0.2s ease-in-out;
}

/* Dark mode theme variables */
body.dark-mode {
  /* Background colors */
  --bg-color: #1a202c;
  --bg-lighter: #2d3748;
  --bg-darker: #171923;
  --card-bg: #2d3748;
  --border-color: #4a5568;

  /* Text colors */
  --text-color: #e2e8f0;
  --text-muted: #a0aec0;

  /* Status colors - slightly brightened for dark background */
  --success-color: #68d391;
  --warning-color: #fbd38d;
  --error-color: #fc8181;
  --pending-color: #cbd5e0;

  /* Additional adjustments */
  --link-color: #90cdf4;
  --hover-color: #b794f4;
  --modal-overlay: rgba(0, 0, 0, 0.7);

  /* Shadow adjustments for dark mode */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5),
    0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* Transition for smooth theme switching */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-weight: 600;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: var(--transition-normal);
}

a:hover {
  color: var(--accent-color);
  text-decoration: none !important;
}

button,
.button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

button:hover,
.button:hover {
  background-color: var(--secondary-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

button:disabled,
.button:disabled {
  background-color: var(--bg-darker);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

.disabled-btn {
  opacity: 0.7;
  cursor: not-allowed !important;
}

input,
select {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background-color: var(--bg-lighter);
  color: var(--text-color);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.loading {
  color: var(--text-muted);
  font-style: italic;
  padding: 1rem;
  text-align: center;
}

/* Header styles */
header {
  background-color: var(--bg-lighter);
  color: var(--text-color);
  padding: 1rem 0 0;
  border-bottom: 1px solid var(--border-color);
  height: auto;
  min-height: 120px;
  box-shadow: var(--shadow-sm);
}

/* Header flex container */
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0.75rem;
}

/* Server status display */
.server-status {
  color: var(--text-muted);
  font-size: 0.75rem;
  background-color: var(--bg-lighter);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  width: 100%;
  min-height: 18px;
  height: auto;
  text-align: left;
  animation: fade-in 0.3s ease-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

/* Spinner styles */
.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.75s linear infinite;
  margin-left: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Show spinner when processing is active */
.server-status.processing .spinner {
  display: inline-block;
  opacity: 1;
}

/* Header spinner styles */
.header-status .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary-color);
  border-top-color: rgba(99, 102, 241, 0.2);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header status specifically */
.header-status {
  margin-bottom: 0;
  background-color: var(--bg-lighter);
  border-radius: var(--radius-md);
}

.server-status .status-main {
  font-weight: 500;
  font-size: 0.75rem;
  height: 18px;
  line-height: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.server-status .status-main i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  margin-top: -2px;
}

/* Status colors and variants */
.server-status.processing {
  border-left-color: var(--primary-color);
}

.server-status.processing .status-main {
  color: var(--primary-color);
}

.server-status.success {
  border-left-color: var(--success-color);
}

.server-status.success .status-main {
  color: var(--success-color);
}

.server-status.error {
  border-left-color: var(--error-color);
}

.server-status.error .status-main {
  color: var(--error-color);
}

.server-status.reconnected {
  border-left-color: var(--success-color);
}

.server-status.reconnected .status-main {
  color: var(--success-color);
  font-weight: bold;
}

@keyframes fade-in {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

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

/* Title heading */
.title-heading {
  color: var(--text-color);
  margin-bottom: 0px;
  display: flex;
  align-items: center;
  margin: 0;
}

.title-heading a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Logo text and subtitle */
.logo-text {
  color: var(--logo-color);
  margin-left: 5px;
  font-weight: bold;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
  color: var(--text-color);
  text-decoration: none;
}

.subtitle:hover {
  text-decoration: underline;
  color: var(--text-color);
}

.subtitle .text-accent {
  color: var(--accent-color);
}

/* Logo image */
.logo-image {
  height: 0.85em;
  margin-right: 0;
  vertical-align: middle;
  position: relative;
  top: 0;
  display: inline-block;
}

/* Navigation styles */
nav {
  position: relative;
  padding: 0.5rem 0;
  padding-bottom: 0;
  margin-top: 20px;
  margin-bottom: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem;
}

nav .nav-left {
  display: flex;
  gap: 1.5rem;
  margin-right: auto;
}

nav .nav-right {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0 0;
  border-bottom: 3px solid transparent;
  transition: var(--transition-normal);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav a:hover,
nav a.active {
  color: var(--accent-color);
  text-decoration: none !important;
  border-bottom: 3px solid var(--accent-color);
  margin-bottom: -1px;
}

/* Main Content */
main {
  padding: 2rem 0;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* Dashboard */
.dashboard {
  margin-bottom: 2rem;
}

/* Section titles */
h2,
.column h3 {
  position: relative;
  display: inline-block;
  padding-bottom: 0.15rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
}

h2:after,
.column h3:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 40px;
  background: var(--accent-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background-color: var(--bg-lighter);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
}

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

.stat-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-weight: 600;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-grid,
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .dashboard-grid,
  .two-columns {
    grid-template-columns: 1fr;
  }
}

.column {
  background-color: var(--bg-lighter);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
}

/* Cards */
.card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

/* Scraping options */
.scrape-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 1200px) {
  .scrape-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .scrape-options {
    grid-template-columns: 1fr;
  }
}

.scrape-option {
  background-color: var(--bg-lighter);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-normal);
}

.scrape-option:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.form-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  align-items: center;
}

.form-group input {
  flex: 1;
  max-width: calc(100% - 60px);
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.button-group {
  margin-top: auto;
}

.scrape-option .button-group.center-buttons {
  justify-content: center;
}

.center-buttons {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Tables */
.jobs-table-container,
.articles-table-container,
.performance-table-container {
  overflow-x: auto;
}

.articles-table-container,
.keywords-table-container {
  background-color: var(--bg-lighter);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background-color: var(--bg-darker);
  font-weight: 600;
  color: var(--text-color);
}

.articles-table tr:hover td,
.keywords-table tr:hover td {
  background-color: var(--bg-darker);
}

/* Url icon style for article links */
.article-url-icon {
  color: var(--primary-color);
  margin-right: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.article-url-icon:hover {
  color: var(--accent-color);
}

.table-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: var(--transition-normal);
}

th.sortable:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

/* Sort indicator */
.sort-indicator {
  display: inline-block;
  margin-left: 4px;
  color: var(--primary-color);
  font-weight: bold;
}

/* Status labels */
.status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.status-pending {
  background-color: var(--bg-darker);
  color: var(--text-muted);
}

.status-processing {
  background-color: rgba(246, 173, 85, 0.2);
  color: var(--warning-color);
}

.status-completed {
  background-color: rgba(72, 187, 120, 0.2);
  color: var(--success-color);
}

.status-failed {
  background-color: rgba(229, 62, 62, 0.2);
  color: var(--error-color);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.5rem;
}

.page-numbers {
  display: flex;
  gap: 0.5rem;
  margin: 0 1rem;
}

.page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  background-color: var(--bg-darker);
}

.page-number:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

.page-number.active {
  background-color: var(--primary-color);
  color: white;
}

/* Filters */
.filters-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  align-items: center;
}

.search-box {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  flex: 1;
  max-width: 600px;
}

.search-box input {
  flex: 1;
  min-width: 180px;
}

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

.filters-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Keyword List */
.keyword-list,
.article-list {
  max-height: 400px;
  overflow-y: auto;
}

.keyword-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.keyword-item:last-child {
  border-bottom: none;
}

.keyword-text {
  font-weight: 500;
}

.keyword-score {
  display: flex;
  align-items: center;
}

.score-bar {
  width: 100px;
  height: 8px;
  background-color: var(--bg-darker);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-right: 0.5rem;
}

.score-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: var(--radius-sm);
}

/* Article List */
.article-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
  border-bottom: none;
}

.article-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

/* Trending Keywords */
.trending-keywords {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

/* Recent Jobs */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

#trending-page h2.section-title {
  margin-top: 2rem;
}

.trend-card {
  background-color: var(--bg-lighter);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

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

.trend-keyword {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.trend-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.trend-stat {
  display: flex;
  justify-content: space-between;
}

/* Keyword Results */
.keyword-results {
  margin-top: 1.5rem;
}

.keyword-results.hidden {
  display: none;
}

.keyword-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.keyword-header h4 {
  font-size: 1.5rem;
  margin-bottom: 0;
  color: var(--primary-color);
}

.chart-container {
  position: relative;
  height: 500px !important;
  max-height: 500px !important;
  width: 100%;
  margin: 20px 0;
  background-color: var(--bg-lighter);
  border-radius: var (--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.modal.show {
  opacity: 1;
}

.modal-content {
  background-color: var(--bg-lighter);
  margin: 5vh auto;
  padding: 0;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

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

.modal-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(90vh - 120px);
}

.close {
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  margin: -0.5rem;
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
}

.close:hover {
  color: var(--text-color);
  background-color: var(--bg-darker);
}

/* Job Detail Modal specific styles */
.job-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .job-detail-grid {
    grid-template-columns: 1fr;
  }
}

.info-group {
  background-color: var(--bg-darker);
  border-radius: var (--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.info-group h4 {
  color: var(--text-color);
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-group h4 i {
  color: var(--primary-color);
}

.info-content {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
}

.info-value {
  color: var(--text-color);
  font-weight: 500;
}

/* Progress bar styles */
.progress-container {
  margin: 1rem 0;
  background-color: var(--bg-darker);
  border-radius: var(--radius-sm);
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

/* Status badge styles */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-badge i {
  font-size: 0.8rem;
}

.status-badge.processing {
  background-color: rgba(246, 173, 85, 0.2);
  color: var (--warning-color);
}

.status-badge.completed {
  background-color: rgba(72, 187, 120, 0.2);
  color: var(--success-color);
}

.status-badge.failed {
  background-color: rgba(229, 62, 62, 0.2);
  color: var(--error-color);
}

/* Timing information styles */
.timing-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.timing-block {
  background-color: var(--bg-darker);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.timing-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.timing-value {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Results section styles */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.result-item {
  background-color: var(--bg-darker);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.result-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Utility Classes */
.text-primary {
  color: var(--primary-color);
}

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

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

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

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

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

.hidden {
  display: none !important;
}

/* Charts */
.simple-chart {
  display: flex;
  height: 250px;
  align-items: flex-end;
  justify-content: space-around;
  padding-top: 20px;
  gap: 6px;
}

.chart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  width: 40px;
  padding: 0 2px;
}

.chart-bar-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: 100%;
  background-color: var(--primary-color);
  border-radius: 4px 4px 0 0;
  position: relative;
  text-align: center;
  min-height: 20px;
}

.chart-value {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  font-size: 12px;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.chart-label {
  margin-top: 8px;
  font-size: 11px;
  text-align: center;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  white-space: nowrap;
  color: var(--text-muted);
}

.chart-legend {
  margin-top: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 2px;
}

.truncate {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.full-width {
  width: 100%;
  margin-bottom: 0.5rem;
}

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

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

.secondary-btn {
  background-color: var(--bg-darker);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition-normal);
  border-radius: var(--radius-md);
}

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

/* Logo accent button */
.logo-btn {
  background-color: var(--logo-color);
  color: white;
}

.logo-btn:hover {
  background-color: #9333ea;
}

/* Notification styling */
.notification {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.notification.success {
  background-color: rgba(72, 187, 120, 0.1);
  color: var(--success-color);
  border-left: 3px solid var(--success-color);
}

.notification.error {
  background-color: rgba(229, 62, 62, 0.1);
  color: var(--error-color);
  border-left: 3px solid var(--error-color);
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 auto;
}

.status-indicator-success {
  background-color: var(--success-color);
}

.status-indicator-error {
  background-color: var(--error-color);
}

/* Center content */
.center-content {
  text-align: center;
}

/* Articles table specific styling */
.articles-table {
  font-size: 0.85rem;
}

.articles-table th {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: left;
}

.articles-table td {
  padding: 0.5rem 0.75rem;
}

.articles-table .button,
.keywords-table .button {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Keywords table specific styling */
.keywords-table {
  font-size: 0.85rem;
}

.keywords-table th {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
  text-align: left;
}

.keywords-table td {
  padding: 0.5rem 0.75rem;
}

/* Table content center alignment */
.keywords-table td:nth-child(2),
.keywords-table td:nth-child(3),
.keywords-table td:nth-child(4),
.keywords-table td:nth-child(5) {
  text-align: center;
}

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

footer .heart {
  color: var(--accent-color);
  display: inline-block;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Consistent styling for content boxes */
.content-box,
.scrape-option,
.column,
.stat-card,
.chart-container,
.articles-table-container,
.keywords-table-container,
.trending-keywords {
  background-color: var(--bg-lighter);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

/* Ensure last content-box doesn't have bottom margin */
.content-box:last-child {
  margin-bottom: 0;
}

/* Spacing for data collection section */
.data-collection-section {
  margin-bottom: 2.5rem;
}

/* Spacing for jobs section header */
.jobs-section-header {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

/* Jobs grid */
.jobs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .jobs-grid {
    grid-template-columns: 1fr;
  }
}

/* Consistent height for scrape options */
.scrape-option {
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

/* Position buttons at the bottom */
.scrape-option .button-group {
  margin-top: auto;
}

/* Empty state messages */
.empty-state {
  color: var(--text-muted);
  padding: 1.5rem;
  text-align: center;
  background-color: var(--bg-darker);
  border-radius: var(--radius-md);
  font-style: italic;
  margin: 1rem 0;
}

.error {
  color: var(--error-color);
  text-align: center;
  background-color: rgba(229, 62, 62, 0.1);
}

/* Integrations styling */
.integrations-container {
  display: grid;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--bg-darker);
  border-radius: var (--radius-lg);
  border: 1px solid var(--border-color);
}

.integration-section {
  background: var(--bg-lighter);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-normal);
}

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

.integration-section h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
}

.integration-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.integration-dot.green {
  background: var(--success-color);
}

.integration-dot.blue {
  background: var(--primary-color);
}

.integration-dot.purple {
  background: var(--accent-color);
}

.integration-dot.orange {
  background: var(--warning-color);
}

.integration-description {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.integration-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.integration-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.integration-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.integration-list li:first-child {
  padding-top: 0;
}

.integration-list strong {
  color: var(--text-color);
  font-weight: 600;
}

.integration-list li span {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
}

.integration-badge {
  background: var(--accent-color);
  color: white !important;
  padding: 0.25rem 0.75rem;
  text-align: center;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Modal tabs */
.modal .tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.modal .tab-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal .tab-btn:hover {
  background-color: var(--bg-darker);
  color: var(--text-color);
}

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

.modal .tab-content {
  display: none;
}

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

/* Modal content sections */
.modal-content-text {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  padding: 1rem;
  background: var(--bg-darker);
  border-radius: var(--radius-md);
  max-height: 400px;
  overflow-y: auto;
}

.modal-keywords {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.modal-keyword {
  background: var(--bg-darker);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.modal-keyword-text {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.keyword-score {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Performance stats */
.performance-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.performance-stat {
  background-color: var(--bg-darker);
  padding: 1rem;
  border-radius: var(--radius-md);
  text-align: center;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
}

/* Smaller text paragraph */
#p_smaller {
  font-size: 0.75em;
  text-align: center;
  color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .performance-stats {
    grid-template-columns: 1fr;
  }

  .modal-keywords {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    gap: 1rem;
  }

  .search-box {
    max-width: 100%;
  }
}

@media (min-width: 768px) {
  .integrations-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .integrations-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chart-explanation {
  margin-top: 15px;
  padding: 10px 15px;
  background-color: var(--bg-darker);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-color);
}

.chart-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

#trendingChartCanvas {
  min-height: 400px;
  width: 100%;
}

.tiny-button {
  padding: 1px 3px;
  font-size: 0.65em;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  color: #666;
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: -4px;
}

.tiny-button:hover {
  background: #f0f0f0;
  color: #333;
}

.performance-table .text-right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.performance-table td,
.performance-table th {
  padding: 8px 12px;
}

/* User menu dropdown */
.user-menu-dropdown {
  position: fixed;
  display: none;
  top: 0;
  right: 0;
  background-color: var(--bg-lighter);
  min-width: 160px;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  z-index: 1000;
  padding: 8px 0;
  animation: fadeIn 0.2s ease-out;
}

.user-menu-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 20px;
  width: 16px;
  height: 16px;
  background-color: var(--bg-lighter);
  transform: rotate(45deg);
  border-top: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
  z-index: -1;
}

.user-menu-dropdown.show {
  display: block;
}

.user-menu-item {
  display: block;
  padding: 6px 16px;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition-normal);
  font-size: 0.8rem;
}

.user-menu-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--accent-color);
}

.user-menu-item i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

/* Job details modal styling */
.job-info-container {
  padding: 0;
  max-width: 100%;
}

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 10px;
}

.job-title {
  margin: 0;
  font-size: 1.3em;
  color: #333;
}

.job-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.job-detail-section {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.job-detail-section h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #444;
  font-size: 0.95em;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}

.error-section {
  grid-column: span 2;
  background-color: #fff8f8;
  border-left: 4px solid #dc3545;
}

.error-details {
  padding: 10px;
  background-color: #f8f8f8;
  border-radius: 4px;
  font-family: monospace;
  white-space: pre-wrap;
  font-size: 0.85em;
  color: #721c24;
}

.results-details {
  margin-top: 10px;
}

.job-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.small-button {
  padding: 3px 8px;
  font-size: 0.8em;
}

/* For responsive layout */
@media (max-width: 768px) {
  .job-details-grid {
    grid-template-columns: 1fr;
  }

  .error-section {
    grid-column: span 1;
  }
}
