/**
 * Aipatch Security Scanner – Admin Styles
 *
 * @package AipatchSecurityScanner
 */

/* ---------------------------------------------------------------
   Layout & General
   --------------------------------------------------------------- */

.aipatch-wrap {
    max-width: 1200px;
}

.aipatch-page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 23px;
    font-weight: 400;
    margin: 10px 0 20px;
}

.aipatch-page-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.aipatch-page-desc {
    color: #50575e;
    margin-bottom: 20px;
    font-size: 14px;
}

.aipatch-section {
    margin-top: 20px;
}

.aipatch-section h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.aipatch-inline-form {
    display: inline-block;
    margin: 0;
}

/* ---------------------------------------------------------------
   Top Bar: Score + Actions
   --------------------------------------------------------------- */

.aipatch-top-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.aipatch-score-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.aipatch-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid #ddd;
}

.aipatch-score-excellent .aipatch-score-circle { border-color: #00a32a; background: #f0faf0; }
.aipatch-score-good .aipatch-score-circle { border-color: #72aee6; background: #f0f6fc; }
.aipatch-score-warning .aipatch-score-circle { border-color: #dba617; background: #fcf4e6; }
.aipatch-score-danger .aipatch-score-circle { border-color: #d63638; background: #fcecec; }

.aipatch-score-number {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.aipatch-score-excellent .aipatch-score-number { color: #00a32a; }
.aipatch-score-good .aipatch-score-number { color: #2271b1; }
.aipatch-score-warning .aipatch-score-number { color: #996800; }
.aipatch-score-danger .aipatch-score-number { color: #d63638; }

.aipatch-score-max {
    font-size: 11px;
    color: #8c8f94;
    line-height: 1;
}

.aipatch-score-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aipatch-score-label {
    font-size: 16px;
    font-weight: 600;
}

.aipatch-score-date {
    font-size: 12px;
    color: #8c8f94;
}

.aipatch-top-actions {
    margin-left: auto;
    text-align: right;
}

.aipatch-top-actions .button-hero {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.aipatch-top-actions .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.aipatch-next-scan {
    font-size: 12px;
    color: #8c8f94;
    margin-top: 6px;
}

/* ---------------------------------------------------------------
   Cards Grid
   --------------------------------------------------------------- */

.aipatch-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.aipatch-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s;
}

.aipatch-card:hover {
    border-color: #2271b1;
}

.aipatch-card-warning {
    border-left: 4px solid #dba617;
}

.aipatch-card-danger {
    border-left: 4px solid #d63638;
}

.aipatch-card-info {
    border-left: 4px solid #72aee6;
}

.aipatch-card-icon {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #8c8f94;
}

.aipatch-card-warning .aipatch-card-icon { color: #996800; }
.aipatch-card-danger .aipatch-card-icon { color: #d63638; }

.aipatch-card-content {
    display: flex;
    flex-direction: column;
}

.aipatch-card-value {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: #1d2327;
}

.aipatch-card-label {
    font-size: 12px;
    color: #8c8f94;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------------------------------------------------------------
   Badges
   --------------------------------------------------------------- */

.aipatch-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.6;
}

.aipatch-severity-critical {
    background: #d63638;
    color: #fff;
}

.aipatch-severity-high {
    background: #e65100;
    color: #fff;
}

.aipatch-severity-medium {
    background: #dba617;
    color: #1d2327;
}

.aipatch-severity-low {
    background: #72aee6;
    color: #fff;
}

/* ---------------------------------------------------------------
   Recommendations
   --------------------------------------------------------------- */

.aipatch-recommendations {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aipatch-recommendation {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 14px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

.aipatch-rec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 100%;
}

.aipatch-recommendation > p {
    flex: 1 1 100%;
    margin: 4px 0 0;
    color: #50575e;
    font-size: 13px;
}

.aipatch-recommendation .aipatch-inline-form {
    margin-left: auto;
}

/* ---------------------------------------------------------------
   All Clear
   --------------------------------------------------------------- */

.aipatch-all-clear {
    text-align: center;
    padding: 40px 20px;
    background: #f0faf0;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.aipatch-all-clear .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #00a32a;
}

.aipatch-all-clear p {
    font-size: 15px;
    color: #1d2327;
    margin-top: 8px;
}

/* ---------------------------------------------------------------
   Dismissed Issues
   --------------------------------------------------------------- */

.aipatch-dismissed-list {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.aipatch-dismissed-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dcdcde;
}

.aipatch-dismissed-item:last-child {
    border-bottom: none;
}

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */

.aipatch-table {
    margin-top: 0;
}

.aipatch-table th {
    font-weight: 600;
}

.aipatch-table td {
    vertical-align: middle;
}

.aipatch-table .description {
    margin-top: 4px;
    color: #8c8f94;
    font-size: 12px;
}

.aipatch-fix-available {
    color: #00a32a;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.aipatch-fix-available .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aipatch-source-badge {
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #50575e;
}

.aipatch-col-severity { width: 90px; }
.aipatch-col-event { width: 150px; }
.aipatch-col-date { width: 180px; }

/* ---------------------------------------------------------------
   Logs
   --------------------------------------------------------------- */

.aipatch-logs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 10px 16px;
    margin-bottom: 0;
}

.aipatch-severity-filters a {
    text-decoration: none;
    padding: 2px 4px;
}

.aipatch-severity-filters a.current {
    font-weight: 600;
    color: #1d2327;
}

.aipatch-log-severity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.aipatch-log-severity-critical { background: #d63638; color: #fff; }
.aipatch-log-severity-error { background: #e65100; color: #fff; }
.aipatch-log-severity-warning { background: #dba617; color: #1d2327; }
.aipatch-log-severity-info { background: #f0f0f1; color: #50575e; }

.aipatch-pagination {
    margin-top: 12px;
    text-align: right;
}

.aipatch-pagination .page-numbers {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    text-decoration: none;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    background: #fff;
}

.aipatch-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ---------------------------------------------------------------
   Hardening
   --------------------------------------------------------------- */

.aipatch-hardening-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aipatch-hardening-item {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 18px 20px;
}

.aipatch-hardening-active {
    border-left: 4px solid #00a32a;
}

.aipatch-hardening-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.aipatch-hardening-info {
    flex: 1;
}

.aipatch-hardening-info h3 {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.aipatch-hardening-info p {
    margin: 0 0 4px;
    color: #50575e;
    font-size: 13px;
}

.aipatch-hardening-warning {
    color: #996800 !important;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px !important;
}

.aipatch-hardening-warning .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.aipatch-hardening-settings {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f1;
}

.aipatch-hardening-settings ul {
    margin: 4px 0 0 20px;
    list-style: disc;
}

.aipatch-meta-label {
    font-weight: 600;
    font-size: 12px;
    color: #8c8f94;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Toggle Button */
.aipatch-toggle-btn {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    border-radius: 13px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
    vertical-align: middle;
}

.aipatch-toggle-on {
    background: #00a32a;
}

.aipatch-toggle-off {
    background: #c3c4c7;
}

.aipatch-toggle-slider {
    position: absolute;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.aipatch-toggle-on .aipatch-toggle-slider {
    left: 25px;
}

.aipatch-toggle-off .aipatch-toggle-slider {
    left: 3px;
}

/* ---------------------------------------------------------------
   Muted Box / Info Box
   --------------------------------------------------------------- */

.aipatch-muted-box {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px 20px;
    margin-top: 20px;
}

.aipatch-muted-box h3 {
    margin-top: 0;
}

.aipatch-muted-box p {
    color: #50575e;
    font-size: 13px;
}

/* ---------------------------------------------------------------
   Provider Status
   --------------------------------------------------------------- */

.aipatch-provider-status {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

.aipatch-provider-status h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.aipatch-provider-status ul {
    margin: 0;
    list-style: none;
    padding: 0;
}

.aipatch-provider-status li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
}

.aipatch-text-success { color: #00a32a; }
.aipatch-text-muted { color: #8c8f94; }

/* ---------------------------------------------------------------
   Settings
   --------------------------------------------------------------- */

.aipatch-settings-table th {
    width: 200px;
}

.aipatch-info-table {
    width: auto;
    border-collapse: collapse;
}

.aipatch-info-table td {
    padding: 4px 16px 4px 0;
}

/* ---------------------------------------------------------------
   Vulnerabilities Page
   --------------------------------------------------------------- */

#aipatch-vuln-table code {
    background: #f0f0f1;
    padding: 1px 5px;
    font-size: 12px;
}

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */

@media screen and (max-width: 782px) {
    .aipatch-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .aipatch-top-actions {
        margin-left: 0;
        text-align: left;
    }

    .aipatch-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .aipatch-hardening-header {
        flex-direction: column;
    }

    .aipatch-logs-toolbar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
