/**
 * CroPilot Health Dashboard Styles
 *
 * @package CroPilot
 * @since 2.6.0
 */

.cropilot-health-wrap {
    max-width: 1200px;
}
.cropilot-health-wrap h1 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cropilot-health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.cropilot-health-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}
.cropilot-health-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.cropilot-health-card h2,
.cropilot-health-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
}
.cropilot-health-card h3 {
    font-size: 14px;
    color: #1d2327;
}
.cropilot-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.cropilot-health-grid .cropilot-health-card {
    margin-bottom: 0;
}
.cropilot-status-overview {
    background: linear-gradient(135deg, #f0f6fc 0%, #fff 100%);
}
.cropilot-status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}
.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #c3c4c7;
}
.status-dot.healthy { background: #00a32a; }
.status-dot.warning { background: #dba617; }
.status-dot.critical { background: #d63638; }
.status-dot.degraded { background: #f0b849; }
.health-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}
.health-item:last-child {
    border-bottom: none;
}
.health-label {
    color: #50575e;
}
.health-value {
    font-weight: 500;
}
.health-value.good { color: #00a32a; }
.health-value.warning { color: #dba617; }
.health-value.critical { color: #d63638; }
.cropilot-issues-card .issue-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #fef7f1;
    border-left: 4px solid #dba617;
    margin-bottom: 8px;
    border-radius: 0 4px 4px 0;
}
.cropilot-issues-card .issue-item.critical {
    background: #fcf0f1;
    border-left-color: #d63638;
}
.cropilot-issues-card .issue-item .dashicons {
    flex-shrink: 0;
    margin-top: 2px;
}
.cropilot-anomalies-card .anomaly-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 8px;
}
.anomaly-item .anomaly-source {
    font-weight: 600;
    color: #1d2327;
}
.anomaly-item .anomaly-message {
    color: #50575e;
}
.no-issues, .no-anomalies {
    color: #00a32a;
    display: flex;
    align-items: center;
    gap: 6px;
}
.no-issues::before, .no-anomalies::before {
    content: '\f147';
    font-family: dashicons;
}
#health-recommendations ul {
    margin: 8px 0 0 20px;
}
#health-recommendations li {
    margin-bottom: 4px;
}
.cropilot-health-footer {
    color: #787c82;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#cropilot-refresh-health .dashicons-update {
    transition: transform 0.3s;
}
#cropilot-refresh-health.loading .dashicons-update {
    animation: spin 1s linear infinite;
}
/* Support & Diagnostics Section */
.cropilot-support-card .cropilot-support-actions {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}
.cropilot-support-card .button .dashicons {
    margin-right: 4px;
    vertical-align: text-bottom;
}
#live-test-results {
    margin-top: 16px;
    padding: 16px;
    background: #f6f7f7;
    border-radius: 4px;
}
#live-test-results h4 {
    margin: 0 0 12px;
}
#live-test-results .test-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
#live-test-results .test-status {
    font-weight: 600;
    font-size: 14px;
}
#live-test-results .test-status.passed { color: #00a32a; }
#live-test-results .test-status.failed { color: #d63638; }
#live-test-results .test-checks {
    margin: 0;
    padding: 0;
    list-style: none;
}
#live-test-results .test-checks li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
}
#live-test-results .test-checks li:last-child {
    border-bottom: none;
}
#live-test-results .test-checks .dashicons-yes-alt { color: #00a32a; }
#live-test-results .test-checks .dashicons-dismiss { color: #d63638; }
/* Modal */
.cropilot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cropilot-modal-content {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.cropilot-modal-content h3 {
    margin: 0 0 8px;
}
.cropilot-modal-content textarea {
    width: 100%;
    font-family: monospace;
    font-size: 12px;
    margin: 12px 0;
    resize: vertical;
}
.cropilot-modal-content .modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.button.loading .dashicons {
    animation: spin 1s linear infinite;
}
