/**
 * Frontend styles for Content Analytics & SEO Optimizer
 */

/* Content Insights Widget */
.cas-content-insights {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cas-insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cas-insights-header:hover {
    background: #f8f9fa;
}

.cas-insights-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.cas-toggle-insights {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
}

.cas-toggle-insights:hover {
    color: #495057;
}

.cas-toggle-insights .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.cas-insights-content {
    padding: 20px;
}

.cas-insights-content .seo-score,
.cas-insights-content .readability-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.cas-insights-content .seo-score strong,
.cas-insights-content .readability-score strong {
    font-size: 14px;
    color: #495057;
}

.cas-insights-content .score-good {
    color: #28a745;
    font-weight: 600;
}

.cas-insights-content .score-ok {
    color: #ffc107;
    font-weight: 600;
}

.cas-insights-content .score-poor {
    color: #dc3545;
    font-weight: 600;
}

.cas-insights-content .suggestions {
    margin-top: 15px;
}

.cas-insights-content .suggestions strong {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #495057;
}

.cas-insights-content .suggestions ul {
    margin: 0;
    padding-left: 20px;
}

.cas-insights-content .suggestions li {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #6c757d;
}

.cas-insights-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.cas-insights-footer small {
    color: #adb5bd;
    font-size: 12px;
}

/* Shortcode Styles */
.cas-analytics-shortcode {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cas-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.cas-metric {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.cas-metric h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cas-metric .metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #495057;
}

.cas-chart {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.cas-top-content {
    margin-top: 30px;
}

.cas-top-content h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.cas-top-content-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cas-content-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.cas-content-item:hover {
    background: #e9ecef;
}

.content-title {
    font-weight: 600;
    color: #495057;
    text-decoration: none;
    font-size: 16px;
}

.content-title:hover {
    color: #007bff;
    text-decoration: underline;
}

.content-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.content-stats .stat {
    text-align: center;
}

.content-stats .stat-number {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #495057;
}

.content-stats .stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* SEO Score Display */
.cas-seo-score-display {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.seo-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    color: #fff;
    font-weight: 700;
    position: relative;
}

.seo-score-circle::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    z-index: -1;
}

.seo-score-circle.good {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.seo-score-circle.ok {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.seo-score-circle.poor {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
}

.seo-score-circle .score-number {
    font-size: 32px;
    line-height: 1;
}

.seo-score-circle .score-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.seo-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.detail-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.detail-value {
    font-size: 18px;
    font-weight: 700;
    color: #495057;
}

.seo-suggestions {
    margin-top: 25px;
    text-align: left;
}

.seo-suggestions h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #495057;
}

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

.seo-suggestions li {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #6c757d;
}

/* Content Insights Shortcode */
.cas-content-insights-shortcode {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.insights-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.score-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 600;
}

.score-value {
    font-size: 18px;
    font-weight: 700;
}

.insights-suggestions,
.insights-keywords {
    margin-top: 25px;
}

.insights-suggestions h4,
.insights-keywords h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #495057;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.insights-suggestions ul,
.insights-keywords ul {
    margin: 0;
    padding-left: 20px;
}

.insights-suggestions li,
.insights-keywords li {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #6c757d;
}

.insights-keywords li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
}

.insights-keywords li strong {
    color: #495057;
}

.keyword-stats {
    font-size: 12px;
    color: #6c757d;
    background: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cas-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cas-content-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .content-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .seo-details {
        grid-template-columns: 1fr;
    }
    
    .insights-scores {
        grid-template-columns: 1fr;
    }
    
    .insights-keywords li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .keyword-stats {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .cas-metrics {
        grid-template-columns: 1fr;
    }
    
    .cas-analytics-shortcode,
    .cas-seo-score-display,
    .cas-content-insights-shortcode {
        padding: 15px;
    }
    
    .seo-score-circle {
        width: 100px;
        height: 100px;
    }
    
    .seo-score-circle .score-number {
        font-size: 24px;
    }
    
    .cas-insights-header,
    .cas-insights-content {
        padding: 15px;
    }
}

/* Animation Effects */
.cas-content-insights,
.cas-analytics-shortcode,
.cas-seo-score-display,
.cas-content-insights-shortcode {
    animation: cas-fadeIn 0.5s ease-in-out;
}

@keyframes cas-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .cas-content-insights,
    .cas-analytics-shortcode,
    .cas-seo-score-display,
    .cas-content-insights-shortcode {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cas-insights-header {
        cursor: default;
    }
    
    .cas-toggle-insights {
        display: none;
    }
    
    .cas-insights-content {
        display: block !important;
    }
}
