/* O'Toolkit SEO Content Generator - Custom Styles */

/* ============================================
   SEO Score Badge Styling
   ============================================ */

.o_seo_score_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9em;
}

.o_seo_score_excellent {
    background-color: #28a745;
    color: white;
}

.o_seo_score_good {
    background-color: #5cb85c;
    color: white;
}

.o_seo_score_average {
    background-color: #ffc107;
    color: #212529;
}

.o_seo_score_poor {
    background-color: #dc3545;
    color: white;
}

/* ============================================
   Content Generation States
   ============================================ */

.o_seo_content_state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.o_seo_content_state .o_state_generating {
    color: #17a2b8;
}

.o_seo_content_state .o_state_generated {
    color: #28a745;
}

.o_seo_content_state .o_state_failed {
    color: #dc3545;
}

/* Generating animation */
.o_seo_generating_spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #17a2b8;
    border-radius: 50%;
    border-top-color: transparent;
    animation: seo-spin 1s linear infinite;
}

@keyframes seo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   Content Preview Styling
   ============================================ */

.o_seo_content_preview {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.o_seo_content_preview h1,
.o_seo_content_preview h2,
.o_seo_content_preview h3,
.o_seo_content_preview h4 {
    color: #343a40;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.o_seo_content_preview h1:first-child,
.o_seo_content_preview h2:first-child {
    margin-top: 0;
}

.o_seo_content_preview p {
    margin-bottom: 1em;
    line-height: 1.6;
}

.o_seo_content_preview ul,
.o_seo_content_preview ol {
    margin-bottom: 1em;
    padding-left: 20px;
}

.o_seo_content_preview li {
    margin-bottom: 0.5em;
}

/* ============================================
   Image Gallery Styling
   ============================================ */

.o_seo_image_gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
}

.o_seo_image_card {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: box-shadow 0.2s ease;
}

.o_seo_image_card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.o_seo_image_card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.o_seo_image_card .o_image_info {
    padding: 12px;
}

.o_seo_image_card .o_image_state {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.o_seo_image_card .o_image_state_pending {
    background-color: #ffc107;
    color: #212529;
}

.o_seo_image_card .o_image_state_generating {
    background-color: #17a2b8;
    color: white;
}

.o_seo_image_card .o_image_state_completed {
    background-color: #28a745;
    color: white;
}

.o_seo_image_card .o_image_state_failed {
    background-color: #dc3545;
    color: white;
}

/* Image placeholder for pending/generating */
.o_seo_image_placeholder {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    color: #6c757d;
}

/* ============================================
   Kanban Card Styling
   ============================================ */

.o_kanban_record .o_seo_content_kanban {
    padding: 12px;
}

.o_seo_content_kanban .o_kanban_title {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #212529;
}

.o_seo_content_kanban .o_kanban_meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.o_seo_content_kanban .o_kanban_tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    background-color: #e9ecef;
    color: #495057;
}

.o_seo_content_kanban .o_kanban_progress {
    margin-top: 8px;
}

/* ============================================
   Template Selection Styling
   ============================================ */

.o_seo_template_selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    padding: 16px;
}

.o_seo_template_card {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.o_seo_template_card:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.o_seo_template_card.selected {
    border-color: #007bff;
    background-color: #e7f1ff;
}

.o_seo_template_card .o_template_name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #212529;
}

.o_seo_template_card .o_template_desc {
    font-size: 0.9em;
    color: #6c757d;
    line-height: 1.4;
}

.o_seo_template_card .o_template_meta {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    font-size: 0.85em;
    color: #495057;
}

/* ============================================
   Wizard Styling
   ============================================ */

.o_seo_wizard_step {
    padding: 20px;
}

.o_seo_wizard_step .o_step_header {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 16px;
    color: #343a40;
}

.o_seo_wizard_step .o_step_description {
    color: #6c757d;
    margin-bottom: 20px;
}

/* Keyword input styling */
.o_seo_keyword_input {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    min-height: 44px;
}

.o_seo_keyword_tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    font-size: 0.9em;
}

.o_seo_keyword_tag .o_remove {
    cursor: pointer;
    opacity: 0.8;
}

.o_seo_keyword_tag .o_remove:hover {
    opacity: 1;
}

/* ============================================
   Version History Styling
   ============================================ */

.o_seo_version_list {
    max-height: 300px;
    overflow-y: auto;
}

.o_seo_version_item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.o_seo_version_item:last-child {
    border-bottom: none;
}

.o_seo_version_item .o_version_info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.o_seo_version_item .o_version_number {
    font-weight: 600;
}

.o_seo_version_item .o_version_date {
    font-size: 0.85em;
    color: #6c757d;
}

.o_seo_version_item .o_version_actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   Cost Estimation Panel
   ============================================ */

.o_seo_cost_panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.o_seo_cost_panel .o_cost_header {
    font-weight: 600;
    margin-bottom: 12px;
    color: #343a40;
}

.o_seo_cost_panel .o_cost_row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9em;
}

.o_seo_cost_panel .o_cost_total {
    border-top: 1px solid #dee2e6;
    margin-top: 8px;
    padding-top: 8px;
    font-weight: 600;
}

/* ============================================
   SEO Analysis Panel
   ============================================ */

.o_seo_analysis_panel {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
}

.o_seo_analysis_item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.o_seo_analysis_item:last-child {
    border-bottom: none;
}

.o_seo_analysis_item .o_check_icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.o_seo_analysis_item .o_check_pass {
    color: #28a745;
}

.o_seo_analysis_item .o_check_warn {
    color: #ffc107;
}

.o_seo_analysis_item .o_check_fail {
    color: #dc3545;
}

.o_seo_analysis_item .o_check_text {
    flex-grow: 1;
}

.o_seo_analysis_item .o_check_suggestion {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 4px;
}

/* ============================================
   Wizard Step Indicator
   ============================================ */

.otk_wizard_steps {
    gap: 8px;
}

.otk_step_circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    flex-shrink: 0;
}

.otk_step_circle.otk_step_active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.otk_step_circle.otk_step_done {
    background-color: #28a745;
    color: white;
}

.otk_step_circle.otk_step_upcoming {
    background-color: #dee2e6;
    color: #6c757d;
}

/* ============================================
   Inline SEO Panel
   ============================================ */

.o_seo_inline_panel {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.o_seo_inline_panel .o_meta_indicator {
    display: inline-flex;
    align-items: center;
}

/* ============================================
   Meta Length Indicators
   ============================================ */

.o_meta_length_optimal {
    color: #28a745;
}

.o_meta_length_short {
    color: #ffc107;
}

.o_meta_length_long {
    color: #dc3545;
}

/* ============================================
   Diff View Styling
   ============================================ */

.o_seo_diff_view {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
    line-height: 1.5;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.o_seo_diff_view .o_diff_header {
    color: #6c757d;
    font-weight: 600;
    padding: 2px 4px;
    background-color: #e9ecef;
    margin-bottom: 2px;
}

.o_seo_diff_view .o_diff_section {
    color: #6f42c1;
    padding: 2px 4px;
    background-color: #f3e8ff;
    margin: 4px 0;
}

.o_seo_diff_view .o_diff_add {
    color: #155724;
    background-color: #d4edda;
    padding: 1px 4px;
    border-left: 3px solid #28a745;
}

.o_seo_diff_view .o_diff_remove {
    color: #721c24;
    background-color: #f8d7da;
    padding: 1px 4px;
    border-left: 3px solid #dc3545;
}

.o_seo_diff_view .o_diff_context {
    color: #495057;
    padding: 1px 4px;
    border-left: 3px solid transparent;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
    .o_seo_image_gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .o_seo_template_selector {
        grid-template-columns: 1fr;
    }

    .o_seo_content_preview {
        max-height: 300px;
    }

    .o_seo_step_indicator {
        flex-wrap: wrap;
        gap: 8px;
    }

    .o_seo_step_chevron {
        margin: 0 4px;
    }

    .o_seo_inline_panel .row {
        gap: 8px;
    }

    .o_seo_diff_view {
        max-height: 300px;
        font-size: 0.8em;
    }
}
