﻿/**********************************************************************************/
/* style.css     Version 8.2  (03/29/2025)                                         */
/* - Added styles for clickable performance period columns                          */
/* - Preserved positive/negative styling while making period columns clickable      */
/* - Added hover and active states for better user interaction                      */
/* - Added subtle visual indicator to show period columns are clickable             */
/* - Maintained all previous styling enhancements                                   */
/**********************************************************************************/

:root {
    --primary-color: #005A9C;
    --primary-light: #33779B;
    --primary-dark: #004A7C;
    --text-light: #f2f2f2;
    --hover-background: #ddd;
    --background-light: #f4f4f4;
    --text-dark: #333;
    --button-background: #22b573;
    --button-hover-background: #119954;
    --footer-background: #333;
    --overlay-background: rgba(0, 0, 0, 0.5);
    --positive-color: lightgreen;
    --negative-color: lightcoral;
    --info-background: #f9f9f9;
    --box-shadow-color: rgba(0,0,0,0.2);
    --link-color: black;
    --box-shadow: 0px 8px 16px 0px var(--box-shadow-color);
    --border-color: #ccc;
    --button-text-color: white;
    --sort-button-background: #f1f1f1;
    --sort-button-hover-background: #d0e0ef;
    --sort-button-hover-shadow: 0px 2px 4px var(--box-shadow-color);
    --sort-arrow-up-color: #ff0000;
    --sort-arrow-down-color: #00ff00;
    /* New column type-specific colors */
    --percent-cell-background: #f9f9ff;
    --text-cell-background: #f9ffff;
    --clickable-cell-background: #fffff9;
    --indicator-cell-background: #fff9ff;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background-light);
}

/* Top Navigation Bar */
.topnav {
    position: relative;
    z-index: 100;
    background-color: var(--primary-color);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: start;
}

    .topnav a {
        display: block;
        color: var(--text-light);
        text-align: center;
        padding: 6px 12px;
        text-decoration: none;
        font-size: 17px;
    }

        .topnav a:hover {
            background-color: var(--hover-background);
            color: var(--text-dark);
        }

    .topnav img {
        margin: 10px 20px;
    }

.category-title,
.explore-etfs-btn,
.explore-etfs-btn.clicked {
    font-size: 17px;
    color: var(--text-light);
    background-color: var(--primary-color);
    padding: 14px 16px;
    margin-left: 50px;
    cursor: pointer;
}

    .explore-etfs-btn:hover {
        background-color: var(--hover-background);
        color: var(--link-color);
    }

.hidden {
    display: none;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--info-background);
    min-width: 160px;
    box-shadow: var(--box-shadow);
    z-index: 1;
}

    .dropdown-content a {
        color: var(--link-color);
        padding: 12px 16px;
        text-decoration: none;
        display: block;
        text-align: left;
    }

        .dropdown-content a:hover {
            background-color: var(--hover-background);
        }
/* Welcome Section */
#welcome-section {
    padding: 50px;
    background: white;
    text-align: center;
}

    #welcome-section h1 {
        color: var(--primary-color);
        margin-bottom: 20px;
    }

    #welcome-section #tagline,
    #welcome-section #summary {
        font-size: 17px;
        color: var(--text-dark);
        margin-bottom: 40px;
    }

    /* Original button styling - keep this for most buttons */
    #welcome-section #learnMoreBtn,
    #welcome-section #moreInfo p,
    button,
    #etfListBtn,
    #clearTextBtn,
    #resetFiltersContainer button {
        text-align: center;
        vertical-align: middle; /* Align middle instead of top */
        background-color: var(--button-background);
        color: var(--button-text-color);
        padding: 10px 20px;
        border: none;
        cursor: pointer;
        border-radius: 5px;
        height: 100%;
        display: table-cell;
    }

        /* Default hover state */
        button:hover,
        #etfListBtn:hover,
        #clearTextBtn:hover,
        #resetFiltersContainer button:hover {
            background-color: var(--button-hover-background);
        }

/* Enhanced 3D styling ONLY for action buttons */
#resetFiltersContainer button,
#toggleAllBtn {
    background: linear-gradient(to bottom, var(--button-background) 0%, var(--button-hover-background) 85%);
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-weight: bold;
    text-shadow: 0 -1px 0 rgba(0,0,0,0.15);
    padding: 5px 12px;
    transition: all 0.15s ease;
}

    /* Enhanced hover state for action buttons */
    #resetFiltersContainer button:hover,
    #toggleAllBtn:hover {
        background: linear-gradient(to bottom, var(--button-background) 15%, var(--button-hover-background) 100%);
        box-shadow: 0 3px 5px rgba(0,0,0,0.25);
    }

    /* Enhanced active/pressed state for action buttons */
    #resetFiltersContainer button:active,
    #toggleAllBtn:active {
        transform: translateY(2px);
        box-shadow: 0 0 2px rgba(0,0,0,0.3) inset;
        background: var(--button-hover-background);
    }

/* Container for Clear button */
/* Position the Clear button between Min and Max inputs */
/* Update the Clear button position to match the screenshot */
#resetFiltersContainer {
    position: absolute;
    left: 10px;
    top: 50px; /* Position vertically aligned with the < character, slightly higher */
    z-index: 10;
}


/* Clear button styling */
#clearTextBtn {
    background-color: var(--button-background);
    color: var(--button-text-color);
    border: none;
    border-radius: 5px;
    padding: 5px 15px;
    font-size: 0.9em;
    cursor: pointer;
}

    #clearTextBtn:hover {
        background-color: var(--button-hover-background);
    }

/* Filter table styling */
#tableFilters {
    display: flex;
    flex-direction: column; /* Stack Clear button and table vertically */
}

    #tableFilters table {
        margin-left: 80px; /* Add space to align the table with the Clear button */
    }

footer {
    background-color: var(--footer-background);
    color: var(--button-text-color);
    padding: 10px;
    width: 100%;
    text-align: center;
}

/* Overlay for large images */
#image-overlay {
    background: var(--overlay-background);
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: scroll;
}

/* Table container for horizontal scrolling */
.table-container {
    width: 100%;
    max-width: 100%; /* Ensure it takes full width of its parent */
    overflow-x: auto; /* Enable horizontal scrolling */
    max-height: 70vh; /* Set to 70% of viewport height for more vertical space */
    min-height: 400px; /* Minimum height to ensure it's always reasonably sized */
    margin: 0 auto;
    box-shadow: 5px 5px 10px var(--box-shadow-color), -5px -5px 10px var(--background-light);
    position: relative; /* Required for sticky positioning context */
    /* Ensure scrollbar is always visible if needed */
    scrollbar-width: auto; /* For Firefox */
    scrollbar-color: #888 #f1f1f1; /* For Firefox */
    /* Make sure content doesn't obscure the scrollbar */
    padding-bottom: 20px; /* Add padding at bottom to ensure scrollbar visibility */
    box-sizing: border-box; /* Include padding in the element's total width/height */
}

    /* Style scrollbars for WebKit browsers (Chrome, Safari, newer Edge) */
    .table-container::-webkit-scrollbar {
        height: 16px; /* Height of horizontal scrollbar */
        width: 16px; /* Width of vertical scrollbar */
        background-color: #f1f1f1;
    }

    .table-container::-webkit-scrollbar-thumb {
        background-color: #888;
        border-radius: 8px;
        border: 3px solid #f1f1f1;
    }

        .table-container::-webkit-scrollbar-thumb:hover {
            background-color: #555;
        }

    /* Make sure the scrollbar corner is visible */
    .table-container::-webkit-scrollbar-corner {
        background-color: #f1f1f1;
    }

/* Container for the entire table section */
.table-section {
    padding-bottom: 30px; /* Add space below the table */
    position: relative; /* For absolute positioning of children if needed */
}

/* Table Layout: fixed to ensure columns expand equally */
.scrollable-table {
    width: 100%;
    table-layout: fixed; /* Ensures columns share the total width */
    border-collapse: collapse;
}

    /* Sticky header row */
    .scrollable-table thead {
        position: sticky;
        top: 0;
        background-color: white;
        z-index: 10;
    }

    /* First column sticky with enhanced styling - ID-based with fallback */
    .scrollable-table th:first-child,
    .scrollable-table td:first-child,
    .scrollable-table th[data-column-id="ticker"],
    .scrollable-table td[data-column-id="ticker"] {
        position: sticky;
        left: 0;
        z-index: 5; /* Above content but below header */
        background: linear-gradient(to bottom, #f8f8f8, #e8e8e8); /* Match other cells */
        box-shadow: 2px 0 5px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.1); /* Shadow for both sticky and cell style */
        border: 1px solid #666 !important;
        border-radius: 4px;
        padding: 4px 6px;
        vertical-align: middle;
    }

    /* Higher z-index for header of first column - ID-based approach */
    .scrollable-table thead th:first-child,
    .scrollable-table thead th[data-column-id="ticker"] {
        z-index: 15; /* Above both header and sticky column */
        background-color: white; /* Match header background */
    }

    /* Make Ticker column borders match other column borders */
    .scrollable-table td[data-column-id="ticker"],
    .scrollable-table td:first-child {
        border: 1px solid #666 !important; /* Same dark border as other cells */
        border-right: 1px solid #666 !important; /* Explicitly set right border */
        border-bottom: 1px solid #666 !important; /* Explicitly set bottom border */
    }

    /* Ensure the border doesn't get hidden by background color */
    .scrollable-table td[data-column-id="ticker"],
    .scrollable-table td:first-child {
        background-clip: padding-box;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        position: sticky;
        left: 0;
        z-index: 5;
    }

    /* Th and Td - box-sizing so padding/border is included in assigned width */
    .scrollable-table th,
    .scrollable-table td {
        box-sizing: border-box;
        overflow: hidden; /* Prevent content from breaking layout */
        text-overflow: ellipsis; /* Handle overflow text */
        border: 1px solid var(--border-color);
        font-size: 12px;
        text-align: left;
        position: relative;
        min-height: 24px;
    }

    /* Minimum width for columns - column type-specific minimums */
    .scrollable-table th {
        min-width: 80px; /* Base minimum width */
        white-space: nowrap; /* Prevent wrapping */
    }

        /* Column type-specific minimum widths */
        .scrollable-table th[data-column-type="TEXT"] {
            min-width: 120px;
        }

        .scrollable-table th[data-column-type="PERCENT"] {
            min-width: 100px;
        }

        /* Ensure cells with display:none truly take up no space */
        .scrollable-table th[style*="display: none"],
        .scrollable-table td[style*="display: none"] {
            width: 0 !important;
            padding: 0 !important;
            border: none !important;
            margin: 0 !important;
        }

    /* Smaller vertical padding + middle alignment in header cells */
    .scrollable-table thead th {
        padding: 2px 4px;
        vertical-align: middle;
        line-height: 1.2;
    }

    /* Reduce vertical padding for body cells */
    .scrollable-table td {
        padding: 2px 6px; /* Reduced vertical padding */
        line-height: 1.2; /* Control vertical space */
        max-height: 24px; /* Maximum height */
        height: auto; /* Let height be determined by content */
    }

    /* Fix row heights */
    .scrollable-table tr {
        height: 24px;
        position: relative; /* For tooltip positioning */
    }

    /* Hide the Info column in the table */
    .scrollable-table th[data-column-id="info"],
    .scrollable-table td[data-column-id="info"] {
        display: none !important;
    }


/* Hide the Info filter */
.column-filter[data-column-id="info"] {
    display: none !important;
}

/* Hide the Name column in the table */
.scrollable-table th[data-column-id="name"],
.scrollable-table td[data-column-id="name"] {
    display: none !important;
}

/* Hide the Name filter */
.column-filter[data-column-id="name"] {
    display: none !important;
}

/* Style the Name field to indicate it's interactive */
.scrollable-table td[data-column-id="name"] {
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    /* Add a subtle indicator that there's more info available */
    .scrollable-table td[data-column-id="name"]:after {
        content: "ℹ️";
        font-size: 10px;
        margin-left: 4px;
        opacity: 0.7;
    }

    /* Hover effect for name field */
    .scrollable-table td[data-column-id="name"]:hover {
        background-color: #f0f0f0;
    }

/* Column type-specific styling for cells */
.scrollable-table td[data-column-type="PERCENT"] {
    background-color: var(--percent-cell-background);
    text-align: right;
}

.scrollable-table td[data-column-type="TEXT"] {
    background-color: var(--text-cell-background);
}

.scrollable-table td[data-column-type="CLICKABLE"] {
    background-color: var(--clickable-cell-background);
    cursor: pointer;
}

.scrollable-table td[data-column-type="INDICATOR"] {
    background-color: var(--indicator-cell-background);
    text-align: center;
}

/* Column category styling */
.scrollable-table td[data-column-category="PERFORMANCE"] {
    font-weight: bold;
}

/* Positive/Negative highlighting */
.positive {
    background-color: var(--positive-color);
    color: var(--text-dark);
}

.negative {
    background-color: var(--negative-color);
    color: var(--text-dark);
}

/* Sort button styling - no fixed height, smaller padding */
/* Updated sort-button style to prevent truncation */
.sort-button {
    background-color: var(--sort-button-background);
    color: var(--text-dark);
    border: none;
    padding: 4px 2px;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    display: block;
    width: calc(100% - 6px); /* Changed from 100% to auto */
    min-width: calc(fit-content + 20px); /* Use content width as minimum */
    box-sizing: border-box;
    white-space: normal; /* Allow text to wrap if needed */
    overflow: visible; /* Allow text to overflow */
    text-overflow: clip; /* Don't add ellipsis */
    text-align: center; /* or left if you prefer */
    line-height: normal; /* let it shrink to content height */
    margin: 0 3px; /* remove extra margin */
}

    .sort-button:active {
        transform: translateY(2px);
        box-shadow: var(--sort-button-hover-shadow);
    }

    .sort-button:hover {
        background-color: var(--sort-button-hover-background);
    }

.sort-arrow {
    margin-left: 5px;
}

.sorted-asc .sort-arrow {
    color: var(--sort-arrow-up-color);
}

.sorted-desc .sort-arrow {
    color: var(--sort-arrow-down-color);
}

/* Filter and button/input styling */
#etfListBtn,
#clearTextBtn,
#showListsBtn,
#addListBtn,
#updateListsBtn,
#deleteListBtn,
#resetFiltersContainer button {
    background-color: #22b573;
    color: white;
    border: none;
    border-radius: 50%; /* Make it perfectly round */
    padding: 8px 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 12px;
}

    #etfListBtn:hover,
    #clearTextBtn:hover,
    #resetFiltersContainer button:hover {
        background-color: #367C39;
        color: white;
    }

#clearTextBtn {
    padding: 2px 2px;
    font-weight: bold;
}

#etfListInput {
    margin: 0 10px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 800px;
    line-height: 1.2;
    font-size: 0.9em;
}

#etfSelector {
    margin: 0 10px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 200px;
    line-height: 1.2;
    font-size: 0.9em;
    box-sizing: border-box;
    display: inline-block;
}

#tableFilters {
    background-color: #ddeeff;
    font-size: 0.8em;
    display: none;
    text-align: center;
    padding-top: 10px;
    padding-bottom: 10px;
    position: relative;
}

    #tableFilters .column-filter {
        display: inline-block;
        margin-right: 5px;
        vertical-align: top;
    }

        #tableFilters .column-filter span,
        #tableFilters .column-filter input {
            display: inline-block;
        }

/* Enhanced filter styling for different filter types */
.filter-operator {
    margin-right: 5px;
}

.filter-input {
    width: 50px;
    margin-right: 10px;
}

    /* Updated styling for different filter input types */
    .filter-input.min,
    .filter-input.max {
        width: 50px;
        border-radius: 3px;
        border: 1px solid var(--border-color);
        padding: 3px;
    }

    .filter-input.text {
        width: 80px;
        border-radius: 3px;
        border: 1px solid var(--border-color);
        padding: 3px;
    }

    .filter-input.select {
        width: 100px;
        border-radius: 3px;
        border: 1px solid var(--border-color);
        padding: 3px;
    }

    .filter-input.checkbox {
        width: auto;
        margin-right: 5px;
        accent-color: var(--button-background);
    }

/* Filter container styles */
#resetFiltersContainer {
    margin-left: 5px;
    padding: 5px;
    text-align: left;
}

#etfListFilterContainer {
    display: none;
    align-items: center;
    margin-bottom: 5px; /* Increase this value for more space */
    padding-bottom: 10px; /* Additional padding at the bottom */
    border-bottom: 1px solid #eee; /* Optional: adds a subtle separator line */
}

#etfListInput,
#clearTextBtn {
    margin-left: 10px;
}

#clearTextBtn {
    cursor: pointer;
}

#showListsBtn,
#addListBtn,
#clearTextBtn {
    margin-right: 10px;
}

/* SAR tooltip styling */
.sar-tooltip {
    position: relative;
    cursor: pointer;
}

    .sar-tooltip .tooltip-text {
        visibility: hidden;
        position: absolute;
        background-color: #333;
        color: white;
        text-align: center;
        padding: 5px;
        border-radius: 4px;
        z-index: 1000;
        width: 150px;
        left: 50%;
        transform: translateX(-50%);
        bottom: 100%;
        margin-bottom: 5px;
    }

    .sar-tooltip:hover .tooltip-text {
        visibility: visible;
    }

.sar-value {
    display: block;
    text-align: center;
}

.sar-up {
    color: green;
    font-size: 1.2em;
}

.sar-down {
    color: red;
    font-size: 1.2em;
}

.sar-arrow {
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Spinner styling */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Universal spinner container styling */
#spinnerContainer {
    position: absolute;
    display: none;
    z-index: 9999;
}

/* Column toggle styling - removed extra margin so header doesn't grow */
.column-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0; /* remove top/bottom margin */
    padding: 0;
    line-height: 1.2;
}

    .column-toggle label {
        font-size: 0.8em;
        cursor: pointer;
        margin: 0;
        padding: 0;
    }

    .column-toggle input[type="checkbox"] {
        accent-color: var(--button-background);
        cursor: pointer;
    }

/* Plot overlay */
#plot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    overflow: auto;
}

#toggleAllContainer {
    margin-left: 15px;
    border-left: 1px solid var(--border-color);
    padding-left: 10px;
    display: flex;
    align-items: center;
}

#toggleAllBtn {
    margin-right: 5px;
    padding: 2px 5px;
    font-size: 0.9em;
    background-color: var(--button-background);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    min-width: 70px;
}

    #toggleAllBtn:hover {
        background-color: var(--button-hover-background);
    }

#toggleAllContainer .column-toggle {
    margin-left: 5px;
}

/* Force visible table borders */
.scrollable-table th,
.scrollable-table td {
    border: 1px solid #666 !important; /* Darker color and !important to override */
}

/* Ensure border-collapse is applied */
.scrollable-table {
    border-collapse: collapse !important;
}

    /* Style for clickable cells (like CC column) */
    .scrollable-table td[data-column-type="CLICKABLE"],
    .scrollable-table td[id^="cell_"] {
        cursor: pointer;
        background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
        border: 1px solid #aaa;
        border-radius: 4px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        transition: all 0.2s ease;
        position: relative;
        text-align: center;
        padding: 4px 6px;
        vertical-align: middle;
    }

        /* Hover effect */
        .scrollable-table td[data-column-type="CLICKABLE"]:hover,
        .scrollable-table td[id^="cell_"]:hover {
            background: linear-gradient(to bottom, #ffffff, #f0f0f0);
            border-color: #888;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }

        /* Active/pressed effect */
        .scrollable-table td[data-column-type="CLICKABLE"]:active,
        .scrollable-table td[id^="cell_"]:active {
            background: linear-gradient(to bottom, #e0e0e0, #f0f0f0);
            box-shadow: 0 1px 2px rgba(0,0,0,0.1) inset;
            transform: translateY(1px);
        }

        /* Make sure the links inside the cells take up the entire cell */
        .scrollable-table td[data-column-type="CLICKABLE"] a,
        .scrollable-table td[id^="cell_"] a {
            display: block;
            width: 100%;
            height: 100%;
            color: #333;
            text-decoration: none;
            font-weight: normal;
            text-align: center;
        }

    /* Preserve positive/negative color backgrounds */
    .scrollable-table td.positive[data-column-type="CLICKABLE"],
    td[id^="cell_"].positive {
        background: linear-gradient(to bottom, #e2ffe2, #d0f0d0);
    }

    .scrollable-table td.negative[data-column-type="CLICKABLE"],
    td[id^="cell_"].negative {
        background: linear-gradient(to bottom, #ffe2e2, #f0d0d0);
    }

    .scrollable-table td.positive[data-column-type="CLICKABLE"]:hover,
    td[id^="cell_"].positive:hover {
        background: linear-gradient(to bottom, #e8ffe8, #d8f8d8);
    }

    .scrollable-table td.negative[data-column-type="CLICKABLE"]:hover,
    td[id^="cell_"].negative:hover {
        background: linear-gradient(to bottom, #ffe8e8, #f8d8d8);
    }

/* Column visibility through data attributes */
.col-hidden {
    display: none !important;
}

/* ID-based column visibility */
table[data-col-hidden-id-ticker] th[data-column-id="ticker"],
table[data-col-hidden-id-ticker] td[data-column-id="ticker"] {
    display: none !important;
}

/* Styles for the ticker column toggle (disabled) */
.ticker-column-toggle {
    opacity: 0.7;
    cursor: not-allowed;
}

    .ticker-column-toggle label {
        cursor: not-allowed;
    }

    .ticker-column-toggle input[type="checkbox"] {
        cursor: not-allowed;
    }

/* Force ticker column to always be visible */
.scrollable-table th:first-child,
.scrollable-table td:first-child,
.scrollable-table th[data-column-id="ticker"],
.scrollable-table td[data-column-id="ticker"] {
    display: table-cell !important;
}

/* Loading indicator for column visibility changes */
.column-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

    .column-loading.active {
        opacity: 1;
    }

/* Support for keyboard focus indicators */
.table-container:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Ensure correct z-index for hovering elements */
.sticky-header th {
    z-index: 21;
}

    .sticky-header th:first-child {
        z-index: 22;
    }

/* Arrow indicators in cells */
td[data-column-type="ARROW"] {
    position: relative;
    text-align: center;
}

/* Virtual scrolling related styles */
.virtual-scroll-container {
    position: relative;
    overflow-y: auto;
}

.virtual-scroll-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}

.virtual-scroll-placeholder {
    position: relative;
}

/* Info tooltip styling */
.info-tooltip {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 4px;
    z-index: 1000;
    max-width: 350px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.4;
    display: none;
    text-align: left;
    left: 50px;
    top: 20px;
}

/* Show tooltip on hover if preferred */
.show-on-hover td[data-column-id="name"]:hover .info-tooltip {
    display: block;
}

/* For showing on click - will be toggled via JavaScript */
.info-tooltip.visible {
    display: block;
}

/* Close button for the tooltip */
.info-tooltip-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

    .info-tooltip-close:hover {
        color: #000;
    }

/* Styling for period columns - non-clickable version */
.scrollable-table td[data-column-id="period_5"],
.scrollable-table td[data-column-id="period_30"],
.scrollable-table td[data-column-id="period_60"],
.scrollable-table td[data-column-id="period_90"],
.scrollable-table td[data-column-id="period_200"],
.scrollable-table td[data-column-id="period_252"],
.scrollable-table td[data-column-id="period_ytd"] {
    /* Apply the same base styling as other numeric cells */
    text-align: right;
}

/* Make period columns clickable */
.scrollable-table td[data-column-id^="period_"] {
    cursor: pointer;
    background: linear-gradient(to bottom, #f8f8f8, #e8e8e8);
    border: 1px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    position: relative;
    text-align: right; /* Keep the right alignment for numbers */
    padding: 4px 6px;
    vertical-align: middle;
}

    /* Hover effect */
    .scrollable-table td[data-column-id^="period_"]:hover {
        background: linear-gradient(to bottom, #ffffff, #f0f0f0);
        border-color: #888;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    /* Active/pressed effect */
    .scrollable-table td[data-column-id^="period_"]:active {
        background: linear-gradient(to bottom, #e0e0e0, #f0f0f0);
        box-shadow: 0 1px 2px rgba(0,0,0,0.1) inset;
        transform: translateY(1px);
    }

    /* Make sure links inside period cells take up the entire cell */
    .scrollable-table td[data-column-id^="period_"] a {
        display: block;
        width: 100%;
        height: 100%;
        color: #333;
        text-decoration: none;
        font-weight: normal;
        text-align: right; /* Keep right alignment */
    }

    /* Add subtle indicator that period cells are clickable */
    .scrollable-table td[data-column-id^="period_"]::after {
        content: "📊";
        font-size: 9px;
        opacity: 0.5;
        position: absolute;
        right: 2px;
        top: 2px;
        pointer-events: none; /* Ensure clicks still go to the cell */
    }

    /* Preserve positive/negative colors for clickable period cells */
    .scrollable-table td[data-column-id^="period_"].positive {
        background: linear-gradient(to bottom, #e2ffe2, #d0f0d0);
    }

    .scrollable-table td[data-column-id^="period_"].negative {
        background: linear-gradient(to bottom, #ffe2e2, #f0d0d0);
    }

    /* Hover states with preserved colors */
    .scrollable-table td[data-column-id^="period_"].positive:hover {
        background: linear-gradient(to bottom, #e8ffe8, #d8f8d8);
    }

    .scrollable-table td[data-column-id^="period_"].negative:hover {
        background: linear-gradient(to bottom, #ffe8e8, #f8d8d8);
    }
