/*
 * The Code Review dashboard's widget styling.
 *
 * Registered through FilamentAsset, not @push('styles') in the views.
 * These widgets are lazy-loaded Livewire components, so by the time one
 * renders the layout's @stack('styles') has already been emitted and the
 * pushed CSS is silently dropped — which is what left the progress ring
 * as an unsized, unfilled black circle. Same reasoning as
 * booking-calendar.css; see AppServiceProvider::registerFilamentAssets().
 *
 * That also means real CSS only: no Tailwind utilities, no @apply. Dark
 * mode is a `.dark` class on <html>, not prefers-color-scheme.
 */

/* --- peer-review-analysis.blade.php --- */
.fi-pr-analysis { display: flex; flex-direction: column; gap: 1rem; }
/* An inline-start accent per section, so problem, mechanism and
   fix are distinguishable at a glance instead of reading as
   three identical paragraphs. Logical property, so it stays on
   the correct side under the Arabic RTL layout. */
.fi-pr-analysis-card {
    padding: .875rem 1rem; border-radius: .5rem;
    border-inline-start: 3px solid transparent;
    background: rgba(148, 163, 184, .07);
}
.fi-pr-analysis-cause { border-inline-start-color: #f59e0b; }
.fi-pr-analysis-flow { border-inline-start-color: #3b82f6; }
.fi-pr-analysis-solution { border-inline-start-color: #22c55e; }
.fi-pr-analysis-heading {
    display: flex; align-items: center; gap: .375rem;
    font-size: .75rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: #6b7280; margin-bottom: .5rem;
}
.fi-pr-analysis-icon { width: .875rem; height: .875rem; }
.dark .fi-pr-analysis-heading { color: #9ca3af; }
.fi-pr-analysis-body {
    font-size: .875rem; line-height: 1.6; color: #374151;
}
.dark .fi-pr-analysis-body { color: #d1d5db; }
.fi-pr-analysis-diagram {
    overflow-x: auto; padding: .875rem 1rem; border-radius: .5rem;
    background: rgba(17, 24, 39, .04); color: #374151;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .75rem; line-height: 1.5; white-space: pre;
}
.dark .fi-pr-analysis-diagram {
    background: rgba(255, 255, 255, .04); color: #d1d5db;
}

/* --- peer-review-comments.blade.php --- */
.fi-pr-comments { display: flex; flex-direction: column; gap: .75rem; }
.fi-pr-comment {
    padding: .75rem .875rem; border-radius: .5rem;
    background: rgba(17, 24, 39, .03);
}
.dark .fi-pr-comment { background: rgba(255, 255, 255, .03); }
.fi-pr-comment-head {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .25rem;
}
.fi-pr-comment-author { font-size: .8rem; font-weight: 600; color: #374151; }
.dark .fi-pr-comment-author { color: #e5e7eb; }
.fi-pr-comment-date { font-size: .7rem; color: #6b7280; margin-inline-end: auto; }
.dark .fi-pr-comment-date { color: #9ca3af; }
.fi-pr-comment-body {
    font-size: .875rem; line-height: 1.55; color: #374151;
    white-space: pre-line;
}
.dark .fi-pr-comment-body { color: #d1d5db; }
.fi-pr-comment-empty { font-size: .875rem; color: #6b7280; }
.dark .fi-pr-comment-empty { color: #9ca3af; }

/* --- peer-review-history.blade.php --- */
.fi-pr-history-heading {
    display: inline-flex; align-items: center; gap: .5rem;
}
.fi-pr-history { display: flex; flex-direction: column; gap: 1rem; }
.fi-pr-history-item {
    padding: .875rem 1rem; border-radius: .625rem;
    border: 1px solid rgba(17, 24, 39, .08);
}
.dark .fi-pr-history-item { border-color: rgba(255, 255, 255, .1); }
.fi-pr-history-head {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: .5rem; margin-bottom: .5rem;
}
.fi-pr-history-file {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .72rem; color: #6b7280;
}
.dark .fi-pr-history-file { color: #9ca3af; }
.fi-pr-history-title { font-size: .875rem; font-weight: 600; color: #374151; }
.dark .fi-pr-history-title { color: #e5e7eb; }
.fi-pr-history-body {
    font-size: .8rem; line-height: 1.55; color: #6b7280; margin-top: .25rem;
}
.dark .fi-pr-history-body { color: #9ca3af; }
.fi-pr-history-meta {
    font-size: .72rem; color: #6b7280; margin-top: .5rem; font-style: italic;
}
.dark .fi-pr-history-meta { color: #9ca3af; }
.fi-pr-history-comments { margin-top: .75rem; }

/* --- peer-review-progress.blade.php --- */
.fi-pr-progress {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
/* Explicit box, not a percentage: the SVG has no intrinsic size, so
   without this it expands to fill whatever the panel gives it — which is
   what rendered it as an oversized circle. */
.fi-pr-ring-ctn {
    position: relative; flex: 0 0 auto;
    width: 7.5rem; height: 7.5rem;
}
.fi-pr-ring { display: block; width: 100%; height: 100%; }
.fi-pr-ring-track {
    fill: none; stroke: rgba(148, 163, 184, .22); stroke-width: 10;
}
.fi-pr-ring-value {
    fill: none; stroke: #22c55e; stroke-width: 10; stroke-linecap: round;
    transition: stroke-dashoffset .6s ease;
}
.fi-pr-ring-label {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .125rem;
}
.fi-pr-ring-rate {
    font-size: 1.5rem; font-weight: 700; line-height: 1;
    color: #374151; font-variant-numeric: tabular-nums;
}
.dark .fi-pr-ring-rate { color: #f3f4f6; }
.fi-pr-ring-caption {
    font-size: .68rem; letter-spacing: .04em; text-transform: uppercase;
    color: #6b7280;
}
.dark .fi-pr-ring-caption { color: #9ca3af; }

.fi-pr-bars { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: .625rem; }
.fi-pr-bar-head {
    display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem;
}
.fi-pr-bar-dot { width: .5rem; height: .5rem; border-radius: 999px; flex: 0 0 auto; }
.fi-pr-bar-label { font-size: .78rem; color: #374151; margin-inline-end: auto; }
.dark .fi-pr-bar-label { color: #d1d5db; }
.fi-pr-bar-rate {
    font-size: .72rem; font-weight: 600; color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.dark .fi-pr-bar-rate { color: #9ca3af; }
.fi-pr-bar-track {
    display: flex; height: .5rem; border-radius: 999px; overflow: hidden;
    background: rgba(148, 163, 184, .18);
}
.fi-pr-bar-seg { display: block; height: 100%; }

.fi-pr-seg-open { background: #ef4444; }
.fi-pr-seg-in_progress { background: #f59e0b; }
.fi-pr-seg-closed { background: #22c55e; }
.fi-pr-seg-ignored { background: #94a3b8; }

.fi-pr-legend {
    display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.25rem;
    font-size: .72rem; color: #6b7280;
}
.dark .fi-pr-legend { color: #9ca3af; }
.fi-pr-legend-item { display: inline-flex; align-items: center; gap: .375rem; }
.fi-pr-legend-dot {
    width: .625rem; height: .625rem; border-radius: .1875rem; display: inline-block;
}
.fi-pr-legend-item strong { color: #374151; font-variant-numeric: tabular-nums; }
.dark .fi-pr-legend-item strong { color: #e5e7eb; }
