﻿
/* ========== Base Styles ========== */
.entity-recommendation-container {
    margin: 20px 0;
}

.metrics-counts, .priority-counts, .competitive-grid, .clusters-grid, .category-grid {
    margin: 1rem 0;
}

.competitive-metric-counts {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 1rem 0;
    gap: 1rem;
}

/* ========== Metrics Overview ========== */
.metrics-counts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

    .metric.valid {
        background-color: #d4edda;
        border-color: #28a745;
    }

    .metric.invalid {
        background-color: #f8d7da;
        border-color: #dc3545;
    }

    .metric .count {
        display: block;
        font-size: 1.75rem;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }

    .metric .label {
        font-size: 0.9rem;
        color: #6c757d;
    }

/* ========== Priority Summary ========== */
.priority-counts {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.priority {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
}

    .priority.high {
        background-color: #f8d7da;
        border: 2px solid #dc3545;
    }

    .priority.medium {
        background-color: #fff3cd;
        border: 2px solid #ffc107;
    }

    .priority.low {
        background-color: #d4edda;
        border: 2px solid #28a745;
    }

    .priority .count {
        font-size: 1.8rem;
        font-weight: bold;
        display: block;
        margin-bottom: 0.25rem;
    }

/* ========== Competitive Analysis ========== */
.competitive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.competitive-item {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px solid;
}

.competitive-universal {
    background-color: #d4edda;
    border-color: #28a745;
}

.competitive-common {
    background-color: #cce5ff;
    border-color: #007bff;
}

.competitive-moderate {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.competitive-rare {
    background-color: #f8f9fa;
    border-color: #6c757d;
}

.competitive-count {
    font-size: 1.5rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
}

.competitive-label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.competitive-percentage {
    font-size: 0.8rem;
    color: #6c757d;
}

.market-consensus {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* ========== Entity Clusters ========== */
.clusters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.cluster-card {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid;
}

.cluster-coretopic {
    border-left-color: #dc3545;
}

.cluster-supporting {
    border-left-color: #ffc107;
}

.cluster-peripheral {
    border-left-color: #28a745;
}

.cluster-opportunity {
    border-left-color: #17a2b8;
}

.cluster-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.cluster-type-badge {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.cluster-description {
    margin: 0.75rem 0;
    font-style: italic;
    color: #6c757d;
}

.cluster-keywords .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* ========== Entity Cards ========== */
.entity-card {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid;
}

.priority-high {
    border-left-color: #dc3545;
}

.priority-medium {
    border-left-color: #ffc107;
}

.priority-low {
    border-left-color: #28a745;
}

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.entity-text {
    margin: 0;
    font-size: 1.1rem;
}

.importance-score {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
}

.entity-stats {
    margin: 0.75rem 0;
}

    .entity-stats .badge {
        margin-right: 0.5rem;
        margin-bottom: 0.25rem;
    }

.implementation-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.wiki-link {
    color: #007bff;
    text-decoration: none;
}

    .wiki-link:hover {
        text-decoration: underline;
    }

/* ========== Topic Insights ========== */
.topic-insights {
    margin: 2rem 0;
}

.chart-container {
    margin: 1rem 0;
}

/* ========== Category Insights ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.category-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: box-shadow 0.3s ease;
}

    .category-card:hover {
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.category-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.category-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.competitor-metric-label {
    font-size: 0.8rem;
    color: #6c757d;
}

.competitor-metric-value {
    font-weight: bold;
}

/* ========== Quick Wins ========== */
.quick-wins-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.quick-win-card {
    background-color: #fff;
    border: 1px solid #28a745;
    border-radius: 0.5rem;
    padding: 1rem;
}

.quick-win-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.effort-badge {
    background-color: #d4edda;
    color: #155724;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

/* ========== Implementation Roadmap ========== */
.roadmap-phases {
    display: grid;
    gap: 1.5rem;
    margin: 1rem 0;
}

.phase-card {
    background-color: #fff;
    border-radius: 0.5rem;
    border: 2px solid;
    overflow: hidden;
}

    .phase-card.priority-high {
        border-color: #dc3545;
    }

    .phase-card.priority-medium {
        border-color: #ffc107;
    }

    .phase-card.priority-low {
        border-color: #28a745;
    }

.phase-header {
    background-color: #f8f9fa;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.phase-count {
    text-align: center;
}

.count-badge {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.count-label {
    font-size: 0.8rem;
    color: #6c757d;
}

.phase-actions {
    padding: 1rem;
}

.action-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

    .action-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.impact-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

    .impact-badge.high {
        background-color: #f8d7da;
        color: #721c24;
    }

    .impact-badge.medium {
        background-color: #fff3cd;
        color: #856404;
    }

/* ========== Executive Summary ========== */
.executive-summary {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.summary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-metric {
    text-align: center;
    padding: 1rem;
    background-color: #fff;
    border-radius: 0.5rem;
}

    .summary-metric .competitor-metric-value {
        display: block;
        font-size: 1.8rem;
        font-weight: bold;
        margin-bottom: 0.25rem;
    }

    .summary-metric .competitor-metric-assessment {
        display: block;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }

.competitor-metric-assessment.excellent {
    background-color: #d4edda;
    color: #155724;
}

.competitor-metric-assessment.good {
    background-color: #cce5ff;
    color: #004085;
}

.competitor-metric-assessment.needs-improvement {
    background-color: #fff3cd;
    color: #856404;
}

.competitor-metric-assessment.critical {
    background-color: #f8d7da;
    color: #721c24;
}

.key-insights {
    margin-top: 1.5rem;
}

.insight-item {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #dee2e6;
}

.insight-critical-gap {
    border-left-color: #dc3545;
}

.insight-opportunity {
    border-left-color: #28a745;
}

.insight-warning {
    border-left-color: #ffc107;
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.insight-importance {
    background-color: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.insight-description {
    margin-bottom: 0.5rem;
}

.insight-action {
    color: #6c757d;
    font-size: 0.9rem;
}

/* ========== Responsive Styles ========== */
@media (max-width: 768px) {
    .metrics-counts, .priority-counts, .competitive-grid, .category-grid, .quick-wins-list {
        grid-template-columns: 1fr;
    }

    .summary-metrics {
        grid-template-columns: 1fr;
    }

    .entity-header, .phase-header, .action-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .market-consensus {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========== Print Styles ========== */
@media print {
    .entity-recommendation-container {
        margin: 0;
        padding: 0;
    }

    .chart-container {
        height: 200px;
    }

    .entity-card, .cluster-card, .category-card, .quick-win-card {
        break-inside: avoid;
    }

    .tab-content > .tab-pane {
        display: block !important;
        opacity: 1 !important;
    }

    .nav-tabs {
        display: none;
    }
}

/* Competitor Analysis Styles */
.competitor-metric-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    width: 100%;
}

.competitor-metric-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: #007bff;
}

.competitor-metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    letter-spacing: 0.5px;
}

.competitor-analysis-section .legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.competitor-analysis-section .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.competitor-analysis-section .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.competitor-analysis-section .gap-card {
    background: #f8f9fa;
    transition: all 0.2s ease;
}

    .competitor-analysis-section .gap-card:hover {
        background: #e9ecef;
        transform: translateY(-2px);
    }

.competitor-analysis-section .threat-metric {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.competitor-analysis-section .threat-count {
    font-size: 1.5rem;
    font-weight: bold;
}

.competitor-analysis-section .threat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.competitor-analysis-section .saturation-bar {
    margin-bottom: 10px;
}

    .competitor-analysis-section .saturation-bar .progress {
        height: 8px;
        background: #e9ecef;
    }

.competitor-analysis-section .da-stats .stat-item {
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

    .competitor-analysis-section .da-stats .stat-item:last-child {
        border-bottom: none;
    }

.competitor-analysis-section .insight-item {
    border-left: 4px solid #ffc107;
    transition: all 0.2s ease;
}

    .competitor-analysis-section .insight-item:hover {
        background: #fff3cd !important;
        border-left-color: #f0ad4e;
    }

.competitor-analysis-section .cluster-card {
    background: #f8f9fa;
    transition: all 0.2s ease;
}

    .competitor-analysis-section .cluster-card:hover {
        background: #e9ecef;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

.competitor-analysis-section .competitor-tags .badge {
    font-size: 0.75rem;
}

.competitor-analysis-section .positioning-card,
.competitor-analysis-section .improvement-card {
    border-left: 4px solid #007bff;
}

.competitor-analysis-section .improvement-card {
    border-left-color: #ffc107;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .competitor-analysis-section .competitor-metric-value {
        font-size: 1.5rem;
    }

    .competitor-analysis-section .legend-items {
        flex-direction: column;
        gap: 8px;
    }

    .competitor-analysis-section .threat-count {
        font-size: 1.2rem;
    }
}

.missing-entities {
    padding: 1.5rem;
    margin: 2rem 0;
}

/* ========== Entity Badge Styles ========== */
.entities-covered, .entities-missing {
    max-width: 300px;
    min-width: 200px;
}

.entity-badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    overflow-y: auto;
    line-height: 1.2;
    max-height: 400px;
}

    /* Scrollbar styling for entity containers */
    .entity-badges-container::-webkit-scrollbar {
        width: 4px;
    }

    .entity-badges-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }

    .entity-badges-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }

        .entity-badges-container::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

/* Responsive adjustments */
@media (max-width: 1200px) {
    .entities-covered, .entities-missing {
        max-width: 250px;
        min-width: 180px;
    }
}

@media (max-width: 992px) {
    .entities-covered, .entities-missing {
        max-width: 200px;
        min-width: 150px;
    }

    .entity-badges-container {
        max-height: 100px;
    }
}

/* Topic Similarity Badge Classes */

/* ========== Missing Entity Badge Styles ========== */
.badge-missing-critical {
    background: linear-gradient(45deg, var(--ct-danger), #c82333); /* #ff7859 + darker red */
    color: white;
    font-weight: bold;
}

.badge-missing-high {
    background: linear-gradient(45deg, var(--ct-warning), #e55a00); /* #f7b84b + orange */
    color: white;
    font-weight: bold;
}

.badge-missing-medium {
    background: linear-gradient(45deg, var(--ct-info), var(--ct-purple)); /* info + purple */
    color: #212529;
    font-weight: 600;
}

.badge-missing-low {
    background: linear-gradient(45deg, var(--ct-gray-600), var(--ct-gray-700)); /* #98a6ad → #6c757d */
    color: white;
    opacity: 0.8;
}

.badge-missing-minimal {
    background-color: var(--ct-gray-200); /* #ecf2f5 */
    color: var(--ct-gray-600); /* #98a6ad */
    opacity: 0.6;
}

/* Priority indicator animations */
@keyframes pulse-critical {
    0% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }

    50% {
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.6);
    }

    100% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }
}

.badge-missing-critical:hover {
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.badge-missing-high:hover {
    box-shadow: 0 4px 8px rgba(253, 126, 20, 0.4);
}

/* More missing entities indicator */
.badge-entity-more-missing {
    background-color: #495057;
    color: white;
    font-size: 0.7rem;
    margin: 1px;
    padding: 2px 5px;
    display: inline-block;
    border-radius: 3px;
    font-style: italic;
    border: 1px dashed #6c757d;
}

/* Success message for complete coverage */
.text-success i {
    margin-right: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .missing-priority-indicator {
        font-size: 0.6em;
        padding: 0px 2px;
    }

    .badge-entity-missing i {
        display: none; /* Hide icons on mobile for space */
    }
}

/* ========== Score Indicators ========== */
.weighted-score-indicator {
    font-size: 0.65em;
    opacity: 0.9;
    margin-left: 4px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 1px 3px;
    border-radius: 2px;
}

.badge-entity-high .weighted-score-indicator {
    background-color: rgba(255, 255, 255, 0.3);
}

.badge-entity-medium .weighted-score-indicator {
    background-color: rgba(255, 255, 255, 0.25);
}

.badge-missing-critical .weighted-score-indicator {
    background-color: rgba(255, 255, 255, 0.3);
}

.badge-missing-high .weighted-score-indicator {
    background-color: rgba(255, 255, 255, 0.25);
}

/* ========== Animation ========== */
@keyframes pulse-critical {
    0% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }

    50% {
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.6);
    }

    100% {
        box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    }
}

/* ========== Hover Effects ========== */

.badge-entity-high:hover {
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.badge-entity-medium:hover {
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
}

.badge-missing-critical:hover {
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.badge-missing-high:hover {
    box-shadow: 0 4px 8px rgba(253, 126, 20, 0.4);
}

/* Coverage Indicators */
.coverage-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.coverage-bar {
    width: 80px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.coverage-progress {
    height: 100%;
    background: #ffc107;
    transition: width 0.3s ease;
}

.coverage-text {
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

/* Cluster Metrics Grid */
.cluster-metrics-simple {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 1.1rem;
}

.metric-label {
    color: #6c757d;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value {
    font-weight: bold;
    color: #7859ff
}

    .metric-value.covered {
        color: #5cc9a7;
    }

    .metric-value.missing {
        color: #ff7859;
    }

    .metric-value.validated {
        color: #ffc431;
    }

    .metric-value.opportunity-critical {
        color: #ff7859;
    }

    .metric-value.opportunity-high {
        color: #fd7e14;
    }

    .metric-value.opportunity-medium {
        color: #ffc107;
    }

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-excellent {
    background: #d4edda;
    color: #155724;
}

.status-good {
    background: #cce5ff;
    color: #004085;
}

.status-fair {
    background: #fff3cd;
    color: #856404;
}

.status-critical {
    background: #f8d7da;
    color: #721c24;
}

/* Entity Sections */
.entity-breakdown {
    margin: 1rem 0;
}

.entity-section {
    margin: 0.75rem 0;
}

.entity-section-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.badge-covered {
    background: #28a745;
    color: white;
}

.badge-missing {
    color: white;
}

/* Recommendations */
.cluster-recommendations {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

.recommendation-item {
    border-left: 3px solid;
    padding: 0.5rem;
    margin: 0.5rem 0;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

    .recommendation-item.priority-critical {
        border-left-color: #dc3545;
    }

    .recommendation-item.priority-high {
        border-left-color: #fd7e14;
    }

    .recommendation-item.priority-medium {
        border-left-color: #ffc107;
    }

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.recommendation-title {
    font-weight: bold;
    font-size: 0.9rem;
}

.recommendation-impact {
    font-size: 0.8rem;
    color: #6c757d;
}

.recommendation-description {
    font-size: 0.8rem;
    margin: 0.25rem 0;
}

.suggested-entities .badge {
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

/* Validated entities */
.badge-covered-validated {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: 2px solid #1e7e34;
}

.badge-covered-competitive {
    background: #28a745;
    color: white;
    border: 2px solid #1e7e34;
}

.badge-covered-strong {
    background: #17a2b8;
    color: white;
}

.badge-covered-basic {
    background: #6c757d;
    color: white;
}

.validated-icon {
    font-size: 0.7em;
    margin-left: 3px;
    color: #fff;
    opacity: 0.9;
}

.competitor-metric-value.validated {
    color: #28a745;
    font-weight: bold;
}

.validation-badge {
    background: #d4edda;
    color: #155724;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: inline-block;
}

/* Roadmap Timeline Styles */
.roadmap-header {
    margin-bottom: 2rem;
}

.overview-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.overview-metric {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

    .overview-metric .competitor-metric-value {
        font-size: 1.5rem;
        font-weight: bold;
        color: #007bff;
        display: block;
    }

.roadmap-timeline {
    position: relative;
}

.phase-container {
    display: flex;
    margin: 2rem 0;
    position: relative;
}

.phase-timeline-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 2rem;
    min-width: 60px;
}

.timeline-line {
    width: 3px;
    height: 40px;
    background: #dee2e6;
    margin-bottom: 10px;
}

.phase-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.phase-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    border-left: 5px solid;
}

    .phase-card.priority-critical {
        border-left-color: #dc3545;
    }

    .phase-card.priority-high {
        border-left-color: #fd7e14;
    }

    .phase-card.priority-medium {
        border-left-color: #ffc107;
    }

.phase-header {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.phase-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.phase-priority {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

    .phase-priority.priority-critical {
        background: #dc3545;
        color: white;
    }

    .phase-priority.priority-high {
        background: #fd7e14;
        color: white;
    }

.phase-meta {
    display: flex;
    gap: 1rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.phase-metrics {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.phase-metric {
    text-align: center;
}

    .phase-metric .competitor-metric-value {
        font-size: 1.3rem;
        font-weight: bold;
        color: #007bff;
        display: block;
    }

/* Phase Outcomes */
.phase-outcomes {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.outcome-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Entity Recommendations */
.phase-entities {
    padding: 1.5rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.entities-title {
    color: #495057;
    margin-bottom: 1rem;
}

.entity-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.entity-recommendation-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

    .entity-recommendation-card:hover {
        background: #e9ecef;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.entity-name {
    font-weight: bold;
    color: #495057;
}

.entity-score {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.entity-metrics {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

    .entity-metrics .metric {
        font-size: 0.8rem;
        color: #6c757d;
    }

.competitive-context {
    font-size: 0.8rem;
    font-style: italic;
    color: #6c757d;
}

/* Action Items Enhanced */
.phase-actions {
    padding: 1.5rem;
}

.action-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border-left: 4px solid;
}

    .action-item.priority-critical {
        border-left-color: #dc3545;
    }

    .action-item.priority-high {
        border-left-color: #fd7e14;
    }

.action-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.action-type {
    background: #e9ecef;
    color: #495057;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.action-badges {
    display: flex;
    gap: 0.5rem;
}

.effort-badge {
    background: #6c757d;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.steps-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.step-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.step-time {
    background: #007bff;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
}

/* Success Metrics */
.success-metrics {
    margin-top: 1rem;
    padding: 1rem;
    background: #d4edda;
    border-radius: 8px;
}

.metrics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.success-metric {
    background: white;
    color: #155724;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Phase Resources */
.phase-resources {
    padding: 1.5rem;
    background: #f8f9fa;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

    .resource-item:hover {
        background: #e9ecef;
        transform: translateY(-1px);
    }

/* Implementation Tips */
.implementation-tips {
    margin-top: 2rem;
    padding: 2rem;
    background: #fff3cd;
    border-radius: 12px;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.tip-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .phase-container {
        flex-direction: column;
    }

    .phase-timeline-connector {
        flex-direction: row;
        margin-bottom: 1rem;
        margin-right: 0;
    }

    .timeline-line {
        width: 40px;
        height: 3px;
        margin-bottom: 0;
        margin-right: 10px;
    }

    .entity-recommendations {
        grid-template-columns: 1fr;
    }

    .phase-metrics {
        flex-wrap: wrap;
    }
}

/* Priority Groups */
.priority-group {
    margin: 1rem 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.priority-header {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .priority-header.clickable:hover {
        background: #e9ecef;
    }

    .priority-header h7 {
        font-size: 0.9rem;
        font-weight: bold;
        color: #495057;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

.priority-description {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-left: 1.5rem;
}

.toggle-icon {
    transition: transform 0.2s ease;
}

    .toggle-icon.rotated {
        transform: rotate(90deg);
    }

/* Critical Opportunities */
.critical-opportunities {
    border-left: 4px solid #dc3545;
}

    .critical-opportunities .priority-header {
        background: #f8d7da;
        color: #721c24;
    }

/* High Priority */
.high-opportunities {
    border-left: 4px solid #fd7e14;
}

    .high-opportunities .priority-header {
        background: #ffeaa7;
        color: #856404;
    }

/* Medium Priority */
.medium-opportunities {
    border-left: 4px solid #ffc107;
}

.collapsible .entity-badges.collapsed {
    max-height: 60px;
    overflow: hidden;
    position: relative;
}

    .collapsible .entity-badges.collapsed::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: linear-gradient(transparent, #fff);
    }

/* Quick Wins */
.quick-wins-summary {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.quick-wins-header {
    color: #155724;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.badge-quick-win {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    animation: pulse-quick-win 3s infinite;
}

@keyframes pulse-quick-win {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Opportunity Summary */
.opportunity-summary {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: normal;
    margin-left: 0.5rem;
}

/* Niche Entities */
.niche-opportunities {
    margin-top: 1rem;
}

.badge-more-collapsed {
    background: #e9ecef;
    color: #6c757d;
    border: 1px dashed #ced4da;
}

/* Show/Hide Animation */
.entity-badges {
    padding: 1rem;
    transition: max-height 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .priority-header {
        padding: 0.5rem;
    }

    .priority-description {
        display: block;
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .badge-missing {
        font-size: 0.7rem;
    }
}

.competitor-analysis-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.analysis-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.visualization-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.competitor-controls {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    align-items: center;
}

.click-info-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 400px;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .close-btn:hover {
        background: rgba(255,255,255,0.1);
        border-radius: 50%;
    }

/* Competitor point styles */
.competitor-point.selected {
    stroke: #ffeb3b !important;
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 8px rgba(255, 235, 59, 0.8));
}

.topic-center-point.selected,
.your-page-point.selected {
    stroke: #ffeb3b !important;
    stroke-width: 5 !important;
    filter: drop-shadow(0 0 12px rgba(255, 235, 59, 0.8));
}

/* Responsive design */
@media (max-width: 768px) {
    .click-info-panel {
        width: 90vw;
        right: 5vw;
        max-height: 70vh;
    }
}

.entity-comparison-section .stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    height: 100%;
}

.competitor-analysis-section .stat-card {
    font-size: 1.75rem;
    font-weight: bold;
}

.competitor-analysis-section .stat-label {
    font-size: 0.9rem;
    font-weight: normal;
    color: #6c757d;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
}

.competitor-comparison-card {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.competitor-header h6 {
    color: #495057;
}

.badge-lg {
    font-size: 14px;
    padding: 8px 16px;
}

.mini-stat {
    text-align: center;
    padding: 15px 10px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.mini-stat-number {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.mini-stat-label {
    font-size: 12px;
    margin-top: 4px;
}

.mini-stat.covered {
    border-left: 4px solid #28a745;
}

.mini-stat.missing {
    border-left: 4px solid #dc3545;
}

.mini-stat.unique {
    border-left: 4px solid #17a2b8;
}

.mini-stat.total {
    border-left: 4px solid #6c757d;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.entity-comparison-item {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

    .entity-comparison-item.shared {
        border-left: 4px solid #28a745;
    }

    .entity-comparison-item.missing {
        border-left: 4px solid #dc3545;
    }

    .entity-comparison-item.unique {
        border-left: 4px solid #17a2b8;
    }

.entity-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    position: relative;
}

.badge-shared {
    background: #28a745;
    color: white;
}

.badge-missing {
    background: #ff7859;
    color: white;
}

.badge-unique {
    background: #17a2b8;
    color: white;
}

.entity-details {
    margin-top: 8px;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
}

.score {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 8px;
}

.badge-entity-high {
    background-color: #78c350;
    color: white;
}

.badge-entity-medium {
    background-color: #ffc107;
    ;
    color: #212529;
}

.badge-entity-low {
    background-color: #b0bfe5;
    color: white;
}

.badge-entity-minimal {
    background-color: #98a6ad;
    color: white;
}

.badge-entity-critical {
    background-color: #ff7859;
    color: white;
}

.weighted-score-indicator {
    font-size: 0.75em;
    opacity: 0.8;
    margin-left: 4px;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.entity-detail-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: white;
    height: 100%;
}

    .entity-detail-card.covered {
        border-left: 4px solid #28a745;
    }

    .entity-detail-card.missing {
        border-left: 4px solid #dc3545;
    }

    .entity-detail-card.priority-critical {
        background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    }

    .entity-detail-card.priority-high {
        background: linear-gradient(135deg, #fff8f5 0%, #ffffff 100%);
    }

.entity-name {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.entity-stats {
    color: #6c757d;
    line-height: 1.4;
}

.entities-covered .badge,
.entities-missing .badge {
    padding: 6px 6px;
    font-size: 0.75em;
    display: inline-block;
}