/* Top Sites List – Enhanced */
.top-sites-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
}

.top-sites-enhanced .top-sites-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.top-sites-title {
  margin: 0 0 0.2rem 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.02em;
}

.top-sites-subtitle {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-secondary, #64748b);
}

.top-sites-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.top-sites-empty {
  margin: 0;
  padding: 1rem 0;
  font-size: 0.9375rem;
  color: var(--text-secondary, #64748b);
  text-align: center;
}

.top-site-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.top-site-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.top-site-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.top-site-main {
  flex: 1;
  min-width: 0;
}

.top-site-name {
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  line-height: 1.25;
}

.top-site-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary, #64748b);
}

.top-site-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.top-site-meta-icon {
  font-size: 0.75rem;
  opacity: 0.9;
}

.top-site-stats {
  flex-shrink: 0;
  text-align: right;
}

.top-site-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.top-site-score-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
  line-height: 1.2;
}

.top-site-score-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.top-site-findings {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.top-site-progress-bar {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
}

.top-site-progress {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.top-site-progress.high,
.top-site-progress.mid,
.top-site-progress.low {
  background: rgb(242, 27, 35);
}

/* Night mode: dark theme for Sites & Activity – ensure all text is visible */
body.night-mode .top-sites-container,
.night-mode .top-sites-container {
  background: #3a3838;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.night-mode .top-sites-enhanced .top-sites-header,
.night-mode .top-sites-enhanced .top-sites-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.night-mode .top-sites-title,
.night-mode .top-sites-title {
  color: rgba(255, 255, 255, 0.98);
}

body.night-mode .top-sites-subtitle,
.night-mode .top-sites-subtitle {
  color: rgba(255, 255, 255, 0.8);
}

body.night-mode .top-sites-empty,
.night-mode .top-sites-empty {
  color: rgba(255, 255, 255, 0.75);
}

body.night-mode .top-site-item,
.night-mode .top-site-item {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

body.night-mode .top-site-item.top-site-first,
.night-mode .top-site-item.top-site-first {
  background: rgba(242, 27, 35, 0.15);
  border-color: rgba(242, 27, 35, 0.5);
}

body.night-mode .top-site-item:hover,
.night-mode .top-site-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(242, 27, 35, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.night-mode .top-site-name,
.night-mode .top-site-name {
  color: rgba(255, 255, 255, 0.98);
}

body.night-mode .top-site-meta,
.night-mode .top-site-meta,
body.night-mode .top-site-meta-item,
.night-mode .top-site-meta-item {
  color: rgba(255, 255, 255, 0.8);
}

body.night-mode .top-site-score-value,
.night-mode .top-site-score-value {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .top-site-score-label,
.night-mode .top-site-score-label {
  color: rgba(255, 255, 255, 0.75);
}

body.night-mode .top-site-score,
.night-mode .top-site-score {
  color: rgba(255, 255, 255, 0.9);
}

body.night-mode .top-site-score strong,
.night-mode .top-site-score strong {
  color: rgba(255, 255, 255, 0.95);
}

body.night-mode .top-site-findings,
.night-mode .top-site-findings {
  color: rgba(255, 255, 255, 0.8);
}

body.night-mode .top-site-trend,
.night-mode .top-site-trend {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
}

body.night-mode .top-site-progress-bar,
.night-mode .top-site-progress-bar {
  background: rgba(255, 255, 255, 0.15);
}

body.night-mode .top-site-progress.high,
body.night-mode .top-site-progress.mid,
body.night-mode .top-site-progress.low,
.night-mode .top-site-progress.high,
.night-mode .top-site-progress.mid,
.night-mode .top-site-progress.low {
  background: rgb(242, 27, 35);
}

@media (max-width: 768px) {
  .top-sites-container {
    padding: 0.875rem 1rem;
  }
  .top-sites-title {
    font-size: 1.05rem;
  }
  .top-site-item {
    padding: 0.45rem 0.65rem;
  }
  .top-site-body {
    flex-wrap: wrap;
  }
  .top-site-meta {
    font-size: 0.7rem;
  }
}
