﻿
.tippy-box {
    font-size: 12px;
}

    .tippy-box.theme-small {
        font-size: 12px;
    }

/* ========== Cluster Analysis Specific Styles ========== */
.cluster-analysis-container {
    margin: 20px 0;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.element-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

    .element-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

.element-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.element-badges {
    display: flex;
    gap: 0.5rem;
}

.element-details {
    padding: 1rem;
}

.content-preview {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #7859ff;
}

.content-text {
    margin: 0.5rem 0 0 0;
    font-style: italic;
    color: #6c757d;
    line-height: 1.4;
}

.recommendation {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
}

.recommendation-text {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin: 0.5rem 0 0 0;
    color: #856404;
}

    .recommendation-text i {
        color: #f39c12;
        font-size: 1rem;
        margin-top: 2px;
    }

    .recommendation-text span {
        flex: 1;
        line-height: 1.4;
    }

/* ========== Alignment Heatmap Styles ========== */
.alignment-heatmap-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.heatmap-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1rem;
}

.summary-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.heatmap-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.status-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

    .status-breakdown .status-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.5rem;
    }

.status-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

    .status-color.optimal {
        background-color: #28a745;
    }

    .status-color.warning {
        background-color: #ffc107;
    }

    .status-color.problematic {
        background-color: #dc3545;
    }

.status-label {
    font-weight: 500;
    color: #495057;
}

/* ========== Group Status Enhanced Styles ========== */
.group-status {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

    .group-status h5 {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #e9ecef;
        color: #495057;
    }

.pending-issues ul,
.completed-items ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.pending-issues li {
    color: #721c24;
    margin-bottom: 0.25rem;
}

.completed-items li {
    color: #155724;
    margin-bottom: 0.25rem;
}

.visualization-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.viz-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    color: #666;
}

    .tab-btn:hover {
        background: #e9ecef;
        color: #333;
    }

    .tab-btn.active {
        background: white;
        border-bottom: 3px solid #7859ff;
        color: #7859ff;
    }

.viz-view {
    padding: 20px;
    background: white;
}

.scatter-controls {
    margin-top: 20px;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.analysis-btn {
    background: #7859ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin: 0 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.3s;
}

    .analysis-btn:hover {
        background: #0056b3;
    }

/* Scatter plot specific styles */
.scatter-point {
    transition: all 0.2s ease;
}

    .scatter-point:hover {
        filter: brightness(1.2);
    }

.grid {
    color: #e0e0e0;
}

.axis-label {
    font-family: Arial, sans-serif;
}

.stats-panel {
    font-family: Arial, sans-serif;
}

.visualization-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
    font-family: Arial, sans-serif;
}

.controls {
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
}

    .controls label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
    }

    .controls input[type="range"] {
        width: 150px;
    }

.point {
    cursor: pointer;
    transition: all 0.2s ease;
}

    .point:hover {
        stroke-width: 4px !important;
        filter: brightness(1.2);
    }

    .point.selected {
        stroke-width: 5px !important;
        stroke: #000 !important;
        filter: brightness(1.3);
    }

.connection {
    pointer-events: none;
}

.alignment-zone {
    pointer-events: none;
}

.zone-label {
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-anchor: middle;
    pointer-events: none;
}

.tooltip {
    display: none;
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    max-width: 350px;
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    border: 2px solid #444;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #555;
    padding-bottom: 8px;
}

.tooltip-title {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

    .status-badge.optimal {
        background: #28a745;
        color: white;
    }

    .status-badge.warning {
        background: #ffc107;
        color: black;
    }

    .status-badge.problematic {
        background: #dc3545;
        color: white;
    }

    .status-badge.ideal {
        background: #000080;
        color: white;
    }

.tooltip-content {
    line-height: 1.4;
}

.tooltip-section {
    margin-bottom: 10px;
}

    .tooltip-section:last-child {
        margin-bottom: 0;
    }

.tooltip-section-title {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
}

.tooltip-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #555;
}

.tooltip-metric {
    display: flex;
    flex-direction: column;
}

.tooltip-metric-label {
    font-size: 10px;
    color: #ccc;
    margin-bottom: 2px;
}

.tooltip-metric-value {
    font-weight: bold;
    color: #fff;
}

.click-info {
    position: fixed;
    top: 70px;
    right: 0px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px;
    border-radius: 8px;
    max-width: 300px;
    display: none;
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.click-info-close {
    float: right;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    margin-left: 10px;
}

#clusterPlot {
    border: 1px solid #ccc;
    background: #fafafa;
}

.summary-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #666;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

    .stat-value.optimal {
        color: #28a745;
    }

    .stat-value.warning {
        color: #ffc107;
    }

    .stat-value.problematic {
        color: #dc3545;
    }

.zone-legend {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

    .zone-legend h4 {
        margin: 0 0 10px 0;
        font-size: 14px;
        color: #333;
    }

.zone-legend-items {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.zone-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.zone-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid;
}

    .zone-legend-color.optimal {
        background: rgba(40, 167, 69, 0.2);
        border-color: #28a745;
    }

    .zone-legend-color.warning {
        background: rgba(255, 193, 7, 0.2);
        border-color: #ffc107;
    }

    .zone-legend-color.problematic {
        background: rgba(220, 53, 69, 0.2);
        border-color: #dc3545;
    }

    .zone-legend-color.ideal {
        background: #000080;
        border-color: #000080;
    }

.action-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.instructions {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 12px;
    color: #1565c0;
}

/* Selection styling for embedding points */
.content-embedding-point.selected,
.topic-embedding-point.selected {
    stroke: #FFD700 !important;
    stroke-width: 4px !important;
    filter: drop-shadow(0 0 8px #FFD700);
}

.content-embedding-point.selected {
    r: 12 !important; /* Larger when selected */
}

.topic-embedding-point.selected {
    r: 25 !important; /* Larger when selected */
}

/* Hover effects */
.content-embedding-point:hover,
.topic-embedding-point:hover {
    stroke-width: 3px !important;
    filter: brightness(1.2);
}

/* ========== Enhanced Metric Styles ========== */
.metrics-counts .metric.alignment.optimal {
    background-color: #e6ffe6;
    border: 1px solid #ccffcc;
    color: #28a745;
}

.metrics-counts .metric.alignment.warning {
    background-color: #fff3e6;
    border: 1px solid #ffe0cc;
    color: #fd7e14;
}

.metrics-counts .metric.alignment.problematic {
    background-color: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #dc3545;
}

.priority.problematic {
    background-color: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #dc3545;
}

.priority.warning {
    background-color: #fff3e6;
    border: 1px solid #ffe0cc;
    color: #fd7e14;
}

.priority.optimal {
    background-color: #e6ffe6;
    border: 1px solid #ccffcc;
    color: #28a745;
}

/* ========== Status Indicators (Unified) ========== */
.status-indicator,
.score-indicator,
.count-indicator {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease-in-out;
}

.status-indicator {
    min-width: 100px;
    justify-content: center;
}

.score-indicator, .count-indicator {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

.count-indicator {
    min-width: 60px;
    justify-content: center;
}

.status-success,
.count-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-danger,
.count-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.count-warning {
    background-color: #fff3cd;
    color: #856404;
}

/* Hover effect */
.status-indicator:hover,
.score-indicator:hover,
.count-indicator:hover {
    filter: brightness(95%);
    transition: filter 0.2s ease-in-out;
}

.status-indicator i,
.score-indicator i,
.count-indicator i {
    font-size: 14px;
}

/* ========== Status Items ========== */
.status-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
}

.status-item-complete, .completion-status-complete {
    background-color: #e6ffe6;
    color: #28a745;
}

.status-item-incomplete, .completion-status-incomplete {
    background-color: #ffe6e6;
    color: #dc3545;
}

.status-grid, .metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 15px 0;
}


/* ========== Metric Blocks ========== */
.metric {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

    .metric:last-child {
        border-bottom: none;
    }

    /* Unified metric label styling */
    .metric label,
    .metric:not(.metrics-counts .metric) label,
    .about-entity-section label {
        font-size: 0.9em;
        color: #666;
        font-weight: 600;
        margin-right: 0.5rem;
        min-width: 120px;
    }

/* ========== Citation Metrics ========== */
.metrics-counts {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

    .metrics-counts .metric {
        text-align: center;
        padding: 1rem;
        border-radius: 0.5rem;
        background-color: #f8f9fa;
        min-width: 150px;
        flex-grow: 1;
        border: 1px solid #dee2e6;
    }

        .metrics-counts .metric.valid {
            border-color: #28a745;
            background-color: #d4edda;
        }

        .metrics-counts .metric.invalid {
            border-color: #dc3545;
            background-color: #f8d7da;
        }

    .metrics-counts .count {
        font-size: 1.75rem;
        font-weight: bold;
        display: block;
        margin-bottom: 0.5rem;
    }


/* Highlighted metric variants */
.metrics-counts {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    flex-wrap: wrap;
}

    .metrics-counts .metric {
        text-align: center;
        padding: 10px;
        border-radius: 5px;
        flex: 1;
        margin: 5px;
        display: block;
    }

    .metrics-counts .count,
    .count {
        font-size: 1.75rem;
        font-weight: bold;
        display: block;
    }

    .metrics-counts .label,
    .priority-counts .label {
        font-size: 0.9em;
        color: #666;
        margin-top: 5px;
    }

    /*    .metrics-counts .label {
        font-size: 0.875rem;
        color: #6c757d;
    }*/

    /* Metric status types */
    .metrics-counts .metric.completion {
        background-color: #fff3e6;
        border: 1px solid #ffe0cc;
    }

    .metrics-counts .metric.quality {
        background-color: #e6f3ff;
        border: 1px solid #cce5ff;
    }

    .metrics-counts .metric.status.valid {
        background-color: #e6ffe6;
        border: 1px solid #ccffcc;
    }

    .metrics-counts .metric.status.invalid {
        background-color: #ffe6e6;
        border: 1px solid #ffcccc;
    }

    /* ========== Enhanced Metric Styles ========== */
    .metrics-counts .metric.alignment.optimal {
        background-color: #e6ffe6;
        border: 1px solid #ccffcc;
        color: #28a745;
    }

    .metrics-counts .metric.alignment.warning {
        background-color: #fff3e6;
        border: 1px solid #ffe0cc;
        color: #fd7e14;
    }

    .metrics-counts .metric.alignment.problematic {
        background-color: #ffe6e6;
        border: 1px solid #ffcccc;
        color: #dc3545;
    }

.priority.problematic {
    background-color: #ffe6e6;
    border: 1px solid #ffcccc;
    color: #dc3545;
}

.priority.warning {
    background-color: #fff3e6;
    border: 1px solid #ffe0cc;
    color: #fd7e14;
}

.priority.optimal {
    background-color: #e6ffe6;
    border: 1px solid #ccffcc;
    color: #28a745;
}

/* ========== Detailed Metrics Sections ========== */
.detailed-metrics,
.prioritized-action-metrics,
.improvement-suggestions {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.metrics-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease-in-out;
}

    .metrics-section:hover {
        box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    }

    .metrics-section h5 {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #e9ecef;
        color: #495057;
    }

    .metrics-section .value {
        font-weight: 600;
    }

        .metrics-section .value:not(.numeric) {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
        }

        .metrics-section .value[data-score^="0."] {
            background-color: #f8d7da;
            color: #721c24;
        }

        .metrics-section .value[data-score^="1."],
        .metrics-section .value[data-score^="0.9"],
        .metrics-section .value[data-score^="0.8"] {
            background-color: #d4edda;
            color: #155724;
        }

        .metrics-section .value[data-score^="0.7"],
        .metrics-section .value[data-score^="0.6"] {
            background-color: #fff3cd;
            color: #856404;
        }

/* ========== Priorities ========== */
.priority-counts {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    flex-wrap: wrap;
}

.priority {
    text-align: center;
    padding: 10px;
    border-radius: 5px;
    flex: 1;
    margin: 5px;
}

    .priority.high {
        background-color: #ffe6e6;
        border: 1px solid #ffcccc;
    }

    .priority.medium {
        background-color: #fff3e6;
        border: 1px solid #ffe0cc;
    }

    .priority.low {
        background-color: #e6ffe6;
        border: 1px solid #ccffcc;
    }

.count {
    font-size: 1.75rem;
    font-weight: bold;
    display: block;
}

.label {
    font-size: 0.9em;
    color: #666;
}

/* ========== Priority Summary ========== */
.priority-counts {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

    .priority-counts .priority {
        text-align: center;
        padding: 1rem;
        border-radius: 0.5rem;
        min-width: 150px;
        flex-grow: 1;
    }

        .priority-counts .priority.high {
            background-color: #f8d7da;
            border: 1px solid #dc3545;
        }

        .priority-counts .priority.medium {
            background-color: #fff3cd;
            border: 1px solid #ffc107;
        }

        .priority-counts .priority.low {
            background-color: #d4edda;
            border: 1px solid #28a745;
        }

    .priority-counts .count {
        font-size: 1.75rem;
        font-weight: bold;
        display: block;
        margin-bottom: 0.5rem;
    }

    .priority-counts .label {
        font-size: 0.875rem;
        color: #495057;
    }


@media (max-width: 768px) {
    .priority-counts {
        flex-direction: column;
    }

    .priority {
        margin: 5px 0;
    }

    .timeline-impact {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== Responsive Styles ========== */
@media (max-width: 768px) {
    .elements-grid {
        grid-template-columns: 1fr;
    }

    .heatmap-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .element-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .element-badges {
        align-self: flex-end;
    }

    .recommendation-text {
        align-items: flex-start;
    }

        .recommendation-text i {
            margin-top: 4px;
        }
}

/* ========== Print Styles ========== */
@media print {
    .no-print {
        display: none;
    }

    body {
        margin: 1in;
    }

    .cluster-analysis-container {
        padding: 0;
        margin: 0;
    }

    .element-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .elements-grid {
        grid-template-columns: 1fr;
    }

    .alignment-heatmap-section {
        background-color: white;
        border: 1px solid #dee2e6;
    }
}

<!-- ---------------------------------- -->
<!-- ADD: Enhanced CSS for new sections -->
<!-- ---------------------------------- -->

/* Page Similarity Overview */
.page-similarity-overview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    margin-bottom: 24px;
}

.page-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.page-metric {
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    /* Base page metric styling */
    .page-metric.metric-excellent {
        background-color: #e6ffe6; /* soft green */
        border: 1px solid #b2f0b2;
        color: #198754; /* Bootstrap success green */
    }

    .page-metric.metric-good {
        background-color: #f0fff0; /* very pale green */
        border: 1px solid #cdecc7;
        color: #28a745;
    }

    .page-metric.metric-warning {
        background-color: #fff8e6; /* pale amber */
        border: 1px solid #ffe0b2;
        color: #b85c00; /* amber/burnt orange */
    }

    .page-metric.metric-poor {
        background-color: #ffe6e6; /* pale red */
        border: 1px solid #ffcccc;
        color: #dc3545; /* Bootstrap danger */
    }

    .page-metric.metric-neutral {
        background-color: #f5f5f5; /* soft gray */
        border: 1px solid #dddddd;
        color: #6c757d; /* Bootstrap secondary gray */
    }


    .page-metric .metric-value {
        font-size: 1.75rem;
        font-weight: bold;
        margin: 8px 0;
        color: inherit;
    }

    .page-metric .metric-header {
        color: #666;
        margin-top: 5px;
    }

    .page-metric .metric-description {
        font-size: 0.9em;
        color: #666;
        margin-top: 5px;
    }
/* Similarity Comparison */
.similarity-comparison {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.comparison-row {
    display: flex;
    gap: 24px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.approach-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

.approach-value {
    font-weight: bold;
    font-size: 1.125rem;
}

.comparison-recommendation {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* Page Recommendations */
.page-recommendations {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    backdrop-filter: blur(10px);
}

.recommendations-list {
    margin: 0;
    padding-left: 20px;
}

.recommendation-item {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Page Quality Analysis */
.page-quality-analysis {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e9ecef;
}

.quality-metrics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

.quality-section h5 {
    margin-bottom: 16px;
    color: #495057;
    font-weight: 600;
}

.quality-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quality-label {
    width: 140px;
    font-size: 0.875rem;
    font-weight: 500;
}

.quality-progress {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.quality-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.quality-progress.optimal .quality-fill {
    background: #28a745;
}

.quality-progress.good .quality-fill {
    background: #17a2b8;
}

.quality-progress.warning .quality-fill {
    background: #ffc107;
}

.quality-progress.problematic .quality-fill {
    background: #dc3545;
}

.quality-percentage {
    width: 50px;
    text-align: right;
    font-weight: 600;
    font-size: 0.875rem;
}

.content-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-label {
    font-weight: 500;
    color: #6c757d;
}

.stat-value {
    font-weight: 600;
    color: #495057;
}

/* Element Type Breakdown */
.element-type-breakdown {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.element-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.element-type-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

.element-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

    .element-type-header h5 {
        margin: 0;
        color: #495057;
        font-size: 1rem;
        font-weight: 600;
    }

.element-count {
    font-size: 0.75rem;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

.element-type-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.type-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

/* ✅ FIXED: Specific font size for element type metrics */
.element-type-metrics .metric-label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.8rem; /* Smaller label */
}

.element-type-metrics .metric-value {
    font-weight: 600;
    font-size: 0.875rem; /* ✅ MUCH SMALLER: was 2rem, now 0.875rem */
}

    /* ✅ ALTERNATIVE: Even smaller for very compact display */
    .element-type-metrics .metric-value.compact {
        font-size: 0.75rem;
    }

/* Responsive adjustments */
@media (max-width: 768px) {
    .quality-metrics-grid {
        grid-template-columns: 1fr;
    }

    .comparison-row {
        flex-direction: column;
        gap: 12px;
    }

    .page-metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .element-types-grid {
        grid-template-columns: 1fr;
    }

    /* ✅ MOBILE: Even smaller fonts */
    .element-type-metrics .metric-value {
        font-size: 0.8rem;
    }

    .element-type-metrics .metric-label {
        font-size: 0.75rem;
    }
}

/* ✅ ADD: Scatter plot specific styles */
.whole-page-group {
    filter: drop-shadow(0 4px 8px rgba(0, 123, 255, 0.3));
}

.whole-page-point {
    cursor: pointer;
    transition: all 0.3s ease;
}

.scatter-legend {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.element-point {
    transition: all 0.2s ease;
}

.scatter-tooltip {
    max-width: 250px;
    line-height: 1.4;
}

/* ✅ ADD: Embedding space specific styles */
.whole-page-embedding-group {
    filter: drop-shadow(0 4px 12px rgba(0, 123, 255, 0.3));
}

.whole-page-embedding-point {
    cursor: pointer;
    transition: all 0.3s ease;
}

.whole-page-pulse {
    pointer-events: none;
}

.whole-page-connection {
    pointer-events: none;
}

.embedding-legend {
    pointer-events: none;
}

.embedding-element {
    transition: all 0.2s ease;
}

.embedding-tooltip {
    max-width: 280px;
    line-height: 1.4;
}

.topic-center {
    pointer-events: none;
}

/* Competitor Analysis Styles */
.competitor-analysis-section .metric-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

.competitor-analysis-section .metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
}

.competitor-analysis-section .metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.competitor-analysis-section .similarity-bar {
    position: relative;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.competitor-analysis-section .similarity-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc3545 0%, #ffc107 50%, #28a745 100%);
    transition: width 0.3s ease;
}

.competitor-analysis-section .similarity-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 500;
    color: #333;
    text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

.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 .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;
    }
}
