/* Audit Pulse by IRCF — Public Front-end Styles */

/* -----------------------------------------------------------------------
   Container
   ----------------------------------------------------------------------- */
.apulse-public-results {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1d2327;
}

/* -----------------------------------------------------------------------
   Scanning state (spinner + per-check progress)
   ----------------------------------------------------------------------- */
.apulse-scanning-state {
    text-align: center;
    padding: 40px 20px;
}

.apulse-spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #1d2327;
    border-radius: 50%;
    animation: apulse-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes apulse-spin {
    to { transform: rotate(360deg); }
}

.apulse-scanning-text {
    font-size: 16px;
    color: #50575e;
    margin: 0 0 20px;
}

.apulse-checks-progress {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 420px;
    text-align: left;
}

.apulse-checks-progress li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.apulse-checks-progress li:last-child {
    border-bottom: none;
}

.apulse-check-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 60px;
    text-align: center;
}

.apulse-check-pill-running  { background: #cfe2ff; color: #084298; }
.apulse-check-pill-done     { background: #d4edda; color: #155724; }
.apulse-check-pill-error    { background: #f8d7da; color: #721c24; }

/* -----------------------------------------------------------------------
   Report — header
   ----------------------------------------------------------------------- */
.apulse-report-public {
    background: #fff;
    border: 1px solid #dde0e4;
    border-radius: 6px;
    overflow: hidden;
}

.apulse-report-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: #1d2327;
    flex-wrap: wrap;
}

.apulse-global-score {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.apulse-grade-big {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
}

.apulse-grade-a { background: #28a745; }
.apulse-grade-b { background: #17a2b8; }
.apulse-grade-c { background: #ffc107; color: #1d2327; }
.apulse-grade-d { background: #fd7e14; }
.apulse-grade-f { background: #dc3545; }

.apulse-score-num {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
}

.apulse-score-num span {
    font-size: 16px;
    color: #9ea6ad;
    font-weight: 400;
}

.apulse-report-meta {
    color: #c3c4c7;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.apulse-report-meta strong {
    color: #fff;
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.apulse-report-meta small {
    font-size: 12px;
    color: #9ea6ad;
}

/* -----------------------------------------------------------------------
   Percentile banner
   ----------------------------------------------------------------------- */
.apulse-percentile-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #1d2327;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    border-top: 1px solid #3d4347;
}

.apulse-percentile-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* -----------------------------------------------------------------------
   Categories
   ----------------------------------------------------------------------- */
.apulse-category {
    border-bottom: 1px solid #f0f0f1;
}

.apulse-category:last-of-type {
    border-bottom: none;
}

.apulse-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    gap: 16px;
    flex-wrap: wrap;
    background: #f9f9f9;
    border-bottom: 1px solid #f0f0f1;
}

.apulse-category-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d2327;
}

.apulse-category-score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #50575e;
    flex-shrink: 0;
}

.apulse-progress-bar {
    width: 100px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.apulse-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.apulse-progress-fill.apulse-score-good   { background: #28a745; }
.apulse-progress-fill.apulse-score-medium { background: #ffc107; }
.apulse-progress-fill.apulse-score-poor   { background: #dc3545; }

/* -----------------------------------------------------------------------
   Checks table
   ----------------------------------------------------------------------- */
.apulse-checks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.apulse-checks-table td {
    padding: 10px 14px;
    vertical-align: top;
}

.apulse-check-row {
    border-bottom: 1px solid #f0f0f1;
}

.apulse-check-row:last-child {
    border-bottom: none;
}

.apulse-status-fail   { background: #fff5f5; }
.apulse-status-warn   { background: #fffdf0; }

.apulse-check-status {
    width: 32px;
    text-align: center;
    padding-left: 20px;
}

.apulse-icon-pass { color: #28a745; font-weight: 700; }
.apulse-icon-warn { color: #856404; font-weight: 700; }
.apulse-icon-fail { color: #dc3545; font-weight: 700; }
.apulse-icon-info { color: #17a2b8; }

.apulse-check-name strong {
    display: block;
    margin-bottom: 2px;
}

.apulse-check-desc {
    color: #6c757d;
    font-size: 12px;
}

.apulse-check-message {
    color: #50575e;
}

.apulse-check-detail {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #6c757d;
    word-break: break-all;
}

.apulse-fix-details {
    margin-top: 8px;
}

.apulse-fix-summary {
    cursor: pointer;
    font-size: 12px;
    color: #0073aa;
    font-weight: 500;
}

.apulse-fix-code {
    margin: 6px 0 0;
    padding: 8px 12px;
    background: #f6f7f7;
    border-left: 3px solid #0073aa;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 0 3px 3px 0;
}

.apulse-check-score {
    text-align: right;
    white-space: nowrap;
    color: #9ea6ad;
    font-size: 12px;
    width: 60px;
}

/* -----------------------------------------------------------------------
   Report footer
   ----------------------------------------------------------------------- */
.apulse-report-footer {
    padding: 14px 28px;
    background: #f6f7f7;
    border-top: 1px solid #f0f0f1;
    font-size: 12px;
    color: #9ea6ad;
    text-align: center;
}

.apulse-report-footer strong {
    color: #50575e;
}

/* -----------------------------------------------------------------------
   Premium — blurred placeholder + CTA overlay
   ----------------------------------------------------------------------- */
.apulse-category-premium {
    position: relative;
}

.apulse-premium-lock {
    margin-right: 6px;
    font-style: normal;
}

.apulse-premium-body {
    position: relative;
    overflow: hidden;
}

.apulse-premium-blur {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    opacity: 0.6;
}

.apulse-premium-blur-bar {
    width: 60%;
    background: #dee2e6;
    filter: blur(3px);
}

.apulse-premium-blur-text {
    filter: blur(3px);
    color: #9ea6ad;
}

.apulse-premium-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    z-index: 5;
}

.apulse-premium-cta {
    text-align: center;
    padding: 20px 28px;
    max-width: 420px;
}

.apulse-premium-cta-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 8px;
}

.apulse-premium-cta-desc {
    font-size: 13px;
    color: #50575e;
    margin: 0 0 16px;
    line-height: 1.5;
}

.apulse-premium-cta-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #1d2327;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.apulse-premium-cta-btn:hover {
    background: #2c3338;
    color: #fff;
}

/* -----------------------------------------------------------------------
   No-scan / error states
   ----------------------------------------------------------------------- */
.apulse-no-scan {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

/* -----------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------- */
@media (max-width: 600px) {
    .apulse-report-header {
        padding: 16px;
        gap: 12px;
    }

    .apulse-percentile-banner {
        padding: 12px 16px;
        font-size: 13px;
    }

    .apulse-category-header {
        padding: 12px 16px;
    }

    .apulse-checks-table td {
        padding: 8px 10px;
    }

    .apulse-check-status {
        padding-left: 10px;
    }

    .apulse-progress-bar {
        width: 60px;
    }
}
