/**
 * SEO Optimization CSS
 * 
 * @package TriplyChild
 * @since 1.0.0
 */

/* SEO Meta Box Styles */
.triply-seo-meta-box {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.triply-seo-field {
    margin-bottom: 20px;
}

.triply-seo-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #1d2327;
}

.triply-seo-field input[type="text"],
.triply-seo-field input[type="url"],
.triply-seo-field textarea,
.triply-seo-field select {
    width: 100%;
    max-width: 600px;
    padding: 8px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.triply-seo-field textarea {
    height: 80px;
    resize: vertical;
}

.triply-seo-field .description {
    font-size: 13px;
    color: #646970;
    margin-top: 5px;
}

/* SEO Tabs */
.triply-seo-tabs {
    border-bottom: 1px solid #c3c4c7;
    margin-bottom: 20px;
}

.triply-seo-tab {
    display: inline-block;
    padding: 10px 15px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    margin-right: 5px;
    cursor: pointer;
    text-decoration: none;
    color: #1d2327;
    border-radius: 4px 4px 0 0;
    transition: all 0.2s ease;
}

.triply-seo-tab:hover {
    background: #fff;
    color: #1a73e8;
}

.triply-seo-tab.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
    color: #1a73e8;
    font-weight: 600;
}

.triply-seo-tab-content {
    display: none;
}

.triply-seo-tab-content.active {
    display: block;
}

/* SEO Preview */
.triply-seo-preview {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    padding: 15px;
    margin-top: 10px;
    border-radius: 4px;
}

.triply-seo-preview h4 {
    margin: 0 0 10px 0;
    color: #1d2327;
    font-size: 14px;
    font-weight: 600;
}

.triply-seo-preview .title {
    color: #1a73e8;
    font-size: 18px;
    text-decoration: none;
    margin-bottom: 5px;
    display: block;
    line-height: 1.3;
}

.triply-seo-preview .title:hover {
    text-decoration: underline;
}

.triply-seo-preview .url {
    color: #006621;
    font-size: 14px;
    margin-bottom: 5px;
}

.triply-seo-preview .description {
    color: #545454;
    font-size: 14px;
    line-height: 1.4;
}

/* Facebook Preview */
.facebook-preview {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.facebook-preview .og-image {
    width: 120px;
    height: 120px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.facebook-preview .og-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.facebook-preview .og-content {
    flex: 1;
}

.facebook-preview .og-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 5px;
    line-height: 1.3;
}

.facebook-preview .og-description {
    font-size: 14px;
    color: #545454;
    line-height: 1.4;
    margin-bottom: 5px;
}

.facebook-preview .og-url {
    font-size: 12px;
    color: #646970;
}

/* Twitter Preview */
.twitter-preview {
    margin-top: 10px;
}

.twitter-preview .twitter-image {
    width: 100%;
    max-width: 400px;
    height: 200px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.twitter-preview .twitter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twitter-preview .twitter-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 5px;
    line-height: 1.3;
}

.twitter-preview .twitter-description {
    font-size: 14px;
    color: #545454;
    line-height: 1.4;
    margin-bottom: 5px;
}

/* Character Count */
.triply-seo-character-count {
    font-size: 12px;
    color: #646970;
    margin-top: 5px;
}

.triply-seo-character-count.warning {
    color: #d63638;
    font-weight: 600;
}

.triply-seo-character-count.good {
    color: #00a32a;
    font-weight: 600;
}

/* SEO Score */
.seo-score {
    background: #f0f6fc;
    border: 1px solid #c3d9ff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.seo-score h4 {
    margin: 0 0 10px 0;
    color: #1a73e8;
    font-size: 16px;
}

.seo-score .good {
    color: #00a32a;
}

.seo-score .warning {
    color: #dba617;
}

.seo-score .poor {
    color: #d63638;
}

.score-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #d63638 0%, #dba617 50%, #00a32a 100%);
    transition: width 0.3s ease;
}

/* Keyword Analysis */
.keyword-analysis {
    background: #f0f6fc;
    border: 1px solid #c3d9ff;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

.keyword-analysis h4 {
    margin: 0 0 10px 0;
    color: #1a73e8;
    font-size: 14px;
}

.keyword-analysis ul {
    margin: 0;
    padding-left: 20px;
}

.keyword-analysis li {
    margin-bottom: 5px;
    font-size: 13px;
    color: #1d2327;
}

/* SEO Help */
.triply-seo-help {
    background: #e7f3ff;
    border: 1px solid #c3d9ff;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

.triply-seo-help h4 {
    margin: 0 0 10px 0;
    color: #1a73e8;
    font-size: 14px;
}

.triply-seo-help p {
    margin: 0 0 5px 0;
    font-size: 13px;
    color: #1d2327;
}

.triply-seo-help p:last-child {
    margin-bottom: 0;
}

/* Media Upload Button */
.media-upload-button {
    margin-left: 10px;
    padding: 6px 12px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    color: #1d2327;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-upload-button:hover {
    background: #fff;
    border-color: #1a73e8;
    color: #1a73e8;
}

/* SEO Columns in Post List */
.column-seo_title,
.column-seo_description,
.column-seo_focus_keyword {
    width: 15%;
}

.column-seo_title {
    font-weight: 600;
}

.column-seo_description {
    color: #646970;
    font-size: 13px;
}

.column-seo_focus_keyword {
    color: #1a73e8;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .triply-seo-field input[type="text"],
    .triply-seo-field input[type="url"],
    .triply-seo-field textarea,
    .triply-seo-field select {
        max-width: 100%;
    }
    
    .facebook-preview {
        flex-direction: column;
    }
    
    .facebook-preview .og-image {
        width: 100%;
        height: 200px;
    }
    
    .triply-seo-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .triply-seo-tab {
        margin-right: 10px;
    }
}

/* Schema Validation Styles */
.schema-validation {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.schema-validation.error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.schema-validation.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.schema-validation.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* SEO Performance Indicators */
.seo-performance {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.seo-performance-item {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.seo-performance-item h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #1d2327;
}

.seo-performance-item .value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.seo-performance-item .value.good {
    color: #00a32a;
}

.seo-performance-item .value.warning {
    color: #dba617;
}

.seo-performance-item .value.poor {
    color: #d63638;
}

.seo-performance-item .label {
    font-size: 12px;
    color: #646970;
}

/* SEO Suggestions */
.seo-suggestions {
    background: #f0f6fc;
    border: 1px solid #c3d9ff;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.seo-suggestions h4 {
    margin: 0 0 15px 0;
    color: #1a73e8;
    font-size: 14px;
}

.seo-suggestions ul {
    margin: 0;
    padding-left: 20px;
}

.seo-suggestions li {
    margin-bottom: 8px;
    font-size: 13px;
    color: #1d2327;
}

.seo-suggestions li:before {
    content: "•";
    color: #1a73e8;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* SEO Progress Bar */
.seo-progress {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.seo-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d63638 0%, #dba617 50%, #00a32a 100%);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* SEO Status Indicators */
.seo-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.seo-status.good {
    background: #d4edda;
    color: #155724;
}

.seo-status.warning {
    background: #fff3cd;
    color: #856404;
}

.seo-status.poor {
    background: #f8d7da;
    color: #721c24;
}

/* SEO Tooltip */
.seo-tooltip {
    position: relative;
    cursor: help;
}

.seo-tooltip:after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1d2327;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.seo-tooltip:hover:after {
    opacity: 1;
    visibility: visible;
}

/* SEO Loading States */
.seo-loading {
    opacity: 0.6;
    pointer-events: none;
}

.seo-loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a73e8;
    border-radius: 50%;
    animation: seo-spin 1s linear infinite;
}

@keyframes seo-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
