/**
 * WP Scan - Public External Scan Styles
 *
 * Mobile-first CSS for the [cam_external_scan] shortcode.
 * Self-contained — no dependency on admin styles.
 *
 * @package Cyber_Audit_Manager
 * @subpackage WP_Scan
 * @since 2.7.1
 */

/* ============================================
   CSS Reset for shortcode container
   ============================================ */

.cam-external-scan-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1d2327;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.cam-external-scan-wrap *,
.cam-external-scan-wrap *::before,
.cam-external-scan-wrap *::after {
    box-sizing: border-box;
}

/* ============================================
   Form Container
   ============================================ */

.cam-ext-form-container {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 24px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cam-ext-form-title {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
}

.cam-ext-form-subtitle {
    margin: 0 0 24px 0;
    color: #646970;
    font-size: 14px;
}

/* ============================================
   Form Fields
   ============================================ */

.cam-ext-form-group {
    margin-bottom: 18px;
}

.cam-ext-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #1d2327;
}

.cam-ext-form-group label .required {
    color: #d63638;
}

.cam-ext-form-group input {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #8c8f94;
    border-radius: 6px;
    background: #fff;
    color: #1d2327;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cam-ext-form-group input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
    outline: none;
}

.cam-ext-form-group input::placeholder {
    color: #a7aaad;
}

/* ============================================
   Buttons
   ============================================ */

.cam-ext-form-actions {
    margin-top: 24px;
}

.cam-ext-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    width: 100%;
    text-align: center;
}

.cam-ext-btn:active {
    transform: scale(0.98);
}

.cam-ext-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.cam-ext-btn-primary {
    background: #2271b1;
    color: #ffffff;
}

.cam-ext-btn-primary:hover:not(:disabled) {
    background: #135e96;
}

.cam-ext-btn-secondary {
    background: #f0f0f1;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.cam-ext-btn-secondary:hover {
    background: #e0e0e0;
}

/* Spinner */
.cam-ext-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cam-ext-spin 0.6s linear infinite;
}

@keyframes cam-ext-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Error Message
   ============================================ */

.cam-ext-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 6px;
    color: #8a1116;
    font-size: 14px;
}

/* ============================================
   Results Container
   ============================================ */

.cam-ext-results-container {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 24px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cam-ext-results-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.cam-ext-results-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.cam-ext-score-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cam-ext-score-value {
    font-size: 28px;
    font-weight: 700;
}

.cam-ext-score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
}

/* Meta */
.cam-ext-meta {
    margin-bottom: 16px;
    font-size: 13px;
    color: #646970;
    word-break: break-all;
}

.cam-ext-meta-item strong {
    color: #1d2327;
}

/* ============================================
   Status Badges (same colors as admin)
   ============================================ */

.cam-ext-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cam-ext-status-pass {
    background: #d4edda;
    color: #155724;
}

.cam-ext-status-warn {
    background: #fff3cd;
    color: #856404;
}

.cam-ext-status-fail {
    background: #f8d7da;
    color: #721c24;
}

.cam-ext-status-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   Findings Table (hidden on mobile)
   ============================================ */

.cam-ext-table-wrap {
    display: none;
}

.cam-ext-findings-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    overflow: hidden;
}

.cam-ext-findings-table thead th {
    background: #f6f7f7;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: #1d2327;
    border-bottom: 2px solid #c3c4c7;
}

.cam-ext-findings-table tbody td {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: top;
}

.cam-ext-findings-table .col-status {
    width: 80px;
}

.cam-ext-findings-table .col-check {
    width: 25%;
}

/* Row severity colors (same as admin) */
.cam-ext-row-fail {
    background-color: rgba(255, 0, 0, 0.06) !important;
}

.cam-ext-row-warn {
    background-color: rgba(255, 165, 0, 0.05) !important;
}

.cam-ext-row-pass {
    background-color: rgba(0, 128, 0, 0.04) !important;
}

.cam-ext-row-info {
    background-color: rgba(0, 123, 255, 0.04) !important;
}

/* Alternating rows */
.cam-ext-row-alt {
    filter: brightness(0.98);
}

/* ============================================
   Findings Cards (visible on mobile)
   ============================================ */

.cam-ext-cards-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cam-ext-card {
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 14px 16px;
    border-left: 4px solid #dcdcde;
}

.cam-ext-card-fail {
    border-left-color: #d63638;
    background: rgba(255, 0, 0, 0.03);
}

.cam-ext-card-warn {
    border-left-color: #dba617;
    background: rgba(255, 165, 0, 0.03);
}

.cam-ext-card-pass {
    border-left-color: #00a32a;
    background: rgba(0, 128, 0, 0.03);
}

.cam-ext-card-info {
    border-left-color: #72aee6;
    background: rgba(0, 123, 255, 0.03);
}

.cam-ext-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cam-ext-card-check {
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
}

.cam-ext-card-body {
    font-size: 13px;
    color: #50575e;
    line-height: 1.5;
}

.cam-ext-card-label {
    font-weight: 600;
    color: #1d2327;
}

/* ============================================
   Results Footer
   ============================================ */

.cam-ext-results-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.cam-ext-results-footer .cam-ext-btn {
    width: auto;
    padding: 10px 24px;
    font-size: 14px;
}

/* ============================================
   Desktop / Tablet (768px+)
   ============================================ */

@media screen and (min-width: 768px) {
    .cam-ext-form-container {
        padding: 32px;
    }

    .cam-ext-form-title {
        font-size: 26px;
    }

    .cam-ext-results-container {
        padding: 32px;
    }

    .cam-ext-results-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cam-ext-btn {
        width: auto;
    }

    /* Show table, hide cards on desktop */
    .cam-ext-table-wrap {
        display: block;
    }

    .cam-ext-cards-wrap {
        display: none !important;
    }
}

/* ============================================
   Diagnostic Section
   ============================================ */

.cam-ext-diagnostic {
    padding: 16px 24px;
    margin: 0 0 8px;
}

.cam-ext-diag-score,
.cam-ext-diag-findings {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin: 0 0 8px;
}

.cam-ext-diag-score {
    font-weight: 500;
}

.cam-ext-diag-findings {
    font-weight: 400;
    font-style: italic;
    color: #6c757d;
}

/* ============================================
   Disclaimer Section
   ============================================ */

/* Checkbox Group */
.cam-ext-checkbox-group label:first-child {
    margin-bottom: 10px;
}

.cam-ext-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cam-ext-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 14px;
    color: #1d2327;
    cursor: pointer;
}

.cam-ext-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #2271b1;
    cursor: pointer;
}

.cam-ext-disclaimer {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 4px;
    padding: 20px 24px;
    margin: 24px 0 8px;
}

.cam-ext-disclaimer-title {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 12px;
}

.cam-ext-disclaimer-list {
    margin: 0 0 14px;
    padding-left: 20px;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.8;
}

.cam-ext-disclaimer-list li {
    margin-bottom: 2px;
}

.cam-ext-disclaimer-footer {
    font-size: 13px;
    color: #495057;
    font-style: italic;
    margin: 0;
}