/* AI SEO Optimizer Admin Styles */

/* Post List Columns */
.ai-seo-score-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.ai-seo-score-bar {
    width: 50px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ai-seo-score-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.ai-seo-score-fill.poor { 
    background: linear-gradient(90deg, #dc3545, #c82333); 
}

.ai-seo-score-fill.fair { 
    background: linear-gradient(90deg, #fd7e14, #e55100); 
}

.ai-seo-score-fill.good { 
    background: linear-gradient(90deg, #ffc107, #ff8f00); 
}

.ai-seo-score-fill.very-good { 
    background: linear-gradient(90deg, #20c997, #17a2b8); 
}

.ai-seo-score-fill.excellent { 
    background: linear-gradient(90deg, #28a745, #20c896); 
}

.ai-seo-score-text {
    font-size: 12px;
    line-height: 1.2;
    min-width: 40px;
}

.ai-seo-actions {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.ai-seo-actions:hover {
    opacity: 1;
}

.ai-seo-recalculate {
    text-decoration: none;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.ai-seo-recalculate:hover {
    color: #0073aa;
    background: #f0f0f0;
}

/* Meta Box Styles */
#mflash-ai-seo-optimizer-meta-box {
    padding: 10px 0;
}

.ai-seo-score-display {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.ai-seo-score-meter {
    margin: 15px 0;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #e0e0e0;
    position: relative;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.score-circle[data-score="5"], 
.score-circle[data-score^="4"] {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.score-circle[data-score^="3"] {
    border-color: #20c997;
    box-shadow: 0 2px 8px rgba(32, 201, 151, 0.3);
}

.score-circle[data-score^="2"] {
    border-color: #ffc107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.score-circle[data-score^="1"] {
    border-color: #fd7e14;
    box-shadow: 0 2px 8px rgba(253, 126, 20, 0.3);
}

.score-circle[data-score^="0"] {
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.score-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.score-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Optimization Section */
.ai-seo-optimization {
    margin: 20px 0;
    padding: 15px;
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 5px;
}

.ai-seo-optimization h4 {
    margin-top: 0;
    color: #0073aa;
}

#ai-seo-optimize-btn {
    background: linear-gradient(135deg, #0073aa, #005a87);
    border: none;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#ai-seo-optimize-btn:hover {
    background: linear-gradient(135deg, #005a87, #004a70);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

#ai-seo-optimize-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#ai-seo-optimization-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

/* Manual Fields */
.ai-seo-manual-fields {
    margin: 20px 0;
}

.ai-seo-manual-fields h4 {
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

.ai-seo-char-count {
    float: right;
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.ai-seo-char-count.warning {
    color: #fd7e14;
    background: #fff3cd;
}

.ai-seo-char-count.error {
    color: #dc3545;
    background: #f8d7da;
}

.ai-seo-input {
    margin-bottom: 8px !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    transition: border-color 0.2s ease;
}

.ai-seo-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    outline: none;
}

/* Analysis Section */
.ai-seo-analysis {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.ai-seo-analysis h4 {
    margin-top: 0;
    color: #333;
}

.ai-seo-analysis-results {
    margin-top: 15px;
}

.ai-seo-analysis-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    border-left: 3px solid #e0e0e0;
    transition: all 0.2s ease;
}

.ai-seo-analysis-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ai-seo-analysis-icon {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.ai-seo-analysis-icon.good {
    color: #28a745;
}

.ai-seo-analysis-item:has(.ai-seo-analysis-icon.good) {
    border-left-color: #28a745;
}

.ai-seo-analysis-icon.warning {
    color: #ffc107;
}

.ai-seo-analysis-item:has(.ai-seo-analysis-icon.warning) {
    border-left-color: #ffc107;
}

.ai-seo-analysis-icon.error {
    color: #dc3545;
}

.ai-seo-analysis-item:has(.ai-seo-analysis-icon.error) {
    border-left-color: #dc3545;
}

.ai-seo-recommendations {
    margin-top: 15px;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 4px;
}

.ai-seo-recommendations h5 {
    margin: 0 0 10px 0;
    color: #0073aa;
}

.ai-seo-recommendations ul {
    margin: 0;
    padding-left: 20px;
}

.ai-seo-recommendations li {
    margin: 5px 0;
    line-height: 1.4;
}

/* Settings Page */
.ai-seo-test-api,
.ai-seo-bulk-actions {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-top: 20px;
}

.ai-seo-test-api h3,
.ai-seo-bulk-actions h3 {
    margin-top: 0;
}

/* Animations */
@keyframes ai-seo-pulse {
    0%, 100% { 
        transform: scale(1); 
        opacity: 1;
    }
    50% { 
        transform: scale(1.05); 
        opacity: 0.9;
    }
}

@keyframes ai-seo-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-seo-success {
    animation: ai-seo-fadeIn 0.3s ease;
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
}

.ai-seo-content-changed {
    position: relative;
}

.ai-seo-content-changed::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ffc107;
    border-radius: 50%;
    animation: ai-seo-pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 782px) {
    .ai-seo-score-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        min-width: auto;
    }
    
    .ai-seo-score-bar {
        width: 100%;
        max-width: 80px;
    }
    
    .score-circle {
        width: 60px;
        height: 60px;
    }
    
    .score-value {
        font-size: 14px;
    }
}

/* Tooltips */
.ai-seo-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 9999;
    white-space: nowrap;
    pointer-events: none;
}

.ai-seo-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #333;
}

/* Loading States */
.ai-seo-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.ai-seo-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #0073aa;
    animation: spin 1s linear infinite;
}

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

/* Print Styles */
@media print {
    .ai-seo-score-container,
    .ai-seo-optimization,
    .ai-seo-analysis {
        break-inside: avoid;
    }
}
