/**
 * Admin styles for WPO
 */

/* PageSpeed Badges */
.mustwp-badge {
    display: inline-block;
    padding: 0;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    width: 24px;
    height: 24px;
    line-height: 24px;
    margin-right: 8px;
    color: #000;
}

.mustwp-badge-good {
    background-color: #0c6;
}

.mustwp-badge-warning {
    background-color: #fa3;
}

.mustwp-badge-poor {
    background-color: #f33;
}

.mustwp-badge-na {
    background-color: #95979D;
    color: #000;
}

/* Budget Warning Indicator */
.mustwp-budget-warning {
    color: #d63638;
    font-weight: bold;
    margin-left: 2px;
}

/* Editor Panel Styles */
.mustwp-editor-panel-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e1e1e;
}

.mustwp-editor-score-row {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mustwp-editor-score-row:last-of-type {
    margin-bottom: 10px;
}

.mustwp-editor-score-label {
    font-weight: 600;
    color: #1e1e1e;
}

.mustwp-editor-timestamp {
    font-size: 12px;
    color: #646970;
    margin-top: 8px;
}

.mustwp-editor-error {
    margin-bottom: 12px;
    color: #d63638;
    font-size: 12px;
    padding: 8px;
    background: #fcf0f1;
    border: 1px solid #f0b7b8;
    border-radius: 3px;
}

/* Settings Page Styles */
.mustwp-settings-section {
    margin-bottom: 30px;
}

.mustwp-settings-section h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.mustwp-form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.mustwp-form-table td {
    padding: 15px 10px;
}

.mustwp-description {
    font-style: italic;
    color: #666;
    margin-top: 5px;
}

/* Audit Page Styles */
.mustwp-audit-container {
    max-width: 800px;
}

.mustwp-audit-controls {
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mustwp-progress-text {
    margin-left: 10px;
    font-style: italic;
    color: #666;
}

.mustwp-audit-results {
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 20px;
}

.mustwp-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.mustwp-stat-card {
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.mustwp-stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 5px;
}

.mustwp-stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

/* Audit Errors */
.mustwp-audit-errors {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.mustwp-audit-errors h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #856404;
}

.mustwp-audit-errors ul {
    margin: 0;
    padding-left: 20px;
}

/* Form Errors */
.mustwp-form-errors {
    margin: 15px 0;
}

/* Budget Presets */
.mustwp-budget-presets {
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.mustwp-budget-presets label {
    margin-right: 10px;
    font-weight: 600;
}

.mustwp-budget-presets .button {
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 782px) {
    .mustwp-editor-scores {
        flex-direction: column;
        gap: 8px;
    }
    
    .mustwp-summary-stats {
        grid-template-columns: 1fr;
    }
    
    .mustwp-form-table th,
    .mustwp-form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .mustwp-form-table th {
        border-bottom: none;
        font-weight: bold;
    }
}

/* Loading States */
.mustwp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mustwp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: mustwp-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes mustwp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.mustwp-success {
    color: #00a32a;
}

.mustwp-error {
    color: #d63638;
}

.mustwp-warning {
    color: #dba617;
}

/* Tooltip Styles */
.mustwp-tooltip {
    position: relative;
    cursor: help;
}

.mustwp-tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
}

/* Accessibility */
.mustwp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.mustwp-badge:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .mustwp-badge {
        border: 1px solid currentColor;
    }
    
    .mustwp-editor-score {
        border-width: 2px;
    }
}
