/* Metacognitive Audit Interactive Component */

.mc-audit {
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  background: var(--card-bg, #1a1a2e);
}

.mc-audit__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary, #e0e0e0);
}

.mc-audit__header::before {
  content: "\1F9E0";
  font-size: 1.3rem;
}

.mc-audit__textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  font-family: var(--font-mono, 'JetBrains Mono', 'Fira Code', monospace);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary, #e0e0e0);
  background: var(--bg-secondary, #0d0d1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  resize: vertical;
  tab-size: 2;
}

.mc-audit__textarea:focus {
  outline: none;
  border-color: var(--accent-color, #6366f1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.mc-audit__textarea::placeholder {
  color: var(--text-muted, #666);
}

.mc-audit__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: center;
}

.mc-audit__btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.mc-audit__btn--primary {
  background: var(--accent-color, #6366f1);
  color: #fff;
}

.mc-audit__btn--primary:hover {
  background: var(--accent-hover, #4f46e5);
}

.mc-audit__btn--primary:active {
  transform: scale(0.98);
}

.mc-audit__btn--secondary {
  background: transparent;
  color: var(--text-muted, #999);
  border: 1px solid var(--border-color, #333);
}

.mc-audit__btn--secondary:hover {
  color: var(--text-primary, #e0e0e0);
  border-color: var(--text-muted, #999);
}

/* Results Section */
.mc-audit__results {
  margin-top: 1.5rem;
  display: none;
}

.mc-audit__results.visible {
  display: block;
}

/* Score Display */
.mc-audit__score {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.mc-audit__score-card {
  flex: 1;
  min-width: 140px;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg-secondary, #0d0d1a);
  border: 1px solid var(--border-color, #333);
  text-align: center;
}

.mc-audit__score-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.mc-audit__score-value--action {
  color: var(--text-muted, #999);
}

.mc-audit__score-value--meta {
  color: var(--accent-color, #6366f1);
}

.mc-audit__score-value--ratio {
  color: #10b981;
}

.mc-audit__score-label {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Bar Chart */
.mc-audit__bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-secondary, #0d0d1a);
  margin: 1rem 0;
  overflow: hidden;
  display: flex;
}

.mc-audit__bar-action {
  background: var(--text-muted, #666);
  transition: width 0.5s ease;
}

.mc-audit__bar-meta {
  background: var(--accent-color, #6366f1);
  transition: width 0.5s ease;
}

/* Failure Mode Checklist */
.mc-audit__section {
  margin-top: 1.25rem;
}

.mc-audit__section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color, #333);
}

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

.mc-audit__checklist li {
  padding: 0.4rem 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mc-audit__check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.mc-audit__check--pass {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.mc-audit__check--fail {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Hedging Words */
.mc-audit__hedging {
  margin-top: 0.5rem;
}

.mc-audit__hedging-word {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  margin: 0.2rem;
  font-size: 0.8rem;
  font-family: var(--font-mono, monospace);
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.mc-audit__hedging-word--clean {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}

/* Grade */
.mc-audit__grade {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.mc-audit__grade--a {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.mc-audit__grade--b {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

.mc-audit__grade--c {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.mc-audit__grade--d {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.mc-audit__grade-letter {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.mc-audit__grade-desc {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  opacity: 0.8;
}

/* Noscript fallback */
.mc-audit__noscript {
  padding: 1rem;
  background: var(--bg-secondary, #0d0d1a);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted, #999);
}

@media (max-width: 600px) {
  .mc-audit {
    padding: 1rem;
  }

  .mc-audit__score {
    flex-direction: column;
    gap: 0.75rem;
  }

  .mc-audit__score-card {
    min-width: unset;
  }
}
