/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* External sidebar theme */
:root {
  --external-sidebar-bg: #EEF4FB;
  --external-sidebar-border: #B5D4F4;
  --external-sidebar-text: #0C447C;
  --external-sidebar-label: #185FA5;
  --external-sidebar-hover: #E2EDF8;
  --external-sidebar-active: #D9E8F7;
  --external-sidebar-muted: #6AA3D0;
}

/* Combobox width overrides with high specificity */
.hw-combobox {
  width: 100%;
}

.hw-combobox__main__wrapper {
  width: 100%;
  border-radius: 0.5rem;
}

/* Animated dots for loading states */
@keyframes fade {
  0%, 100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

/* Custom font families for audit rule redesign */
.font-heading {
  font-family: 'Source Serif 4', Georgia, serif;
}

.font-mono-jb {
  font-family: 'JetBrains Mono', monospace;
}

/* Confidence ring animation */
@keyframes confidence-fill {
  from {
    stroke-dashoffset: var(--circumference);
  }
  to {
    stroke-dashoffset: var(--target-offset);
  }
}

.confidence-ring-progress {
  animation: confidence-fill 1s ease-out forwards;
}

/* Status dot pulse animation */
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Sidebar collapse - prevent text wrap during animation */
[data-controller="nav-sidebar"] a,
[data-controller="nav-sidebar"] summary,
[data-controller="nav-sidebar"] button {
  white-space: nowrap;
  overflow: hidden;
}

/* Center icons when sidebar is collapsed */
[data-nav-sidebar-collapsed-value="true"] nav a,
[data-nav-sidebar-collapsed-value="true"] nav summary,
[data-nav-sidebar-collapsed-value="true"] nav button {
  justify-content: center;
}

/* Evidence highlight in document preview */
.evidence-highlight,
.prose .evidence-highlight,
.prose-sm .evidence-highlight,
.prose-stone .evidence-highlight,
mark.evidence-highlight {
  background-color: #fef08a !important; /* yellow-200 */
  color: #1c1917 !important; /* stone-900 */
  padding: 2px 4px !important;
  border-radius: 3px !important;
  scroll-margin-top: 100px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Source drawer — excerpt highlighting */
.prose mark {
  background-color: rgb(254 243 199 / 0.7); /* amber-100/70 */
  color: inherit;
  padding: 1px 2px;
  border-radius: 3px;
}

/* Call brief — visual highlighting for call preparation */
.call-brief h4.cb-heading {
  padding: 6px 12px;
  border-left: 3px solid;
  border-radius: 0 6px 6px 0;
  margin-top: 1.5em;
}

.call-brief .cb-heading-resolvable {
  border-left-color: #f59e0b; /* amber-500 */
  background-color: #fffbeb; /* amber-50 */
  color: #92400e; /* amber-800 */
}

.call-brief .cb-heading-established {
  border-left-color: #ef4444; /* red-500 */
  background-color: #fef2f2; /* red-50 */
  color: #991b1b; /* red-800 */
}

.call-brief .cb-heading-insufficient {
  border-left-color: #3b82f6; /* blue-500 */
  background-color: #eff6ff; /* blue-50 */
  color: #1e40af; /* blue-800 */
}

.call-brief .cb-heading-non-assessable {
  border-left-color: #8b5cf6; /* violet-500 */
  background-color: #f5f3ff; /* violet-50 */
  color: #5b21b6; /* violet-800 */
}

.call-brief .cb-heading-questions {
  border-left-color: #10b981; /* emerald-500 */
  background-color: #ecfdf5; /* emerald-50 */
  color: #065f46; /* emerald-800 */
}

.call-brief h2.cb-heading-vigilance {
  border-left: 3px solid #ef4444;
  background-color: #fef2f2;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  color: #991b1b;
}

.call-brief h2.cb-heading-after-call {
  border-left: 3px solid #3b82f6;
  background-color: #eff6ff;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  color: #1e40af;
}

.call-brief strong.cb-known {
  display: inline-block;
  background-color: #ecfdf5; /* emerald-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #065f46; /* emerald-800 */
}

.call-brief strong.cb-clarify {
  display: inline-block;
  background-color: #fffbeb; /* amber-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #92400e; /* amber-800 */
}

.call-brief strong.cb-amorce {
  display: inline-block;
  background-color: #ecfdf5; /* emerald-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #065f46; /* emerald-800 */
}

.call-brief strong.cb-docs {
  display: inline-block;
  background-color: #fffbeb; /* amber-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #92400e; /* amber-800 */
}

.call-brief strong.cb-trigger {
  display: inline-block;
  background-color: #f5f3ff; /* violet-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #5b21b6; /* violet-800 */
}

.call-brief strong.cb-depth {
  display: inline-block;
  background-color: #f5f5f4; /* stone-100 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #57534e; /* stone-600 */
}

.call-brief strong.cb-kb-ref {
  display: inline-block;
  background-color: #eff6ff; /* blue-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #1e40af; /* blue-800 */
  font-style: italic;
}

.call-brief strong.cb-blocker {
  display: inline-block;
  background-color: #fef2f2; /* red-50 */
  padding: 2px 6px;
  border-radius: 3px;
  color: #991b1b; /* red-800 */
}

.call-brief .cb-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
}

.call-brief .cb-badge-critical {
  background-color: #fee2e2; /* red-100 */
  color: #991b1b; /* red-800 */
}

.call-brief .cb-badge-important {
  background-color: #fef3c7; /* amber-100 */
  color: #92400e; /* amber-800 */
}

.call-brief .cb-badge-useful {
  background-color: #dbeafe; /* blue-100 */
  color: #1e40af; /* blue-800 */
}

/* Guidelines diff (diffy) */
.guidelines-diff .diff {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.guidelines-diff .diff ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guidelines-diff .diff li {
  padding: 1px 20px;
  border-bottom: 1px solid transparent;
  white-space: pre-wrap;
  word-break: break-word;
}

.guidelines-diff .diff li.unchanged span {
  color: #44403c; /* stone-700 */
}

.guidelines-diff .diff li.del {
  background-color: #fee2e2; /* red-100 */
  border-bottom-color: #fecaca; /* red-200 */
}

.guidelines-diff .diff li.del del {
  text-decoration: none;
  color: #991b1b; /* red-800 */
}

.guidelines-diff .diff li.del del strong {
  background-color: #fca5a5; /* red-300 */
  border-radius: 2px;
  padding: 0 1px;
  font-weight: inherit;
}

.guidelines-diff .diff li.ins {
  background-color: #dcfce7; /* green-100 */
  border-bottom-color: #bbf7d0; /* green-200 */
}

.guidelines-diff .diff li.ins ins {
  text-decoration: none;
  color: #166534; /* green-800 */
}

.guidelines-diff .diff li.ins ins strong {
  background-color: #86efac; /* green-300 */
  border-radius: 2px;
  padding: 0 1px;
  font-weight: inherit;
}
