/* static/css/channels_v2.css */

/* Custom Variables */
:root {
    --custom-surface: #17171c; /* Darker background for more depth */
    --custom-surface-raised: #202026; /* Slightly lighter for cards */
    --custom-surface-hover: #282830; /* Hover for list items */
    --custom-border: #36363f; /* Borders */
    --custom-border-subtle: #2a2a31;

    --custom-text-primary: #e8e8eb; /* Brighter Primary text */
    --custom-text-secondary: #a8a8b3; /* Softer Secondary text */
    --custom-text-tertiary: #787883; /* Muted Tertiary text */

    --custom-red: #ef4444;
    --custom-red-light: #f87171;
    --custom-red-light-bg: rgba(239, 68, 68, 0.1); /* More subtle bg */
    --custom-red-dark: #dc2626;

    --custom-yellow: #facc15;
    --custom-yellow-light-bg: rgba(250, 204, 21, 0.1); /* More subtle bg */
    --custom-yellow-dark: #eab308;

    --custom-green: #22c55e;
    --custom-green-light: #4ade80;
    --custom-green-light-bg: rgba(34, 197, 94, 0.1);

    --custom-blue: #3b82f6; /* For accents if needed */
    --custom-purple: #8b5cf6;


    --card-bg: var(--custom-surface-raised);
    --card-border: var(--custom-border);
    --card-shadow: 0 4px 8px -2px rgba(0,0,0,0.15), 0 2px 4px -2px rgba(0,0,0,0.1);
    --card-hover-shadow: 0 10px 15px -3px rgba(0,0,0,0.15), 0 4px 6px -2px rgba(0,0,0,0.1);
}

body {
    background-color: var(--custom-surface);
    color: var(--custom-text-primary);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* Modern font */
}

.channels-v2-container {
    max-width: 1600px; /* Or your preferred max-width */
    margin-left: auto;
    margin-right: auto;
}

.page-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--custom-border);
}
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--custom-text-primary);
    font-family: 'Barlow Condensed', "Inter", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}
.page-subtitle {
    font-size: 0.95rem;
    color: var(--custom-text-secondary);
}

.card-ui {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}
.card-ui-title { /* More specific title for card sections like Platform Insights */
    font-family: 'Barlow Condensed', "Inter", sans-serif;
    font-size: 1.375rem; /* 22px */
    font-weight: 600;
    color: var(--custom-text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* Overall Stats Display */
.overall-stats-display .card-ui-title .text-custom-red { color: var(--custom-red); }

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem; /* 14px */
}
.stat-highlight {
    padding: 1rem;
    border-radius: 0.625rem; /* 10px */
    background-color: var(--custom-green-light-bg); /* Example: green for positive ROI */
    border: 1px solid rgba(72, 187, 120, 0.2); /* Lighter border for green */
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.15);
    margin-bottom: 0.75rem;
    text-align: center;
}
.stat-highlight .text-custom-red-light { /* For negative ROI */
    color: var(--custom-red-light) !important; /* Ensure override if needed */
}
.stat-highlight.negative-roi { /* Add this class via JS if ROI is negative */
    background-color: var(--custom-red-light-bg);
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.stat-value-large {
    display: block;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    /* Color is handled by text-custom-green/red-light applied in HTML */
}
.stat-label-large {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--custom-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.625rem;
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 0.625rem;
    border: 1px solid var(--custom-border-subtle);
}
.stat-icon-wrapper {
    padding: 0.75rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
}
.stat-icon-wrapper i { font-size: 1.125rem; }

.stat-icon-wrapper.bg-custom-yellow-light { background-color: var(--custom-yellow-light-bg); }
.stat-icon-wrapper .text-custom-yellow-dark { color: var(--custom-yellow-dark); }
.stat-icon-wrapper.bg-custom-red-light-bg { background-color: var(--custom-red-light-bg); }
.stat-icon-wrapper .text-custom-red { color: var(--custom-red); }

.stat-value { /* General stat value, distinct from .item-stat .stat-value */
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--custom-text-primary);
    line-height: 1.3;
}
.stat-label { /* General stat label, distinct from .item-stat .stat-label */
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--custom-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.075em;
}

/* Filter/Sort Controls */
.filter-sort-controls .form-control,
.filter-sort-controls .form-select {
    background-color: var(--custom-surface);
    border: 1px solid var(--custom-border);
    color: var(--custom-text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.375rem; /* Ensure consistent border radius */
}
.filter-sort-controls .form-control::placeholder { color: var(--custom-text-tertiary); }
.filter-sort-controls .form-control:focus,
.filter-sort-controls .form-select:focus {
    border-color: var(--custom-red);
    box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.2);
    background-color: var(--custom-surface);
    color: var(--custom-text-primary);
}
.filter-sort-controls .input-group-text {
    background-color: var(--custom-surface);
    border: 1px solid var(--custom-border);
    color: var(--custom-text-tertiary);
    font-size: 0.9rem;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}
.filter-sort-controls .input-group > .form-control,
.filter-sort-controls .input-group > .form-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.btn-custom-red {
    background-color: var(--custom-red);
    border-color: var(--custom-red);
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border-radius: 0.375rem;
}
.btn-custom-red:hover {
    background-color: var(--custom-red-dark);
    border-color: var(--custom-red-dark);
    color: white;
}

/* Channel List Section */
.channel-list-section { /* This is the .card-ui */
    padding: 0; /* Let card-ui handle its padding, or set to 0 if no internal card padding wanted */
}

/* Channel List Header */
.channel-list-header {
    display: flex;
    align-items: center;
    background-color: var(--custom-surface);
    border-bottom: 1px solid var(--custom-border);
    padding: 0.75rem 1.5rem; /* Increased padding for header */
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--custom-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.085em;
    border-top-left-radius: 0.75rem; /* Match card-ui radius */
    border-top-right-radius: 0.75rem; /* Match card-ui radius */
}
.channel-list-header i {
    font-size: 0.9em;
    margin-right: 0.4rem;
    color: var(--custom-text-tertiary);
}
/* Column Widths for Header - align with item widths */
.header-item-channel { flex: 3 0 0; min-width: 240px; padding-left: 0; }
.header-item-stats { flex: 0.9 0 0; min-width: 90px; text-align: center; padding-left: 10px;} /* Increased flex slightly for stats */
.header-item-specialty { flex: 2 0 0; min-width: 180px; padding-left: 10px;}

/* Channel List Item Link & Content Wrapper */
.channel-list-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--custom-border-subtle);
    transition: background-color 0.15s ease-in-out;
    position: relative; /* FIX: Create a stacking context for each row */
    z-index: 1;         /* FIX: Set a default z-index */
}
.channel-list-item-link:last-child {
    border-bottom: none;
    border-bottom-left-radius: 0.75rem; /* Match card-ui radius */
    border-bottom-right-radius: 0.75rem; /* Match card-ui radius */
}
.channel-list-item-link:last-child .channel-list-item-content-wrapper {
     border-bottom-left-radius: 0.75rem;
     border-bottom-right-radius: 0.75rem;
}
/* FIX: Elevate the entire hovered/focused row to ensure popup appears on top */
.channel-list-item-link:hover,
.channel-list-item-link:focus-within { 
    z-index: 10;
}
.channel-list-item-link:hover {
    background-color: var(--custom-surface-hover);
}
.channel-list-item-content-wrapper {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping on smaller screens unless handled by @media */
    align-items: center;
    padding: 1rem 1.5rem; /* Increased padding for items */
}

.item-section { 
    padding: 0.5rem 0; /* Remove horizontal padding, handle with column definition */
    position: relative; /* Ensure .item-stat which is a type of .item-section can anchor popups */
}

.item-channel-info {
    flex: 3 0 0; /* Grow more, basis 0 */
    min-width: 240px; /* Min width */
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-right: 15px; /* Space to next column */
}
.channel-logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid var(--custom-border);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.channel-details { min-width: 0; } /* Allows text ellipsis to work */
.channel-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--custom-text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.channel-meta {
    font-size: 0.75rem;
    color: var(--custom-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-stat {
    flex: 0.9 0 0; /* Basis 0, grow based on flex factor */
    min-width: 90px; /* Min width for stats */
    text-align: center;
    position: relative; /* For popup positioning - THIS IS IMPORTANT */
    padding-left: 10px; /* Internal spacing */
    padding-right: 10px;
}
.item-stat .stat-value { /* Styles for stat values specifically within .item-stat */
    font-size: 1rem;
    font-weight: 600;
    display: inline-block;
    vertical-align: middle;
}
/* Colors for stat values */
.text-custom-green-light { color: var(--custom-green-light); }
.text-custom-red-light { color: var(--custom-red-light); }
.text-custom-yellow { color: var(--custom-yellow-dark); } 
.text-custom-text-primary { color: var(--custom-text-primary); }
.text-custom-text-secondary { color: var(--custom-text-secondary); }

.stat-label.d-md-none { /* Mobile label */
    display: block; /* Default for mobile, will be overridden below if necessary */
    font-size: 0.6rem;
    color: var(--custom-text-tertiary);
    text-transform: uppercase;
    margin-top: 3px;
    letter-spacing: 0.05em;
}

.item-specialty {
    flex: 2 0 0;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-left: 10px; /* Internal spacing */
    padding-right: 15px; /* Space to AI button */
}
.specialty-tag {
    font-size: 0.7rem;
    background-color: var(--custom-red-light-bg);
    color: var(--custom-red-light);
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    display: inline-block;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.specialty-tag-none {
    font-size: 0.75rem;
    color: var(--custom-text-tertiary);
    font-style: italic;
}
.specialty-more-count {
    font-size: 0.7rem;
    color: var(--custom-text-tertiary);
    background-color: var(--custom-border-subtle);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: help;
}

/* AI Button Container */
.item-ai-button-container {
    flex: 0 0 auto; /* Don't grow or shrink, size based on content */
    margin-left: auto; /* Pushes to the far right */
    display: flex;
    align-items: center;
    justify-content: center; /* Center button if container is wider */
}
.item-ai-button-container .btn-ai-insight {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    background-color: var(--custom-yellow-light-bg);
    color: var(--custom-yellow-dark);
    border: 1px solid rgba(250, 204, 21, 0.3);
    white-space: nowrap; /* Prevent button text from wrapping */
}
.item-ai-button-container .btn-ai-insight:hover,
.item-ai-button-container .btn-ai-insight.active {
    background-color: var(--custom-yellow-dark);
    color: var(--custom-surface); /* Dark text on yellow bg */
    border-color: var(--custom-yellow-dark);
}
.item-ai-button-container .btn-ai-insight .icon-ai { margin-right: 0.375rem; }
.item-ai-button-container .btn-ai-insight .spinner-border-sm {
    width: 0.85rem; height: 0.85rem;
    border-width: .2em;
    margin-right: 0.375rem;
}

/* Popups */
.has-popup { 
    cursor: help; 
}
.popup-indicator-icon {
    color: var(--custom-text-tertiary);
    font-size: 0.8em; 
    margin-left: 4px; 
    transition: color 0.2s;
    vertical-align: middle; 
    display: inline-block; 
}
.has-popup:hover .popup-indicator-icon,
.has-popup:focus .popup-indicator-icon {
    color: var(--custom-yellow);
}

/* static/css/channels_v2.css */

.stat-popup {
    position: absolute;
    width: 280px; 
    max-width: 90vw; 
    background-color: #000000; /* Fully Opaque Black */
    border: 1px solid var(--custom-border);
    box-shadow: 0 10px 20px rgba(0,0,0,0.35), 0 0 0 1px var(--custom-border);
    border-radius: 0.625rem; 
    padding: 1rem;
    z-index: 1060; 
    font-size: 0.8rem;
    color: var(--custom-text-secondary);
    display: none; 
    opacity: 0;  
    transition: opacity 0.15s ease-in-out;
}

.stat-popup .popup-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--custom-text-primary);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--custom-border-subtle);
    padding-bottom: 0.625rem;
}
.stat-popup .popup-title i { font-size: 1.1em; margin-right: 0.5em; }
.stat-popup .popup-overall {
    margin-top: 0.875rem; 
    padding-top: 0.875rem; 
    border-top: 1px solid var(--custom-border-subtle);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500; 
    color: var(--custom-text-secondary); 
}
.stat-popup .popup-overall span { 
    font-weight: 600; 
}

.popup-no-data {
    text-align: center;
    padding: 0.5rem;
    font-style: italic;
}

/* Bar chart emulation for popups */
.popup-bar-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.625rem;
    font-size: 0.75rem;
}
.popup-bar-label {
    width: 90px; /* Adjusted for potentially longer labels */
    flex-shrink: 0;
    color: var(--custom-text-secondary);
    font-weight: 500;
    padding-right: 5px; /* Space between label and bar */
}
.popup-bar-container {
    flex-grow: 1;
    height: 16px; /* Slightly reduced height */
    background-color: var(--custom-border-subtle);
    border-radius: 4px;
    position: relative; /* For ROI split bar */
    overflow: hidden;
    margin: 0 0.5rem; /* Reduced margin slightly */
}
.popup-bar-container .popup-bar {
    height: 100%;
    border-radius: 4px;
    position: absolute;
    top: 0;
    min-width: 3px;
    transition: width 0.3s ease-out;
}
.popup-bar-value {
    width: 90px; /* Adjusted to match label potentially */
    flex-shrink: 0;
    text-align: right;
    font-weight: 600;
    color: var(--custom-text-primary);
    padding-left: 5px; /* Space between bar and value */
}

/* Legacy list for old popups */
.picks-breakdown-popup .popup-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0.75rem;
}
.picks-breakdown-popup .popup-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.75rem;
}
.picks-breakdown-popup .popup-list li span {
    font-weight: 600;
    color: var(--custom-text-primary);
}


/* NEW: Styles for Picks Breakdown Popup */
.bg-custom-blue { background-color: var(--custom-blue); }
.bg-custom-purple { background-color: var(--custom-purple); }
.bg-custom-tertiary { background-color: #787883; }

.picks-bar-container {
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background-color: var(--custom-border-subtle);
    margin: 0.75rem 0;
}
.picks-bar-segment {
    height: 100%;
    transition: filter 0.2s ease-in-out;
    cursor: help;
}
.picks-bar-segment:hover {
    filter: brightness(1.25);
}
.picks-breakdown-popup .popup-list.picks-legend {
    list-style: none;
    padding-left: 0;
    margin-top: 0.75rem;
    margin-bottom: 0;
}
.picks-breakdown-popup .popup-list.picks-legend li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.75rem;
}
.picks-breakdown-popup .popup-list.picks-legend li span:last-child {
    font-weight: 600;
    color: var(--custom-text-primary);
}
.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}


/* AI Insight Section */
.ai-insight-container {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0; /* Let item link border handle bottom */
    background-color: var(--custom-surface);
    /* Match border style of channel list item link, but maybe slightly inset or different color */
    border-left: 1px solid var(--custom-border-subtle);
    border-right: 1px solid var(--custom-border-subtle);
    border-bottom: 1px solid var(--custom-border-subtle); /* Match item link */
    border-radius: 0 0 0.625rem 0.625rem;
    padding: 1.25rem 1.5rem; /* Consistent padding */
    display: none; /* Controlled by JS */
    flex-direction: column;
    position: relative;
    box-shadow: inset 0 3px 8px rgba(0,0,0,0.1);
}
.ai-insight-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--custom-yellow-dark);
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--custom-border-subtle);
}
.ai-insight-title i { font-size: 1.1em; margin-right: 0.5em;}
.ai-insight-text-wrapper {
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--custom-border) var(--custom-surface);
    padding-right: 0.5rem; /* Space for scrollbar */
}
.ai-insight-text {
    font-size: 0.85rem;
    color: var(--custom-text-secondary);
    line-height: 1.65;
    white-space: pre-wrap; /* Preserve line breaks from AI */
}
.ai-insight-text strong.text-custom-yellow { color: var(--custom-yellow-dark) !important; }
.ai-insight-text strong.text-custom-text-primary { color: var(--custom-text-primary) !important; font-weight: 500; }

.btn-close-insight {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--custom-text-tertiary);
    font-size: 1.375rem;
    line-height: 1;
    padding: 0.125rem 0.375rem;
    cursor: pointer;
    transition: color 0.2s ease;
}
.btn-close-insight:hover { color: var(--custom-text-primary); }

/* Responsive Adjustments */
@media (max-width: 991.98px) { /* LG breakpoint */
    .channel-list-item-content-wrapper {
        flex-wrap: wrap; /* Allow wrapping for AI button */
    }
    .item-ai-button-container {
        flex-basis: 100%; /* Full width on its own line */
        margin-left: 0;
        justify-content: flex-start; /* Align to left */
        padding-top: 0.75rem; /* Space above button */
        order: 6; /* Ensure it comes after other items */
    }
    .item-specialty {
        /* Allow specialty to take more space if AI button wraps */
        flex-grow: 1;
    }
}

@media (max-width: 767.98px) { /* MD breakpoint */
    .page-header { text-align: center; }
    .page-title { font-size: 1.75rem; }
    .page-subtitle { font-size: 0.9rem; }

    .channel-list-item-content-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
    }
    .item-section {
        width: 100%;
        padding: 0.625rem 0; /* Vertical padding, no horizontal */
        border-bottom: 1px dashed var(--custom-border-subtle); /* Subtle separator for mobile */
    }
    .item-section:last-child {
        border-bottom: none;
    }
    .item-channel-info, .item-specialty, .item-stat, .item-ai-button-container {
        padding-left: 0;
        padding-right: 0;
        min-width: unset; /* Remove min-widths for stacked layout */
        text-align: left; /* Align stat text left on mobile */
    }
    .item-stat .stat-value {
        display: inline-block; /* Keep value and label on same line if possible */
        margin-right: 5px;
        vertical-align: middle; /* Ensure alignment */
    }
     .stat-label.d-md-none { /* Mobile label - now also primary label */
        display: inline; /* Show next to value */
        font-size: 0.7rem;
        vertical-align: middle; /* Ensure alignment */
    }
    .item-ai-button-container {
        justify-content: center; /* Center AI button */
        padding-top: 0.75rem;
    }

    .stat-popup {
        /* JS handles left, top, transform for centering and collision */
        width: auto; /* Allow JS to determine best fit up to max-width */
        min-width: 240px; /* Minimum sensible width */
        max-width: calc(100vw - 20px); /* Prevent edge bleed */
        font-size: 0.75rem;
    }
    .popup-bar-label { width: 70px; }
    .popup-bar-value { width: 80px; font-size: 0.7rem;}

    .ai-insight-container {
        border-radius: 0 0 0.625rem 0.625rem; /* Keep bottom radius */
    }
    .chart-header { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* Pagination styles */
.pagination {
    --bs-pagination-padding-x: 0.85rem;
    --bs-pagination-padding-y: 0.45rem;
    --bs-pagination-font-size: 0.9rem;
    --bs-pagination-color: var(--custom-text-secondary);
    --bs-pagination-bg: var(--custom-surface-raised);
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: var(--custom-border);
    --bs-pagination-border-radius: 0.375rem;
    --bs-pagination-hover-color: var(--custom-text-primary);
    --bs-pagination-hover-bg: var(--custom-border-subtle);
    --bs-pagination-hover-border-color: var(--custom-border);
    --bs-pagination-focus-color: var(--custom-text-primary);
    --bs-pagination-focus-bg: var(--custom-border-subtle);
    --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.15);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--custom-red);
    --bs-pagination-active-border-color: var(--custom-red);
    --bs-pagination-disabled-color: var(--custom-text-tertiary);
    --bs-pagination-disabled-bg: var(--custom-surface);
    --bs-pagination-disabled-border-color: var(--custom-border-subtle);
}

/* ROI Analysis Chart Section */
.roi-analysis-chart-container { /* This is the .card-ui */
    padding: 1.25rem 1.5rem 1.5rem;
}
.chart-header { /* Distinct from channel list header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--custom-border-subtle);
}
.chart-title { /* Specific to ROI chart title */
    font-family: 'Barlow Condensed', "Inter", sans-serif;
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--custom-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0; /* Reset margin if any from general h3 */
}
.chart-badge {
    font-size: 0.7rem;
    background-color: var(--custom-border-subtle);
    color: var(--custom-text-secondary);
    padding: 0.3rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    border: 1px solid var(--custom-border);
}
.chart-wrapper {
    position: relative; /* For canvas child */
}

/* Alert box for no channels */
.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    border-radius: 0.75rem;
}
.alert-info .fs-1 {
    font-size: 3rem !important;
    color: #60a5fa;
}
.alert-info .alert-heading {
    color: #dbeafe;
    font-weight: 600;
}

/* Ensure Bootstrap icons are vertically aligned if needed */
.bi {
    vertical-align: -0.125em; /* Bootstrap default, usually fine */
}