/**
 * SEO Checker Metric Badges
 * Compact micro-stat badges for numeric metrics
 */

/* Metrics row container */
.seo-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 4px;
}

/* Individual metric badge */
.seo-metric {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

/* Status variants */
.seo-metric--ok {
  background: rgba(0, 200, 0, 0.15);
  border-color: rgba(0, 200, 0, 0.3);
  color: #00c800;
}

.seo-metric--warn {
  background: rgba(255, 200, 0, 0.15);
  border-color: rgba(255, 200, 0, 0.3);
  color: #ffc800;
}

.seo-metric--error {
  background: rgba(255, 68, 68, 0.15);
  border-color: rgba(255, 68, 68, 0.3);
  color: #ff4444;
}

/* De-emphasized old metrics text (keep but make less prominent) */
.seo-check-metrics {
  font-size: 11px;
  color: var(--color-text);
  opacity: 0.5;
  margin-top: 4px;
  margin-bottom: 0;
}

/* Headings structure panel */
.headings-structure-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}

.headings-structure-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.headings-structure-toggle-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.headings-structure-toggle.expanded .headings-structure-toggle-icon {
  transform: rotate(90deg);
}

.headings-structure-panel {
  margin-top: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 12px;
  line-height: 1.6;
}

.headings-structure-section {
  margin-bottom: 14px;
}

.headings-structure-section:last-child {
  margin-bottom: 0;
}

.headings-structure-section-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  font-size: 13px;
}

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

.headings-structure-list li {
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
  color: rgba(255, 255, 255, 0.8);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.headings-structure-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: rgba(255, 255, 255, 0.5);
}

.headings-structure-empty {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding-left: 16px;
}

.headings-structure-show-all {
  margin-top: 8px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 11px;
  cursor: pointer;
  display: inline-block;
  transition: background 0.2s;
}

.headings-structure-show-all:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Custom scrollbar for headings panel */
.headings-structure-panel::-webkit-scrollbar {
  width: 6px;
}

.headings-structure-panel::-webkit-scrollbar-track {
  background: transparent;
}

.headings-structure-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.headings-structure-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.headings-structure-panel {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Light theme adjustments */
html[data-theme="light"] .seo-metric {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  color: rgba(30, 41, 59, 0.7);
}

html[data-theme="light"] .seo-metric--ok {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

html[data-theme="light"] .seo-metric--warn {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

html[data-theme="light"] .seo-metric--error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

html[data-theme="light"] .headings-structure-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .headings-structure-toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

html[data-theme="light"] .headings-structure-panel {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .headings-structure-list li {
  color: rgba(30, 41, 59, 0.75);
}

html[data-theme="light"] .headings-structure-list li::before {
  color: rgba(30, 41, 59, 0.5);
}

html[data-theme="light"] .headings-structure-empty {
  color: rgba(30, 41, 59, 0.6);
}

html[data-theme="light"] .headings-structure-show-all {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .headings-structure-show-all:hover {
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .headings-structure-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .headings-structure-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

html[data-theme="light"] .headings-structure-panel {
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .seo-metrics {
    gap: 4px;
    margin-top: 6px;
  }
  
  .seo-metric {
    padding: 3px 8px;
    font-size: 10px;
  }
  
  .headings-structure-panel {
    max-height: 200px;
    padding: 10px;
  }
  
  .headings-structure-toggle {
    padding: 5px 10px;
    font-size: 11px;
  }
}
