/* policy-coverage.css — Policy Coverage Checker slide-in panel */

/* ── Overlay ──────────────────────────────────────────────────────────────── */
.pc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.pc-overlay--open {
    opacity: 1;
    pointer-events: auto;
}

/* ── Panel shell ──────────────────────────────────────────────────────────── */
.pc-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 1401;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.pc-panel--open {
    transform: translateX(0);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.pc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}
.pc-panel-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: #111;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pc-panel-title svg {
    color: #00a878;
    flex-shrink: 0;
}
.pc-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: inherit;
}
.pc-close-btn:hover {
    background: #f3f4f6;
    color: #111;
}

/* ── Intro ────────────────────────────────────────────────────────────────── */
.pc-intro {
    padding: 16px 20px 0;
    flex-shrink: 0;
}
.pc-intro p {
    font-size: 0.87rem;
    color: #374151;
    margin: 0 0 6px;
    line-height: 1.5;
}
.pc-intro-note {
    font-size: 0.8rem !important;
    color: #9ca3af !important;
    font-style: italic;
    margin-bottom: 14px !important;
}

/* ── Scrollable form body ─────────────────────────────────────────────────── */
.pc-form {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 0;
    display: flex;
    flex-direction: column;
}

/* ── Control cards ────────────────────────────────────────────────────────── */
.pc-control-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    flex-shrink: 0;
}
.pc-control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}
.pc-control-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #111;
}
.pc-control-score {
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    padding: 2px 9px;
    border-radius: 12px;
    flex-shrink: 0;
}
.pc-policy-hint {
    font-size: 0.76rem;
    color: #9ca3af;
    margin: 0 0 12px;
    font-style: italic;
}

/* ── Questions ────────────────────────────────────────────────────────────── */
.pc-question {
    margin-bottom: 10px;
}
.pc-question:last-of-type {
    margin-bottom: 0;
}
.pc-question-text {
    font-size: 0.83rem;
    color: #374151;
    margin-bottom: 6px;
    line-height: 1.4;
}
.pc-options {
    display: flex;
    gap: 6px;
}
.pc-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.73rem;
    color: #4b5563;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    user-select: none;
    line-height: 1.2;
}
.pc-option input[type="radio"] {
    display: none;
}
.pc-option:hover {
    border-color: #9ca3af;
    background: #f3f4f6;
}
.pc-option--selected.pc-option--yes {
    border-color: #16a34a;
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
}
.pc-option--selected.pc-option--partial {
    border-color: #d97706;
    background: #fef3c7;
    color: #b45309;
    font-weight: 600;
}
.pc-option--selected.pc-option--no {
    border-color: #dc2626;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
}

/* ── Sticky submit footer ─────────────────────────────────────────────────── */
.pc-form-footer {
    padding: 14px 0 18px;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    background: #fff;
    position: sticky;
    bottom: 0;
    flex-shrink: 0;
}
.pc-submit-btn {
    width: 100%;
    padding: 11px;
    background: #00a878;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}
.pc-submit-btn:hover {
    background: #008f66;
}

/* ── Results panel ────────────────────────────────────────────────────────── */
.pc-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    flex-direction: column;
    gap: 0;
}

/* Loading */
.pc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 48px 20px;
    text-align: center;
    color: #374151;
    font-size: 0.88rem;
    width: 100%;
}
.pc-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e5e7eb;
    border-top-color: #00a878;
    border-radius: 50%;
    animation: pc-spin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes pc-spin { to { transform: rotate(360deg); } }

/* Summary */
.pc-results-summary {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.86rem;
    color: #15803d;
    margin-bottom: 18px;
    line-height: 1.5;
}

/* Section headings */
.pc-coverage-map h3,
.pc-priority-actions h3,
.pc-suggested-policies h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin: 0 0 10px;
}

/* Coverage rows */
.pc-coverage-map {
    margin-bottom: 20px;
}
.pc-coverage-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 7px;
    border: 1px solid #e5e7eb;
}
.pc-verdict--covered { background: #f0fdf4; border-color: #86efac; }
.pc-verdict--partial { background: #fffbeb; border-color: #fcd34d; }
.pc-verdict--none    { background: #fef2f2; border-color: #fca5a5; }

.pc-coverage-verdict {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
    flex-shrink: 0;
}
.pc-verdict-icon {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1;
}
.pc-verdict--covered .pc-verdict-icon { color: #16a34a; }
.pc-verdict--partial .pc-verdict-icon { color: #d97706; }
.pc-verdict--none    .pc-verdict-icon { color: #dc2626; }
.pc-verdict-label {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 3px;
    text-align: center;
}
.pc-verdict--covered .pc-verdict-label { color: #16a34a; }
.pc-verdict--partial .pc-verdict-label { color: #d97706; }
.pc-verdict--none    .pc-verdict-label { color: #dc2626; }

.pc-coverage-detail strong {
    font-size: 0.86rem;
    color: #111;
    display: block;
    margin-bottom: 3px;
}
.pc-coverage-detail p {
    font-size: 0.8rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.4;
}

/* Priority actions */
.pc-priority-actions {
    margin-bottom: 20px;
}
.pc-priority-actions ul {
    margin: 0;
    padding-left: 16px;
    list-style: disc;
}
.pc-priority-actions li {
    font-size: 0.84rem;
    color: #374151;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Suggested policies */
.pc-suggested-policies {
    margin-bottom: 16px;
}
.pc-policy-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.pc-policy-card-body {
    flex: 1;
    min-width: 0;
}
.pc-policy-name {
    font-weight: 600;
    font-size: 0.86rem;
    color: #111;
    margin-bottom: 2px;
}
.pc-policy-reason {
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.3;
}
.pc-generate-btn {
    background: #00a878;
    color: #fff;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s;
}
.pc-generate-btn:hover {
    background: #008f66;
    color: #fff;
}

/* Back + error buttons */
.pc-back-btn {
    background: none;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.83rem;
    cursor: pointer;
    margin-top: 8px;
    font-family: inherit;
}
.pc-back-btn:hover { background: #f3f4f6; }

.pc-error {
    text-align: center;
    padding: 36px 20px;
    color: #374151;
    font-size: 0.88rem;
    width: 100%;
}
.pc-retry-btn {
    margin-top: 12px;
    background: #00a878;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.86rem;
    font-family: inherit;
}

/* ── Trigger button (in assessment results) ───────────────────────────────── */
.pc-trigger-wrap {
    margin-top: 24px;
    padding: 18px 20px;
    background: #f0fdf9;
    border: 1px solid #86efcb;
    border-radius: 10px;
    text-align: center;
}
.pc-trigger-btn {
    background: #00a878;
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    font-family: inherit;
}
.pc-trigger-btn:hover { background: #008f66; }
.pc-trigger-hint {
    font-size: 0.8rem;
    color: #047857;
    margin: 8px 0 0;
}

/* ── Policy Generator deep-link highlight ─────────────────────────────────── */
.pg-card--highlighted {
    outline: 2px solid #00a878;
    outline-offset: 3px;
    animation: pg-highlight-pulse 2.5s ease-out forwards;
}
@keyframes pg-highlight-pulse {
    0%   { outline-color: #00a878; box-shadow: 0 0 0 5px rgba(0,168,120,.2); }
    100% { outline-color: transparent; box-shadow: none; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .pc-panel { width: 100%; }
    .pc-options { flex-direction: column; }
    .pc-policy-card { flex-direction: column; align-items: flex-start; }
    .pc-generate-btn { align-self: flex-start; }
}

@media print {
    .pc-panel, .pc-overlay, .pc-trigger-wrap { display: none !important; }
}
