/*
 * bridge.css — Maps results.js CSS classes to Tailwind v3a design
 * Loaded AFTER Tailwind CDN (no @apply)
 */

/* === Utility === */
.hidden { display: none !important; }

/* === Suggestions dropdown === */
.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 80px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 8px 8px;
    list-style: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
}
.suggestions li {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}
.suggestions li:last-child { border-bottom: none; }
.suggestions li:hover,
.suggestions li.active { background: #eef2ff; }

/* === Data rows === */
.data-row {
    display: flex;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}
.data-row:last-child { border-bottom: none; }
.data-label {
    width: 160px;
    flex-shrink: 0;
    color: #6b7280;
    font-size: 0.8rem;
}
.data-value {
    flex: 1;
    font-weight: 500;
}
.data-value.highlight { color: #4f46e5; font-weight: 600; }
.data-value.warning-text { color: #ea580c; }
.data-value.danger-text { color: #dc2626; font-weight: 600; }
.data-value.info-text { color: #6b7280; font-size: 0.8rem; font-style: italic; }

/* === Item lists === */
.item-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.item-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}
.item-list li:last-child { border-bottom: none; }

/* === Enriched items === */
.enriched-item { padding: 0.6rem 0 !important; }
.enriched-item .item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.enriched-item .item-header strong { font-size: 0.875rem; }
.item-description { font-size: 0.8rem; color: #6b7280; margin-bottom: 0.25rem; }
.item-action {
    font-size: 0.8rem;
    color: #1f2937;
    padding: 0.35rem 0.6rem;
    background: #f9fafb;
    border-left: 2px solid #818cf8;
    border-radius: 0 4px 4px 0;
}
.item-file { font-size: 0.75rem; color: #9ca3af; margin-top: 0.25rem; font-style: italic; }

/* === Tags (solid fills for v3a) === */
.item-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 0.35rem;
}
.tag-danger { background: #dc2626; color: #fff; }
.tag-warning { background: #f59e0b; color: #fff; }
.tag-info { background: #9ca3af; color: #fff; }
.tag-ok { background: #16a34a; color: #fff; }

/* === Risk nuance (altitude) === */
.risk-nuance {
    font-size: 0.75rem;
    font-style: italic;
    color: #6b7280;
    background: #f0fdf4;
    border-left: 2px solid #16a34a;
    padding: 0.3rem 0.6rem;
    margin-top: 0.25rem;
    border-radius: 0 4px 4px 0;
}

/* === Empty text === */
.empty-text { color: #9ca3af; font-style: italic; font-size: 0.8rem; }

/* === Reference links === */
.ref-link { color: #4f46e5; text-decoration: none; font-size: 0.75rem; margin-left: 0.35rem; }
.ref-link:hover { text-decoration: underline; }

/* === Approx badge === */
.approx-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #ea580c;
    background: #fff7ed;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.35rem;
}

/* === Result card severity borders === */
.result-card.severity-ok { border-color: #16a34a; }
.result-card.severity-warning { border-color: #f59e0b; }
.result-card.severity-danger { border-color: #dc2626; }

/* === Indicators (dots) === */
.indicator.ok { background: #16a34a; }
.indicator.warning { background: #f59e0b; }
.indicator.danger { background: #dc2626; }
.indicator.neutral { background: #d1d5db; }

/* === Summary banner (dark) === */
#summary-banner .summary-content { display: flex; flex-direction: column; gap: 0.5rem; }
#summary-banner .summary-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.summary-zone {
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}
.summary-ok { background: #22c55e; color: #fff; }
.summary-warning { background: #f59e0b; color: #fff; }
.summary-danger { background: #ef4444; color: #fff; }
.summary-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}
.pill-danger { background: #ef4444; color: #fff; }
.pill-warning { background: #f59e0b; color: #fff; }
.pill-ok { background: #22c55e; color: #fff; }
.summary-demand { font-size: 0.8rem; font-weight: 600; color: #d1d5db; padding: 0.25rem 0; }
.summary-links { font-size: 0.75rem; color: #9ca3af; }
.summary-links a { color: #818cf8; text-decoration: none; }
.summary-links a:hover { text-decoration: underline; }

/* === Checklist === */
#section-checklist.severity-ok { border-color: #818cf8; }
#section-checklist.severity-warning { border-color: #818cf8; }
#section-checklist.severity-danger { border-color: #818cf8; }

.checklist-group { margin-bottom: 0.75rem; }
.checklist-group:last-child { margin-bottom: 0; }

/* Alerts */
.checklist-alert {
    display: flex;
    align-items: start;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #92400e;
}
.checklist-alert.alert-danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Checklist items */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}
.checklist-item:hover { background: #f9fafb; }
.checklist-item input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
    border-radius: 4px;
}
.checklist-item label { flex: 1; font-size: 0.875rem; cursor: pointer; line-height: 1.4; }
.checklist-item label .piece-code {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    margin-right: 0.35rem;
}
/* Triggered items: amber code */
.checklist-item.triggered label .piece-code { background: #fef3c7; color: #92400e; }
/* Standard items: gray code */
.checklist-item:not(.triggered) label .piece-code { background: #f3f4f6; color: #6b7280; }

.checklist-item label .piece-article {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-left: 0.25rem;
}
.checklist-item label .piece-note {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 0.15rem;
}
.checklist-item.triggered label .piece-note { color: #92400e; }
.piece-reason {
    display: block;
    font-size: 0.7rem;
    color: #92400e;
    margin-top: 0.15rem;
}
.reason-link {
    color: #4f46e5;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.25rem;
}
.reason-link:hover { text-decoration: underline; }
.checklist-item.checked label { text-decoration: line-through; color: #d1d5db; }

/* Checklist collapsible buttons */
.checklist-collapse-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
}
.checklist-collapse-btn.triggered {
    background: #fffbeb;
    color: #92400e;
}
.checklist-collapse-btn.triggered:hover { background: #fef3c7; }
.checklist-collapse-btn.standard {
    background: #f3f4f6;
    color: #6b7280;
}
.checklist-collapse-btn.standard:hover { background: #e5e7eb; }
.checklist-collapse-btn .count-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 9999px;
}
.checklist-collapse-btn.triggered .count-badge { background: #fde68a; color: #92400e; }
.checklist-collapse-btn.standard .count-badge { background: #e5e7eb; color: #6b7280; }
.checklist-collapse-btn .chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}
.checklist-collapse-btn .chevron.rotated { transform: rotate(180deg); }

/* Checklist progress */
.checklist-progress { height: 4px; border-radius: 9999px; background: #f3f4f6; overflow: hidden; }
.checklist-progress-fill { height: 100%; border-radius: 9999px; background: #6366f1; }
.checklist-counter {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #9ca3af;
}
.checklist-counter strong { color: #4f46e5; }

/* Standard group: grid 2 cols */
.checklist-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; }
@media (max-width: 768px) { .checklist-grid { grid-template-columns: 1fr; } }

/* === Responsive: sidebar on top for mobile === */
@media (max-width: 1023px) {
    #view-report .flex.flex-1 { flex-direction: column; height: auto; }
    #view-report aside { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; }
    #view-report aside .p-4 { flex-direction: row; flex-wrap: wrap; gap: 1rem; }
    #view-report aside hr { display: none; }
}

/* === Print === */
@media print {
    body { background: #fff; }
    #view-home { display: none; }
    #view-report header { display: none; }
    #view-report aside { display: none; }
    .insight-placeholder { display: none; }
    .result-card { break-inside: avoid; border: 1px solid #ccc; margin-bottom: 0.5rem; }
    #summary-banner { background: #1f2937 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
