/**
 * SocialDataCharts - Analytics Dashboard Styles
 * Responsive, minimal-scroll design optimized for data visualization
 */

/* ============================================
   Dashboard Layout - Full viewport utilization
   ============================================ */
.analytics-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px); /* Account for nav */
    padding: 16px;
    gap: 16px;
    overflow: hidden;
}

/* ============================================
   Channel Selector - Max 2 rows, then scroll
   ============================================ */
.channel-selector {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
    flex-shrink: 0;
}

#channel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 88px; /* Approx 2 rows of chips (36px + gap)*2 + padding */
    overflow-y: hidden;
    overflow-x: auto;
    flex: 1;
    align-content: flex-start;
}

/* When chips overflow 2 rows, enable horizontal scroll container */
#channel-chips.overflow-scroll {
    flex-wrap: nowrap;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
}

.channel-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default, #dee2e6);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.channel-chip:hover {
    border-color: var(--primary, #0d6efd);
}

.channel-chip.active {
    background: var(--primary, #0d6efd);
    border-color: var(--primary, #0d6efd);
    color: white;
}

.channel-chip img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.channel-chip .name {
    font-weight: 500;
    font-size: 14px;
}

.channel-chip .subs {
    font-size: 12px;
    opacity: 0.7;
}

/* Channel Selector Right Side Controls */
.channel-selector > .data-availability-badge {
    margin-left: auto;
    flex-shrink: 0;
}

.channel-selector .layout-controls {
    flex-shrink: 0;
}

/* Scrollbar styling for channel chips */
#channel-chips::-webkit-scrollbar {
    height: 4px;
}

#channel-chips::-webkit-scrollbar-track {
    background: var(--bg-tertiary, #e9ecef);
    border-radius: 2px;
}

#channel-chips::-webkit-scrollbar-thumb {
    background: var(--text-secondary, #6c757d);
    border-radius: 2px;
}

/* Last Updated Display */
.last-updated-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary, #6c757d);
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default, #dee2e6);
    border-radius: 6px;
    white-space: nowrap;
    margin-left: auto;
    margin-right: 8px;
}

.last-updated-display i {
    color: var(--primary, #0d6efd);
}

/* ============================================
   GridStack Layout
   ============================================ */
.grid-stack {
    flex: 1;
    overflow-y: auto;
    background: transparent;
}

/* Hide scrollbar but keep functionality */
.grid-stack::-webkit-scrollbar {
    width: 6px;
}

.grid-stack::-webkit-scrollbar-thumb {
    background: var(--border-default, #dee2e6);
    border-radius: 3px;
}

/* GridStack item styling */
.grid-stack-item {
    cursor: default;
}

.grid-stack-item.ui-draggable-dragging {
    cursor: grabbing;
    z-index: 1000 !important;
    opacity: 0.9;
}

.grid-stack-item-content {
    height: 100%;
    overflow: hidden;
}

/* Drag placeholder - shows where card will drop */
.grid-stack-placeholder {
    background: rgba(13, 110, 253, 0.15) !important;
    border: 2px dashed var(--primary, #0d6efd) !important;
    border-radius: 12px;
}

.grid-stack-placeholder > .placeholder-content {
    background: transparent !important;
    border: none !important;
}

/* Item being dragged */
.grid-stack > .grid-stack-item.ui-draggable-dragging {
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

/* Resize handles */
.grid-stack-item > .ui-resizable-handle {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.grid-stack-item:hover > .ui-resizable-handle {
    opacity: 1;
}

.grid-stack-item > .ui-resizable-se {
    width: 20px;
    height: 20px;
    right: 4px;
    bottom: 4px;
    background: none;
}

.grid-stack-item > .ui-resizable-se::after {
    content: '';
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--border-default, #dee2e6);
    border-bottom: 2px solid var(--border-default, #dee2e6);
}

/* Layout Controls */
.layout-controls {
    display: flex;
    gap: 8px;
}

.layout-controls .btn {
    padding: 6px 10px;
}

/* ============================================
   Analytics Cards
   ============================================ */
.analytics-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default, #dee2e6);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}

/* Drag handle styling */
.analytics-card .card-header {
    cursor: grab;
    padding: 4px 0;
    margin: -4px 0 8px 0;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.analytics-card .card-header:hover {
    background-color: var(--bg-secondary, #f8f9fa);
}

.analytics-card .card-header:active {
    cursor: grabbing;
    background-color: var(--bg-secondary, #e9ecef);
}

.analytics-card.span-2 {
    grid-column: span 2;
}

.analytics-card.span-3 {
    grid-column: span 3;
}

@media (max-width: 768px) {
    .analytics-card.span-2,
    .analytics-card.span-3 {
        grid-column: span 1;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    background: transparent;
    border: 1px solid var(--border-default, #dee2e6);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary, #6c757d);
}

.card-action-btn:hover {
    background: var(--bg-secondary, #f8f9fa);
}

.card-action-btn.active {
    background: var(--primary, #0d6efd);
    border-color: var(--primary, #0d6efd);
    color: white;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ============================================
   KPI Cards - Large number display
   ============================================ */
.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #212529);
    line-height: 1.2;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
}

.kpi-change.positive {
    color: var(--success, #198754);
}

.kpi-change.negative {
    color: var(--danger, #dc3545);
}

.kpi-label {
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
    margin-top: 4px;
}

/* ============================================
   Charts Container
   ============================================ */
.chart-container {
    flex: 1;
    min-height: 120px;
    position: relative;
}

.chart-container canvas {
    max-height: 100%;
}

/* ============================================
   Mini Sparkline Charts
   ============================================ */
.sparkline-container {
    height: 40px;
    margin-top: 8px;
}

/* ============================================
   Data Tables (compact)
   ============================================ */
.compact-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}

.compact-table th {
    text-align: left;
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-default, #dee2e6);
    font-weight: 600;
    color: var(--text-secondary, #6c757d);
}

.compact-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-light, #f1f3f4);
}

.compact-table tr:last-child td {
    border-bottom: none;
}

.compact-table .video-title {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-table .number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Progress Bars
   ============================================ */
.progress-bar-container {
    height: 8px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-bar-fill.primary { background: var(--primary, #0d6efd); }
.progress-bar-fill.success { background: var(--success, #198754); }
.progress-bar-fill.warning { background: var(--warning, #ffc107); }
.progress-bar-fill.danger { background: var(--danger, #dc3545); }

/* ============================================
   Health Score Display
   ============================================ */
.health-score {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
}

.health-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 8px solid;
}

.health-score-circle.excellent { border-color: var(--success, #198754); }
.health-score-circle.good { border-color: #28a745; }
.health-score-circle.fair { border-color: var(--warning, #ffc107); }
.health-score-circle.needs-improvement { border-color: #fd7e14; }
.health-score-circle.critical { border-color: var(--danger, #dc3545); }

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

.health-score-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.health-components {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
    width: 100%;
}

.health-component {
    text-align: center;
    padding: 8px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 6px;
}

.health-component-value {
    font-size: 18px;
    font-weight: 600;
}

.health-component-label {
    font-size: 11px;
    color: var(--text-secondary, #6c757d);
    text-transform: uppercase;
}

/* ============================================
   Channel Ranking Card
   ============================================ */
.ranking-badge {
    color: var(--warning, #ffc107);
    font-size: 16px;
}

.ranking-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ranking-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
}

.ranking-label {
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
}

.ranking-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.ranking-value.top-10 {
    color: var(--warning, #ffc107);
}

.ranking-value.top-100 {
    color: var(--success, #198754);
}

.ranking-value.channel-age-value {
    font-size: 16px;
    color: #8b5cf6;
    cursor: help;
}

[data-theme="dark"] .ranking-value.channel-age-value {
    color: #a78bfa;
}

.ranking-context {
    margin-top: 8px;
    text-align: center;
}

/* ============================================
   Time Period Selector
   ============================================ */
.period-selector {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary, #f8f9fa);
    padding: 4px;
    border-radius: 6px;
}

.period-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary, #6c757d);
    transition: all 0.2s ease;
}

.period-btn:hover {
    background: var(--bg-elevated);
}

.period-btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary, #212529);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ============================================
   Loading States
   ============================================ */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-chart {
    height: 120px;
}

/* ============================================
   Pending Data State
   ============================================ */
.pending-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 8px;
}

.pending-data-message i {
    font-size: 32px;
    color: var(--primary, #0d6efd);
    opacity: 0.6;
    margin-bottom: 12px;
}

.pending-data-message p {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary, #212529);
}

.pending-data-message small {
    margin-top: 4px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    color: var(--text-secondary, #6c757d);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    max-width: 300px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .analytics-container {
        height: auto;
        min-height: calc(100vh - 70px);
        overflow: visible;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .channel-selector {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kpi-value {
        font-size: 28px;
    }

    .health-score-circle {
        width: 100px;
        height: 100px;
    }

    .health-score-value {
        font-size: 28px;
    }
}

/* ============================================
   Dark Mode Support
   Uses CSS variables from style.css which handles
   light/dark mode switching via prefers-color-scheme
   ============================================ */

/* ============================================
   Video Analysis Modal
   90% screen size fullscreen modal
   ============================================ */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.video-modal {
    width: 90vw;
    height: 90vh;
    background: var(--bg-elevated);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-modal-overlay.active .video-modal {
    transform: scale(1);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-default, #dee2e6);
    flex-shrink: 0;
}

.video-modal-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.video-modal-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
}

.video-modal-info h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-modal-meta {
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
    display: flex;
    gap: 16px;
}

.video-modal-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Data Availability Badge */
.data-availability-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.data-availability-badge.data-poor {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.data-availability-badge.data-moderate {
    background: rgba(255, 193, 7, 0.15);
    color: #b38600;
}

.data-availability-badge.data-good {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.video-modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-secondary, #6c757d);
    transition: all 0.2s ease;
}

.video-modal-close:hover {
    background: var(--bg-tertiary, #e9ecef);
    color: var(--text-primary, #212529);
}

/* Modal Tabs */
.video-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-default, #dee2e6);
    background: var(--bg-secondary, #f8f9fa);
    flex-shrink: 0;
    overflow-x: auto;
}

.video-modal-tab {
    padding: 12px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #6c757d);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.video-modal-tab:hover {
    color: var(--text-primary, #212529);
}

.video-modal-tab.active {
    color: var(--primary, #0d6efd);
    border-bottom-color: var(--primary, #0d6efd);
    background: var(--bg-elevated);
}

/* Modal Content */
.video-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.video-modal-section {
    display: none;
}

.video-modal-section.active {
    display: block;
}

/* Analysis Cards Grid */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.analysis-card {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
    padding: 20px;
}

.analysis-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.analysis-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.analysis-card-icon.blue { background: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.analysis-card-icon.green { background: rgba(25, 135, 84, 0.1); color: #198754; }
.analysis-card-icon.orange { background: rgba(253, 126, 20, 0.1); color: #fd7e14; }
.analysis-card-icon.purple { background: rgba(111, 66, 193, 0.1); color: #6f42c1; }
.analysis-card-icon.red { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.analysis-card-icon.cyan { background: rgba(13, 202, 240, 0.1); color: #0dcaf0; }

.analysis-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.analysis-card-subtitle {
    font-size: 12px;
    color: var(--text-secondary, #6c757d);
}

/* Big Number Display */
.big-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary, #212529);
    line-height: 1.2;
}

.big-number-label {
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
    margin-top: 4px;
}

.big-number-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
}

.big-number-change.positive { color: #198754; }
.big-number-change.negative { color: #dc3545; }
.big-number-change.neutral { color: #6c757d; }

/* Score Circle */
.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 6px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-circle.excellent { border-color: #198754; }
.score-circle.good { border-color: #20c997; }
.score-circle.average { border-color: #ffc107; }
.score-circle.below-average { border-color: #fd7e14; }
.score-circle.poor { border-color: #dc3545; }

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

.score-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary, #6c757d);
}

/* Viral Potential Card Expanded */
.viral-potential-card {
    min-height: auto;
}

.viral-factors-section,
.viral-tips-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-default, #dee2e6);
}

.viral-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #212529);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.viral-section-title i {
    font-size: 14px;
}

.viral-section-title .text-success { color: #198754; }
.viral-section-title .text-warning { color: #fd7e14; }

.viral-factor-items,
.viral-tip-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.viral-factor-items li,
.viral-tip-items li {
    font-size: 12px;
    color: var(--text-secondary, #6c757d);
    padding: 6px 0 6px 20px;
    position: relative;
    line-height: 1.4;
}

.viral-factor-items li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #198754;
    font-weight: 600;
}

.viral-tip-items li::before {
    content: '💡';
    position: absolute;
    left: 0;
    font-size: 11px;
}

.viral-factor-items li .factor-points {
    color: #198754;
    font-weight: 600;
    margin-left: 4px;
}

.viral-tips-section.hidden {
    display: none;
}

/* No factors state */
.viral-no-factors {
    font-size: 12px;
    color: var(--text-secondary, #6c757d);
    font-style: italic;
    padding: 8px 0;
}

/* Comparison Bar */
.comparison-bar {
    height: 8px;
    background: var(--bg-tertiary, #e9ecef);
    border-radius: 4px;
    margin: 8px 0;
    position: relative;
    overflow: hidden;
}

.comparison-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.comparison-bar-fill.above { background: linear-gradient(90deg, #198754, #20c997); }
.comparison-bar-fill.below { background: linear-gradient(90deg, #dc3545, #fd7e14); }
.comparison-bar-fill.average { background: linear-gradient(90deg, #6c757d, #adb5bd); }

.comparison-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary, #6c757d);
}

/* Stat Row */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-default, #dee2e6);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row-label {
    font-size: 14px;
    color: var(--text-secondary, #6c757d);
}

.stat-row-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #212529);
}

.stat-row-value.positive { color: #198754; }
.stat-row-value.negative { color: #dc3545; }

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 6px 12px;
    background: var(--bg-tertiary, #e9ecef);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-primary, #212529);
}

.tag-item.high-performing {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.tag-item.recommended {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
    border: 1px dashed #0d6efd;
}

/* Recommendations List */
.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recommendation-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 10px;
    border-left: 4px solid;
}

.recommendation-item.priority-high { border-left-color: #dc3545; }
.recommendation-item.priority-medium { border-left-color: #ffc107; }
.recommendation-item.priority-low { border-left-color: #0dcaf0; }
.recommendation-item.priority-info { border-left-color: #198754; }

.recommendation-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.recommendation-item.priority-high .recommendation-icon { background: rgba(220, 53, 69, 0.1); color: #dc3545; }
.recommendation-item.priority-medium .recommendation-icon { background: rgba(255, 193, 7, 0.1); color: #ffc107; }
.recommendation-item.priority-low .recommendation-icon { background: rgba(13, 202, 240, 0.1); color: #0dcaf0; }
.recommendation-item.priority-info .recommendation-icon { background: rgba(25, 135, 84, 0.1); color: #198754; }

.recommendation-content {
    flex: 1;
}

.recommendation-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #6c757d);
    margin-bottom: 4px;
}

.recommendation-text {
    font-size: 14px;
    color: var(--text-primary, #212529);
    line-height: 1.4;
}

/* Chart Container in Modal */
.modal-chart-container {
    height: 250px;
    margin-top: 16px;
}

/* Loading State */
.video-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-secondary, #6c757d);
}

.video-modal-loading i {
    font-size: 48px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Clickable Video Row */
.compact-table tr.clickable-video {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.compact-table tr.clickable-video:hover {
    background-color: var(--bg-secondary, #f8f9fa);
}

.compact-table tr.clickable-video td:first-child {
    position: relative;
    padding-left: 24px;
}

.compact-table tr.clickable-video td:first-child::before {
    content: '\F144';  /* Bootstrap Icons play-circle */
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 4px;
    color: var(--primary, #0d6efd);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.compact-table tr.clickable-video:hover td:first-child::before {
    opacity: 1;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .video-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .video-modal-thumbnail {
        display: none;
    }

    .video-modal-info h2 {
        font-size: 16px;
        max-width: 200px;
    }

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

    .big-number {
        font-size: 28px;
    }
}
