/* ==========================================================================
   Rankwell SEO Checklist - Admin & Metabox Styles
   ========================================================================== */

:root {
    --rwsc-primary: #2271b1;
    --rwsc-success: #00a32a;
    --rwsc-warning: #dba617;
    --rwsc-danger: #d63638;
    --rwsc-info: #72aee6;
    --rwsc-text-main: #1d2327;
    --rwsc-text-muted: #646970;
    --rwsc-border: #ccd0d4;
    --rwsc-bg-light: #f6f7f7;
}

/* --------------------------------------------------------------------------
   1. Dashboard Page Styles
   -------------------------------------------------------------------------- */
.rwsc-admin-dashboard {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}
.rwsc-dashboard-main {
    flex: 3;
}
.rwsc-dashboard-sidebar {
    flex: 1;
}
.rwsc-info-card {
    background: #fff;
    border: 1px solid var(--rwsc-border);
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rwsc-info-card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    color: var(--rwsc-text-main);
    font-weight: 600;
}
.rwsc-info-box {
    background: #fff;
    border: 1px solid var(--rwsc-border);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rwsc-info-box h3 {
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    font-weight: 600;
}
.rwsc-recent-posts {
    margin: 0;
    padding: 0;
    list-style: none;
}
.rwsc-recent-posts li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rwsc-recent-posts li:last-child {
    border-bottom: none;
}
.rwsc-recent-posts a {
    text-decoration: none;
    font-weight: 500;
}
.rwsc-keyword-badge {
    background: var(--rwsc-bg-light);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--rwsc-text-muted);
    border: 1px solid #e2e4e7;
}

/* --------------------------------------------------------------------------
   2. Settings Page Styles (With Toggle Switches)
   -------------------------------------------------------------------------- */
.rwsc-settings-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}
.rwsc-settings-main {
    flex: 3;
    background: #fff;
    padding: 24px;
    border: 1px solid var(--rwsc-border);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rwsc-settings-sidebar {
    flex: 1;
}
.rwsc-checks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Custom iOS-Style Toggle Switches */
.rwsc-check-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}
.rwsc-check-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 20px;
    background: #ccd0d4;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    outline: none;
    border: none;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    margin: 0;
}
.rwsc-check-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}
.rwsc-check-toggle input[type="checkbox"]:checked {
    background: var(--rwsc-primary);
}
.rwsc-check-toggle input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

/* --------------------------------------------------------------------------
   3. About Page Styles
   -------------------------------------------------------------------------- */
.rwsc-about-container {
    max-width: 800px;
    margin-top: 20px;
}
.rwsc-about-section {
    background: #fff;
    border: 1px solid var(--rwsc-border);
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rwsc-about-section h2 {
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    font-weight: 600;
}
.rwsc-about-section ul {
    list-style-type: disc;
    padding-left: 20px;
}
.rwsc-about-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   4. Editor Metabox Styles (Premium Polish for the actual checklist)
   -------------------------------------------------------------------------- */
.rwsc-metabox {
    font-size: 13px;
    line-height: 1.5;
}

.rwsc-keyword-input {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
}

.rwsc-keyword-input:focus {
    border-color: var(--rwsc-primary);
    box-shadow: 0 0 0 1px var(--rwsc-primary);
    outline: none;
}

.rwsc-actions {
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rwsc-auto-check-info {
    color: var(--rwsc-text-muted);
    font-style: italic;
}

/* Score Summary */
.rwsc-results-container {
    margin-top: 20px;
    background: var(--rwsc-bg-light);
    border: 1px solid #e2e4e7;
    border-radius: 6px;
    padding: 20px;
}

.rwsc-score-summary {
    text-align: center;
    margin-bottom: 20px;
}

.rwsc-overall-score {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--rwsc-text-main);
}

.rwsc-progress-bar {
    height: 8px;
    background: #dcdcde;
    border-radius: 10px;
    overflow: hidden;
    max-width: 250px;
    margin: 0 auto;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.rwsc-progress-fill {
    height: 100%;
    background: var(--rwsc-primary);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
}

.rwsc-score-good { color: var(--rwsc-success) !important; }
.rwsc-score-warning { color: var(--rwsc-warning) !important; }
.rwsc-score-poor { color: var(--rwsc-danger) !important; }

/* Checklist Items */
.rwsc-checklist {
    max-height: 350px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    margin-bottom: 20px;
}

.rwsc-check-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.rwsc-check-item:last-child {
    border-bottom: none;
}

.rwsc-check-info {
    flex: 1;
    padding-right: 15px;
}

.rwsc-check-label {
    font-weight: 600;
    color: var(--rwsc-text-main);
    margin-bottom: 4px;
    font-size: 13px;
}

.rwsc-check-description {
    font-size: 12px;
    color: var(--rwsc-text-muted);
}

/* Status Badges */
.rwsc-check-status, .rwsc-priority-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    white-space: nowrap;
}

.rwsc-status-pass .rwsc-check-status { background: #edfaef; color: var(--rwsc-success); border: 1px solid #a8e18a; }
.rwsc-status-warning .rwsc-check-status { background: #fcf9e8; color: var(--rwsc-warning); border: 1px solid #f7d1a0; }
.rwsc-status-fail .rwsc-check-status { background: #fcf0f1; color: var(--rwsc-danger); border: 1px solid #f5b2b5; }
.rwsc-status-info .rwsc-check-status { background: #f0f6fc; color: var(--rwsc-info); border: 1px solid #bfddf5; }

/* Actionable Suggestions */
.rwsc-suggestions {
    margin-top: 20px;
}

.rwsc-suggestions h4 {
    margin-top: 0;
    font-size: 14px;
    color: var(--rwsc-text-main);
    border-bottom: 1px solid #dcdcde;
    padding-bottom: 10px;
}

.rwsc-suggestion {
    background: #fff;
    border-left: 4px solid var(--rwsc-border);
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.rwsc-priority-high { border-left-color: var(--rwsc-danger); }
.rwsc-priority-medium { border-left-color: var(--rwsc-warning); }
.rwsc-priority-low { border-left-color: var(--rwsc-info); }

.rwsc-suggestion-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rwsc-suggestion-message {
    color: var(--rwsc-text-main);
    margin-bottom: 6px;
    line-height: 1.4;
}

.rwsc-suggestion-action {
    color: var(--rwsc-text-muted);
    font-style: italic;
    background: var(--rwsc-bg-light);
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px dashed #e2e4e7;
    margin-top: 8px;
}

.rwsc-suggestion-examples {
    margin-top: 10px;
    padding-left: 20px;
    color: var(--rwsc-text-muted);
}

.rwsc-suggestion-examples li {
    margin-bottom: 4px;
}

/* Loading & Messages */
.rwsc-loading {
    text-align: center;
    padding: 20px;
    color: var(--rwsc-text-muted);
}

.rwsc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(34, 113, 177, 0.2);
    border-top: 2px solid var(--rwsc-primary);
    border-radius: 50%;
    animation: rwsc-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

@keyframes rwsc-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.rwsc-score-value.updated {
    animation: rwsc-pop 0.4s ease;
    display: inline-block;
}

.rwsc-message {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
}

.rwsc-message-success { background: #edfaef; color: var(--rwsc-success); border: 1px solid #a8e18a; }
.rwsc-message-warning { background: #fcf9e8; color: var(--rwsc-warning); border: 1px solid #f7d1a0; }
.rwsc-message-error { background: #fcf0f1; color: var(--rwsc-danger); border: 1px solid #f5b2b5; }
.rwsc-message-info { background: #f0f6fc; color: var(--rwsc-info); border: 1px solid #bfddf5; }

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .rwsc-admin-dashboard,
    .rwsc-settings-container {
        flex-direction: column;
    }
    
    .rwsc-check-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .rwsc-check-status {
        align-self: flex-start;
    }
}