/* ==========================================================================
   CSS VARIABLES & RESET
   ========================================================================== */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables */
:root {
    /* Font families */
    /*--font-primary: 'Inter', 'Plus Jakarta Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;*/
    --font-primary: 'Avenir Next', 'GT Walsheim', 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-headline: 'Avenir Next', 'GT Walsheim', 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Avenir Next', 'GT Walsheim', 'Circular', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /*--font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'Courier New', monospace;*/
    /* Dark theme variables - blacker */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #151515;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border-color: #2a2a2a;
    --candlestick-border-color: red;
    --candlestick-border-color-up: green;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #2563eb;
    --accent-red: #ef4444;
    --success-green: #22c55e;
    --warning-yellow: #eab308;
    --highlight: silver;
    --shadow: rgba(0, 0, 0, 0.5);
    /* Glassmorphism variables for dark theme - more glassy and transparent */
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-bg-light: rgba(30, 30, 30, 0.5);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.6);
    --bg-overlay: rgba(0, 0, 0, 0.7);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --candlestick-border-color: #000000;
    --candlestick-border-color-up: #000000;
    --accent-blue: #0d6efd;
    --accent-blue-hover: #0b5ed7;
    --accent-red: #dc3545;
    --success-green: #198754;
    --warning-yellow: #ffc107;
    --highlight: lightyellow;
    --shadow: rgba(0, 0, 0, 0.1);
    /* Glassmorphism variables for light theme - more glassy and transparent */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.2);
    --bg-overlay: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

body {
    font-family: var(--font-primary);
    font-weight: 400;
    background-color: var(--bg-primary);
    background-image: url('/content/images/blue_bg.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headlines */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
}

h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

h5 {
    font-size: 1.25rem;
    font-weight: 600;
}

h6 {
    font-size: 1rem;
    font-weight: 600;
}

/* Subtle overlay to make background image more subtle */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-overlay);
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: white;
}

    .btn-primary:hover {
        background-color: var(--accent-blue-hover);
    }

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

    .btn-secondary:hover {
        background-color: var(--bg-tertiary);
    }

.btn-danger {
    background-color: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

    .btn-danger:hover {
        background-color: var(--accent-red);
        color: white;
    }

/* Status badges */
.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #28a745;
    color: white;
}

.badge-warning {
    background: #fd7e14;
    color: white;
}

.badge-info {
    background: #20c997;
    color: white;
}

.badge-danger {
    background: #dc3545;
    color: white;
}

/* ==========================================================================
   LAYOUT COMPONENTS
   ========================================================================== */

/* Header */
.header {
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px var(--glass-shadow);
}

/* Logo */
.logo {
    width: 400px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-img {
    width: 400px;
    height: 100%;
    object-fit: contain;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background-color: var(--bg-primary);
    border-radius: 4px;
}

/* Search */
.search-container {
    flex: 1; /* Grow to fill available space */
    min-width: 100px; /* Increased minimum width */
    position: relative;
    margin: 0 20px;
    box-sizing: border-box;
}

.search-box {
    width: 100%;
    min-width: 0;
    height: 40px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0 10px 0 25px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-sizing: border-box;
}

    .search-box:focus {
        border-color: var(--accent-blue);
        background: var(--glass-bg);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

    .search-box::placeholder {
        color: var(--text-muted);
    }

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: none;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.search-result {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

    .search-result:last-child {
        border-bottom: none;
    }

    .search-result:hover,
    .search-result.highlighted {
        background-color: var(--bg-tertiary);
    }

.search-ticker {
    font-weight: 600;
    color: var(--text-primary);
}

.search-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    padding-left: 10px;
    flex-shrink: 0; /* Don't shrink */
}

.notification-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

    .notification-btn:hover {
        background-color: var(--bg-tertiary);
    }

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

    .user-btn:hover {
        background-color: var(--bg-tertiary);
    }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-image: url("images/VL Logo.png");
    background-size: cover;
    border: 1.5px solid var(--accent-blue);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    backdrop-filter: none; /* Remove transparency */
    -webkit-backdrop-filter: none; /* Remove transparency */
    border: 0.5px solid var(--glass-border);
    border-radius: 12px;
    min-width: 200px;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1002;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

    .dropdown-item:last-child {
        border-bottom: none;
    }

    .dropdown-item:hover {
        background-color: var(--bg-tertiary);
    }

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.toggle-switch {
    width: 40px;
    height: 20px;
    background-color: var(--border-color);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .toggle-switch.active {
        background-color: var(--accent-blue);
    }

.toggle-knob {
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
}

/* Main Layout */
.main-layout {
    margin-top: 60px;
    margin-bottom: 60px; /* Space for footer */
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    display: flex;
    align-items: flex-start; /* Align items to start - allows sticky to work */
    min-height: calc(100vh - 120px);
    width: 100%;
    box-sizing: border-box;
    overflow-x: visible;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.left-nav {
    width: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid var(--glass-border);
    transition: width 0.3s ease;
    overflow-x: visible;
    overflow-y: auto; /* Allow internal scrolling if content exceeds height */
    position: sticky; /* Stick to viewport */
    top: 60px; /* Below header */
    flex-shrink: 0;
    box-shadow: 2px 0 10px var(--glass-shadow);
    z-index: 1000;
    height: calc(100vh - 120px); /* Full height minus header (60px) and footer (60px) */
    max-height: calc(100vh - 120px); /* Ensure maximum height */
    align-self: flex-start; /* Align to start */
}

    .left-nav:hover {
        width: 280px;
    }

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
}

    .nav-item:hover {
        background: var(--bg-tertiary);
        color: var(--text-primary);
    }

    .nav-item.active {
        background: var(--accent-blue);
        color: white;
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    flex-shrink: 0;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.nav-item.active .nav-icon {
    color: white;
}

.nav-text {
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    color: var(--text-primary);
}

.nav-item.active .nav-text {
    color: white;
}

.left-nav:hover .nav-text {
    opacity: 1;
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
    background: transparent;
}

    .nav-submenu.open {
        max-height: 400px;
        padding: 8px 0;
    }

.left-nav:hover .nav-submenu {
    display: block;
}

.nav-submenu-item {
    padding: 8px 15px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin: 2px 0;
}

    .nav-submenu-item a,
    .nav-submenu-item .ticker-link {
        color: var(--text-secondary) /*!important*/;
        text-decoration: none;
    }

    .nav-submenu-item:hover {
        background: var(--bg-tertiary);
        transform: translateX(4px);
    }

        .nav-submenu-item:hover a,
        .nav-submenu-item:hover .ticker-link {
            color: var(--text-primary) /*!important*/;
        }

    .nav-submenu-item.active {
        background: var(--bg-tertiary);
        font-weight: 600;
    }

        .nav-submenu-item.active a,
        .nav-submenu-item.active .ticker-link {
            color: var(--text-primary) /*!important*/;
        }

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

.main-content {
    flex: 1;
    background-color: transparent;
    padding: 20px;
    min-width: 0; /* Allow flex item to shrink below content size */
    box-sizing: border-box;
    width: auto; /* Let flex handle width - it will automatically fill space between left-nav and filters-panel */
}

.content-placeholder {
    /* height: 600px; */
    background: transparent;
    /* border: 2px dashed var(--border-color); */
    border-radius: 8px;
    display: block;
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0; /* Don't shrink - only take space needed for content */
    width: auto; /* Only as wide as content */
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   FILTERS PANEL
   ========================================================================== */

/* Form wrapper around filters panel should not interfere with sticky positioning */
form:has(.filters-panel) {
    display: contents; /* Make form transparent to layout - doesn't create a box */
    position: static; /* Ensure no positioning context */
    overflow: visible; /* Don't clip sticky children */
    height: auto; /* Don't constrain height */
    width: auto; /* Don't constrain width */
}

.filters-panel {
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 0.5px solid var(--glass-border);
    flex-shrink: 0; /* Don't shrink the filters panel */
    transition: width 0.3s ease, transform 0.3s ease;
    z-index: 999;
    overflow: hidden; /* Hide overflow on container, let filters-content handle scrolling */
    box-shadow: -2px 0 10px var(--glass-shadow);
    padding: 0; /* Remove padding from panel, add to header and content instead */
    box-sizing: border-box;
    position: sticky; /* Stick to viewport */
    top: 60px; /* Below header */
    height: calc(100vh - 120px); /* Full height minus header (60px) and footer (60px) */
    max-height: calc(100vh - 120px); /* Ensure maximum height */
    align-self: flex-start; /* Align to start */
    display: flex;
    flex-direction: column;
}

    /* Ensure filters-panel content is visible when not closed */
    .filters-panel:not(.closed) .filters-content {
        display: block;
    }

    .filters-panel.closed {
        width: 10px; /* Just enough space for toggle button */
        padding: 0;
        overflow: visible; /* Allow toggle to be visible */
    }

        /* Hide panel content when closed */
        .filters-panel.closed > *:not(.filters-toggle) {
            opacity: 0;
            pointer-events: none;
            overflow: hidden;
        }

.filters-toggle {
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 0.5px solid var(--glass-border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 1001; /* Higher than panel to always be visible */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    /* Always visible even when panel is closed */
    opacity: 1;
    pointer-events: auto;
}

    .filters-toggle:hover {
        background-color: var(--accent-blue);
        color: white;
    }

    .filters-toggle::after {
        content: '❯';
        color: var(--text-primary);
        transition: transform 0.3s ease;
    }

.filters-panel.closed .filters-toggle::after {
    content: '❮';
}

/* Ensure toggle is always visible and clickable when panel is closed */
.filters-panel.closed .filters-toggle {
    opacity: 1;
    pointer-events: auto;
}

.filters-header {
    padding: 16px 18px;
    border-bottom: 0.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0; /* Don't shrink header */
}

.filters-title {
    font-family: var(--font-headline);
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    min-width: 60px;
    letter-spacing: -0.01em;
}

.filter-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.apply-btn {
    background-color: var(--accent-blue);
    color: white;
}

    .apply-btn:hover {
        background-color: var(--accent-blue-hover);
    }

.reset-btn {
    background-color: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

    .reset-btn:hover {
        background-color: var(--accent-red);
        color: white;
    }

.filters-content {
    padding: 20px;
    padding-bottom: 60px; /* Extra padding at bottom to ensure Column Visibility section is fully visible when scrolled */
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Allow flex child to shrink below content size */
    max-height: 100%; /* Constrain to parent height */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    height: 0; /* Force flex child to respect parent height constraints */
}

    /* Make sure checkboxes are always visible */
    .filters-content .checkbox-item {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure Column Visibility filter group is visible */
    .filters-content .filter-group:last-child {
        margin-bottom: 0; /* Remove bottom margin since we have padding on container */
    }

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

    .filter-input:focus,
    .filter-select:focus {
        border-color: var(--accent-blue);
        background: var(--glass-bg);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

.filter-select-compressed {
    /*width: 45px;*/
    /*padding: 2px 2px;*/
    background: var(--glass-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 0.5px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.filter-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .filter-range input {
        flex: 1;
        min-width: 0;
    }

.range-separator {
    color: var(--text-muted);
    font-size: 13px;
    flex-shrink: 0;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .checkbox-item input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--accent-blue);
        flex-shrink: 0;
    }

    .checkbox-item label {
        font-size: 13px;
        cursor: pointer;
    }

/* Date range specific styles */
input[type="date"] {
    max-width: 100%;
    overflow: hidden;
}

.date-range-container {
    margin-top: 8px;
}

    .date-range-container .filter-range {
        gap: 6px;
    }

    .date-range-container .filter-input {
        font-size: 13px;
        padding: 6px 8px;
    }

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

    .form-group label {
        display: block;
        margin-bottom: 6px;
        font-size: 13px;
        color: var(--text-secondary);
    }

    .form-group input {
        width: 100%;
        padding: 10px 12px;
        background-color: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        color: var(--text-primary);
        font-size: 13px;
    }

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.data-table {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.table-header {
    background: var(--bg-tertiary);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-headline);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.table-content {
    overflow-x: auto;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    /*text-align: left;*/
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.data-table th {
    font-family: var(--font-headline);
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Numeric data in tables - use monospace */
.data-table td,
.trades-table td,
.compressed-trades-table td,
.financials-table td,
.clusters-table td,
.alerts-table td {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Table headers use headline font */
.trades-table thead th,
.compressed-trades-table thead th,
.financials-table th,
.clusters-table th,
.alerts-table thead th {
    font-family: var(--font-headline);
    letter-spacing: -0.01em;
}

.data-table tr:nth-child(even) {
    background: var(--bg-primary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.card-title {
    font-family: var(--font-headline);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.metric-card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==========================================================================
   GRIDS & LAYOUTS
   ========================================================================== */

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Progress bars */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 13px;
    position: relative;
    z-index: 1000; /* Higher than filters panel to always be on top */
    color: var(--text-secondary);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 -4px 20px var(--glass-shadow);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

    .footer-link:hover {
        color: var(--accent-blue);
    }

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    width: 24px;
    height: 24px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

    .social-link:hover {
        background-color: var(--accent-blue);
        color: white;
    }

/* ==========================================================================
   SPECIALIZED COMPONENTS
   ========================================================================== */

/* Account Settings */
.account-settings {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.settings-description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 15px;
}

.settings-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

    .settings-section h2 {
        font-size: 18px;
        margin-bottom: 20px;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
    }

.account-number {
    font-size: 16px;
    color: var(--text-primary);
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 6px;
    display: inline-block;
}

.api-key-container {
    display: flex;
    gap: 10px;
}

.api-key {
    flex: 1;
    font-family: var(--font-mono);
    padding: 10px 12px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
}

.copy-btn {
    padding: 0 15px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .copy-btn:hover {
        background-color: var(--accent-blue-hover);
    }

.change-avatar-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

    .change-avatar-btn:hover {
        background-color: var(--bg-tertiary);
        border-color: var(--accent-blue);
    }

.save-changes-btn {
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

    .save-changes-btn:hover {
        background-color: var(--accent-blue-hover);
    }

    .save-changes-btn:disabled {
        background-color: var(--border-color);
        cursor: not-allowed;
        opacity: 0.7;
    }

/* Avatar */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.avatar-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-blue);
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* YouTube Videos Container */
.modern-trades-container .youtube-videos {
    padding: 20px !important;
    box-sizing: border-box;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    /* margin-top: 20px; removed - padding on parent handles spacing */
}

.video-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

    .video-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

.video-thumbnail {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
}

    .video-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* Newsletter Cards */
.newsletter-section {
    width: 100%;
    padding: 20px 0;
}

.newsletter-blog-section {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure newsletter page uses full main content width */
main:has(.newsletter-blog-section) {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

.newsletter-filter-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.newsletter-filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-family: inherit;
}

    .newsletter-filter-btn:hover {
        background: var(--bg-tertiary);
        border-color: var(--text-muted);
    }

    .newsletter-filter-btn.active {
        background: var(--accent-blue);
        border-color: var(--accent-blue);
        color: white;
    }

.newsletter-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 100%;
    justify-content: start;
    box-sizing: border-box;
}

.newsletter-card {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: block;
    width: 320px;
    box-shadow: 0 4px 16px var(--glass-shadow);
}

    .newsletter-card:hover {
        border-color: var(--accent-blue);
        background: var(--bg-tertiary);
        transform: translateY(-1px);
    }

.newsletter-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.newsletter-card-category {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .newsletter-card-category.newsletter-technical {
        background: #dc3545;
    }

    .newsletter-card-category.newsletter-market {
        background: #fd7e14;
    }

    .newsletter-card-category.newsletter-options {
        background: #6f42c1;
    }

    .newsletter-card-category.newsletter-earnings {
        background: #198754;
    }

.newsletter-card-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.newsletter-card-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.newsletter-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

.newsletter-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.newsletter-read-time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.newsletter-external-link {
    color: var(--accent-blue);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
}

    .newsletter-external-link:hover {
        color: var(--accent-blue-hover);
        text-decoration: underline;
    }

/* Financial Dashboard */
.financial-dashboard {
    width: 100%;
    padding: 20px 0;
    color: var(--text-primary);
}

.dashboard-header {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

.company-name {
    font-family: var(--font-headline);
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.company-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.company-details {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.detail-item {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.metrics-section,
.news-section,
.trades-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

    .metrics-section h3,
    .news-section h3,
    .trades-section h3 {
        color: var(--text-primary);
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 10px;
    }

.metric-card h3 {
    display: none;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.metric-label {
    color: var(--text-secondary);
}

.metric-value {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.news-feed {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 16px var(--glass-shadow);
}

.news-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

    .news-item:last-child {
        border-bottom: none;
    }

.news-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 5px;
}

.news-title {
    color: var(--accent-blue);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 5px;
    cursor: pointer;
}

    .news-title:hover {
        color: var(--accent-blue-hover);
    }

.news-source {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.financials-table,
.trades-table,
.clusters-table {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--glass-shadow);
}

    .financials-table table,
    .trades-table table,
    .clusters-table table {
        width: 100%;
        border-collapse: collapse;
    }

    .financials-table th,
    .trades-table th,
    .clusters-table th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        font-weight: 600;
        padding: 12px 8px;
        font-size: 13px;
        /*text-align: left;*/
        border-bottom: 1px solid var(--border-color);
    }

    .financials-table td,
    .trades-table td,
    .compressed-trades-table,
    .clusters-table td {
        padding: 2px 2px;
        font-size: 13px;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-secondary);
    }

        .financials-table tr:last-child td,
        .trades-table tr:last-child td,
        .compressed-trades-table tr:last-child td,
        .clusters-table tr:last-child td {
            border-bottom: none;
        }

        .financials-table tr:hover,
        .trades-table tr:hover,
        .compressed-trades-table tr:hover,
        .clusters-table tr:hover {
            background: var(--bg-tertiary);
        }

.negative {
    color: var(--accent-red);
}

.rank-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--accent-blue);
    color: white;
    text-align: center;
    line-height: 24px;
    font-size: 13px;
    font-weight: bold;
}

.ticker-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

    .ticker-link:hover {
        text-decoration: underline;
        color: var(--accent-blue-hover);
    }

.sector-link {
    color: var(--accent-blue);
    text-decoration: none;
}

    .sector-link:hover {
        text-decoration: underline;
        color: var(--accent-blue-hover);
    }

.industry-link {
    color: var(--accent-blue);
    text-decoration: none;
}

    .industry-link:hover {
        text-decoration: underline;
        color: var(--accent-blue-hover);
    }

.last-link {
    color: var(--accent-blue);
    text-decoration: none;
}

    .last-link:hover {
        text-decoration: underline;
        color: var(--accent-blue-hover);
    }

/* Terms and Conditions */
.terms-container {
    /*max-width: 900px;*/ /* 2025-11-27 BB */
    margin: 0 auto;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

    .terms-container h1 {
        font-size: 24px;
        margin-bottom: 10px;
        color: var(--text-primary);
    }

.last-updated {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.important-notice {
    background-color: var(--bg-tertiary);
    padding: 15px;
    border-left: 4px solid var(--accent-red);
    margin: 20px 0;
}

.terms-section {
    margin-bottom: 30px;
}

    .terms-section h2 {
        font-size: 18px;
        margin: 25px 0 15px;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 8px;
    }

    .terms-section p {
        margin-bottom: 15px;
        color: var(--text-primary);
    }

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
    /* width: 6px; */ /* BB 10/31/25 */
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    margin-right: 10px;
    flex-shrink: 0;
    z-index: 1002;
}

    .mobile-menu-btn svg {
        width: 24px;
        height: 24px;
    }

    .mobile-menu-btn:hover {
        background-color: var(--bg-tertiary);
        border-radius: 4px;
    }

/* Mobile Filters Button */
.mobile-filters-btn {
    display: none;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    margin-left: 10px;
    flex-shrink: 0;
    z-index: 1002;
}

    .mobile-filters-btn:hover {
        background: var(--bg-tertiary);
    }

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

    .mobile-overlay.active {
        display: block;
    }

/* Tablet and below (1024px) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .trades-section {
        grid-column: 1 / -1;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Logo smaller on tablet */
    .logo-img {
        width: 300px;
    }

    /* Search container adjust */
    .search-container {
        min-width: 100px;
    }
}

/* Tablet and Mobile (768px) */
@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        padding: 0 10px;
        flex-wrap: wrap; /* Allow search box to wrap to new line */
        height: auto; /* Allow height to grow */
        min-height: 60px;
        align-items: center;
    }

    /* Show mobile menu button */
    .mobile-menu-btn {
        display: block;
        order: 1; /* First item */
        flex: 0 0 auto;
    }

    /* Show mobile filters button */
    .mobile-filters-btn {
        display: block;
    }

    /* Logo smaller - only as wide as image */
    .logo {
        width: auto; /* Only as wide as content */
        height: 40px;
        margin-right: 10px;
        order: 2; /* Second item */
        flex: 0 0 auto; /* Don't grow or shrink */
        padding: 0;
    }

    .logo-img {
        width: 120px; /* Smaller on mobile */
        max-width: 100%;
        height: auto;
        max-height: 40px;
        display:none;
    }

    /* Header right adjustments - keep on same line */
    .header-right {
        margin-left: auto;
        padding-left: 0;
        gap: 10px;
        order: 4; /* Fourth item */
        flex: 0 0 auto; /* Don't grow or shrink */
    }

    /* Search container - move to new line below the 3 header elements */
    .search-container {
        order: 4;
        width: 100%;
        min-width: 0;
        margin: 10px 0 0 0;
        flex-basis: 100%;
        position: relative; /* Ensure dropdown works */
        z-index: 1000; /* Above other content */
    }

    .search-box {
        width: 150px;
        min-width: 0;
    }

    /* Ensure search dropdown shows on mobile */
    .search-dropdown {
        z-index: 1001 !important;
        position: absolute !important;
    }

    /* Hide exhaustion scores on mobile */
    .header .content-placeholder:has(#ExhaustionScores),
    .content-placeholder:has(#ExhaustionScores) {
        display: none !important;
    }

    /* Navigation - hidden by default, shown via mobile menu */
    .left-nav {
        position: fixed;
        top: 60px;
        left: -280px;
        width: 280px;
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        z-index: 1002;
        transition: left 0.3s ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
        display: block; /* Ensure it's displayed when opened */
    }

        .left-nav.mobile-open {
            left: 0;
        }

        .left-nav:hover {
            width: 280px;
        }

    .nav-text {
        opacity: 1; /* Always visible on mobile */
    }

    /* Main layout adjustments */
    .main-layout {
        margin-top: 10px; /* Spacing between header and main content */
        flex-direction: column;
        width: 100%;
        min-width: 0;
    }

        /* Left nav doesn't take up space in flex layout on mobile - it's fixed positioned */
        .main-layout .left-nav {
            position: fixed; /* Already set above, but ensure it's not in flow */
        }

    /* Main content adjustments */
    .main-content {
        padding: 15px 10px;
        width: 100%;
        min-width: 0;
        flex: 1 1 auto; /* Allow content to grow and wrap */
        overflow-x: hidden; /* Prevent horizontal scroll */
        overflow-y: visible; /* Allow vertical scrolling */
    }

    /* Content placeholder - allow wrapping */
    .content-placeholder {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Content placeholder - allow wrapping */
    .content-placeholder {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Filters panel - convert to modal on mobile */
    .filters-panel {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
        z-index: 1002;
        transition: right 0.3s ease;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
        border-left: 1px solid var(--glass-border);
    }

        .filters-panel.mobile-open {
            right: 0;
        }

        .filters-panel.closed {
            width: 100%;
            transform: none;
        }

            .filters-panel.closed.mobile-open {
                right: 0;
            }

    /* Tables - make horizontally scrollable */
    .trades-table-wrapper,
    .modern-trades-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .trades-table,
    .data-table,
    .compressed-trades-table,
    .alerts-table {
        min-width: 300px; /* Minimum width to prevent squishing */
    }

    /* Table wrapper scrollbar styling */
    .trades-table-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .trades-table-wrapper::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
    }

    .trades-table-wrapper::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 4px;
    }

    /* Form adjustments */
    .form-row {
        gap: 15px;
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
        width: 100%;
    }

    /* Grid adjustments */
    .grid-4,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    /* Video grid adjustments */
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    /* Footer adjustments */
    .footer {
        padding: 15px 10px;
        flex-direction: column;
        gap: 10px;
        height: auto;
        text-align: center;
    }

    .footer-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Tables - smaller padding and font */
    .data-table th,
    .data-table td,
    .trades-table th,
    .trades-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    /* Touch targets - larger on mobile */
    .nav-item,
    .filter-btn,
    .apply-btn,
    .user-btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }

    /* Filter inputs larger on mobile */
    .filter-input,
    .filter-select {
        height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Headings smaller on mobile */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    h5 {
        font-size: 1.1rem;
    }

    h6 {
        font-size: 1rem;
    }

    .trades-header h2 {
        font-size: 1.5rem;
    }

}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    /* Header more compact */
    .header {
        padding: 0 8px;
    }

    .logo-img {
        width: 150px;
    }

    .mobile-menu-btn,
    .mobile-filters-btn {
        padding: 6px;
    }

    /* Search container */
    .search-container {
        margin: 8px 0;
    }

    .search-box {
        /*height: 44px;*/ /* Larger touch target */
        font-size: 16px; /* Prevents zoom on iOS */
        width: 125px;
        min-width: 0;
    }
    
    /* User button - icon only */
    .user-btn span {
        display: none;
    }

    .user-avatar {
        /*width: 32px;*/
        /*height: 32px;*/
    }

    /* Main content padding */
    .main-content {
        padding: 10px 8px;
    }

    /* Filters panel full width on small mobile */
    .filters-panel {
        max-width: 100%;
    }

    /* Tables - even smaller padding */
    .data-table th,
    .data-table td,
    .trades-table th,
    .trades-table td {
        padding: 6px 4px;
        font-size: 13px;
    }

    .trades-table,
    .data-table,
    .compressed-trades-table,
    .alerts-table {
        min-width: 300px;
    }

    /* Newsletter cards stack on mobile */
    .newsletter-cards-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-filter-bar {
        gap: 8px;
        flex-wrap: wrap;
    }

    .newsletter-filter-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        min-height: 44px;
    }

    /* Terms container padding */
    .terms-container {
        padding: 15px 10px;
    }

        .terms-container h1 {
            font-size: 20px;
        }

    /* Headings even smaller */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.9rem;
    }

    .trades-header h2 {
        font-size: 1.25rem;
    }

    /* Modern trades container padding */
    .modern-trades-container {
        border-radius: 8px;
    }

    .trades-header {
        padding: 12px 15px;
    }

    /* Filter groups spacing */
    .filter-group {
        margin-bottom: 20px;
    }

        .filter-group label {
            font-size: 13px;
        }
}

/* Very small mobile (360px and below) */
@media (max-width: 360px) {
    .logo-img {
        width: 120px;
    }

    .trades-table,
    .data-table,
    .compressed-trades-table,
    .alerts-table {
        min-width: 300px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .header,
    .footer,
    .left-nav,
    .filters-panel,
    .user-dropdown,
    .notification-btn {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-layout {
        margin-top: 0 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .card,
    .data-table,
    .metric-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* Modern Trades Table CSS */
.modern-trades-container {
    /* Background and border removed - they don't work with rounded corners */
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 12px;
    overflow: hidden; /* Contain content within container */
    box-shadow: 0 8px 32px var(--glass-shadow);
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important; /* Allow container to shrink */
    box-sizing: border-box;
}

    /* Remove rounded corners from trades table but keep them on header */
    .modern-trades-container:has(.trades-table) {
        border-radius: 0;
        overflow: visible;
    }

        .modern-trades-container:has(.trades-table) .trades-header {
            border-radius: 12px 12px 0 0;
        }

        .modern-trades-container:has(.trades-table) .trades-table-wrapper {
            border-radius: 0;
        }

        .modern-trades-container:has(.trades-table) .trades-table {
            border-radius: 0;
        }

/* Exhaustion scores container should only be as wide as its content and aligned right */
.content-placeholder:has(#ExhaustionScores) {
    text-align: right;
}

    .content-placeholder:has(#ExhaustionScores) .modern-trades-container {
        width: auto !important;
        max-width: fit-content;
        display: inline-block;
    }

.trades-header {
    padding: 10px;
    background: var(--glass-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

    .trades-header h2 {
        font-family: var(--font-headline);
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
        letter-spacing: -0.01em;
        line-height: 1.4;
    }

    .trades-header h3 {
        font-family: var(--font-headline);
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: var(--text-primary);
        letter-spacing: -0.01em;
    }

.trades-table-wrapper {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0; /* Allow shrinking below content size */
    box-sizing: border-box;
    border-radius: 0; /* No rounded corners on table wrapper */
}

.trades-table {
    width: 100% !important; /* Override DataTables width */
    max-width: 100% !important;
    min-width: 0 !important; /* Force table to shrink */
    border-collapse: collapse;
    table-layout: auto; /* Auto layout allows columns to shrink */
    box-sizing: border-box;
}

    /* Override any inline styles DataTables might add */
    .trades-table[style*="width"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Ensure table cells can shrink and auto-size */
    .trades-table th,
    .trades-table td {
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        overflow: visible;
        text-overflow: clip;
        /*white-space: normal;*/
    }

/* Allow columns to auto-size based on content after visibility changes */
.trades-table {
    table-layout: auto !important;
}

/* Ensure table expands to fill available space */
.main-content .trades-table {
    width: 100% !important;
    max-width: 100% !important;
}

.trades-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    padding: 16px 8px;
    /*text-align: left;*/
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-radius: 0; /* Remove rounded corners from header row */
}

    .trades-table thead th:hover {
        background: var(--bg-primary);
    }

    .trades-table thead th.sortable::after {
        content: ' ↕';
        color: var(--text-muted);
        font-size: 10px;
    }

    .trades-table thead th.sort-asc::after {
        content: ' ↑';
        color: var(--accent-blue);
    }

    .trades-table thead th.sort-desc::after {
        content: ' ↓';
        color: var(--accent-blue);
    }

.trades-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

    .trades-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

    .trades-table tbody tr:last-child {
        border-bottom: none;
    }

.trades-table td {
    padding: 4px 6px;
    font-size: 13px;
    vertical-align: top;
}

/* Responsive column visibility - DISABLED FOR TROUBLESHOOTING */
/* All columns will be visible regardless of screen size */

/* Force all columns to be visible - but allow DataTables to hide them */
.trades-table th,
.trades-table td {
    display: table-cell !important;
}

    /* Allow DataTables to properly hide columns by removing display override */
    .trades-table th[style*="display: none"],
    .trades-table td[style*="display: none"],
    .trades-table th.dt-hidden,
    .trades-table td.dt-hidden {
        display: none !important;
    }

/* Hide "nice to have" columns (Industry, RS, PCT, Last, Charts) when space is limited - DISABLED */
/* @media (max-width: 1600px) {
    .trades-table th[data-priority="nice"],
    .trades-table thead th:nth-child(7),  
    .trades-table thead th:nth-child(10), 
    .trades-table thead th:nth-child(11), 
    .trades-table thead th:nth-child(13), 
    .trades-table thead th:nth-child(14), 
    .trades-table td:nth-child(7),  
    .trades-table td:nth-child(10), 
    .trades-table td:nth-child(11), 
    .trades-table td:nth-child(13), 
    .trades-table td:nth-child(14) { 
        display: none;
    }
} */

/* Hide "should show" columns (CP, Sh, $$) on smaller screens - DISABLED */
/* @media (max-width: 1200px) {
    .trades-table th[data-priority="should"],
    .trades-table thead th:nth-child(4),  
    .trades-table thead th:nth-child(8),  
    .trades-table thead th:nth-child(9),  
    .trades-table td:nth-child(4),  
    .trades-table td:nth-child(8),  
    .trades-table td:nth-child(9) { 
        display: none;
    }
} */

/* Always show "must show" columns: Time (2), Ticker (3), TP (5), Sector (6), Rank (12) */

.compressed-trades-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    min-width: 0px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, .4);
}

[data-theme="light"] .compressed-trades-table {
    background-color: rgba(255, 255, 255, 0.6);
}

/* Exhaustion scores table should only be as wide as its content */
#ExhaustionScores {
    width: auto;
    max-width: fit-content;
}

/* Remove all borders from exhaustion scores table */
#ExhaustionScores {
    border: none !important;
}

    #ExhaustionScores td {
        border: none !important;
        border-bottom: none !important;
    }

    #ExhaustionScores tr {
        border: none !important;
        border-bottom: none !important;
    }

/* Remove border from exhaustion scores wrapper and container */
.content-placeholder:has(#ExhaustionScores) .trades-table-wrapper {
    border: none !important;
    border-bottom: none !important;
}

.content-placeholder:has(#ExhaustionScores) .modern-trades-container {
    border: none !important;
    border-bottom: none !important;
}

.compressed-trades-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    /*padding: 8px 8px;*/
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

    .compressed-trades-table thead th:hover {
        background: var(--bg-primary);
    }

    .compressed-trades-table thead th.sortable::after {
        content: ' ↕';
        color: var(--text-muted);
        font-size: 10px;
    }

    .compressed-trades-table thead th.sort-asc::after {
        content: ' ↑';
        color: var(--accent-blue);
    }

    .compressed-trades-table thead th.sort-desc::after {
        content: ' ↓';
        color: var(--accent-blue);
    }

.compressed-trades-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

    .compressed-trades-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

    .compressed-trades-table tbody tr:last-child {
        border-bottom: none;
    }

.compressed-trades-table td {
    padding: 8px 8px;
    /*font-size: 12px;*/
    /*vertical-align: middle;*/
}

/* Column-specific styling */
.indicator-cell {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.time-cell {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 12px;
    width: 90px;
    /*text-align: right;*/
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.time-cell-mobile {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 12px;
    width: 90px;
    /*text-align: right;*/
    font-variant-numeric: tabular-nums;
}

.ticker-cell {
    width: 100px;
    white-space: nowrap;
}

.ticker-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

/* Emphasize ticker names in trades table - use light gray color (same as TP) */
.trades-table .ticker-link,
.compressed-trades-table .ticker-link {
    font-weight: normal;
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

    .trades-table .ticker-link:hover,
    .compressed-trades-table .ticker-link:hover {
        color: var(--accent-blue);
        text-decoration: underline;
        transform: scale(1.05);
    }

.ticker-link:hover {
    text-decoration: underline;
}

.ticker-count {
    color: var(--text-muted);
    font-size: 11px;
}

.current-cell {
    width: 80px;
    font-family: var(--font-mono);
    /*font-weight: 600;*/
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.price-negative {
    color: var(--accent-red);
}

.price-positive {
    color: var(--success-green);
}

.trade-cell {
    width: 80px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    /*font-weight: 500;*/
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sector-cell {
    color: var(--accent-blue);
    /*font-weight: 500;*/
    /*white-space: nowrap;*/
}

.data-cell {
    font-weight: 500;
}

.industry-cell {
    color: var(--accent-blue);
    /*white-space: nowrap;*/
}

.shares-cell {
    width: 60px;
    font-family: var(--font-mono);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.shares-highlight {
    font-family: var(--font-mono);
    background: var(--success-green);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.money-cell {
    width: 70px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    /*font-weight: 500;*/
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.money-highlight {
    font-family: var(--font-mono);
    background: var(--highlight);
    color: black;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rs-cell {
    width: 60px;
    font-family: var(--font-mono);
    text-align: right;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.rs-highlight {
    font-family: var(--font-mono);
    background: var(--highlight);
    color: black;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pct-cell {
    width: 70px;
    font-family: var(--font-mono);
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pct-highlight {
    font-family: var(--font-mono);
    background: var(--highlight);
    color: black;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.r-cell {
    width: 40px;
    font-family: var(--font-mono);
    text-align: right;
    color: var(--text-secondary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.r-highlight {
    font-family: var(--font-mono);
    background: var(--highlight);
    color: black;
    padding: 4px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.last-cell {
    width: 90px;
    color: var(--text-secondary);
    /*font-size: 12px;*/
    text-align: left;
    white-space: nowrap;
}

.charts-cell {
    /*width: 100px;*/
    vertical-align:top;
    /*text-align: center;*/
    white-space: nowrap;
}

.chart-links {
    display: flex;
    gap: 2px;
    justify-content: center;
}

.chart-link {
    /*background: var(--accent-blue);*/
    color: var(--accent-blue);
    text-decoration: none;
    padding: 2px 2px;
    border-radius: 4px;
    font-size: 13px;
    /*font-weight: 600;*/
    font-family: var(--font-mono);
}

    .chart-link:hover {
        background: var(--text-primary);
    }

[data-theme="light"] .chart-link:hover {
    background: var(--accent-blue-hover);
    color: white;
}

.alerts-table {
    width: 100%;
    border-collapse: collapse;
    /*min-width: 1200px;*/
}

.alerts-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 16px 20px;
    /*text-align: left;*/
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.alerts-table thead th:hover {
    background: var(--bg-primary);
}

.alerts-table thead th.sortable::after {
    content: ' ↕';
    color: var(--text-muted);
    font-size: 10px;
}

.alerts-table thead th.sort-asc::after {
    content: ' ↑';
    color: var(--accent-blue);
}

.alerts-table thead th.sort-desc::after {
    content: ' ↓';
    color: var(--accent-blue);
}

.alerts-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.alerts-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.alerts-table tbody tr:last-child {
    border-bottom: none;
}

/* Subtle row delineation for WatchListConfigs */
#WatchLists tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

    #WatchLists tbody tr:last-child {
        border-bottom: none;
    }

/* Light mode override for WatchListConfigs row borders */
[data-theme="light"] #WatchLists tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   LIGHT MODE SPECIFIC STYLES
   ========================================================================== */

/* Light mode background overlay adjustment */
[data-theme="light"] body::before {
    background-color: rgba(255, 255, 255, 0.75);
}

/* Light mode header adjustments */
[data-theme="light"] .header {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid var(--glass-border);
}

/* Light mode footer adjustments */
[data-theme="light"] .footer {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid var(--glass-border);
}

/* Light mode left navigation adjustments */
[data-theme="light"] .left-nav {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-right: 1px solid var(--glass-border);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}

/* Light mode search box adjustments */
[data-theme="light"] .search-box {
    background: var(--glass-bg-light);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
}

    [data-theme="light"] .search-box:focus {
        background: var(--glass-bg);
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    }

/* Light mode search dropdown */
[data-theme="light"] .search-dropdown {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Light mode dropdown menu */
[data-theme="light"] .dropdown-menu {
    background: var(--bg-secondary);
    backdrop-filter: none; /* Remove transparency */
    -webkit-backdrop-filter: none; /* Remove transparency */
    border: 0.5px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Light mode filters panel */
[data-theme="light"] .filters-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-left: 0.5px solid var(--glass-border);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .filters-toggle {
    background: var(--glass-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 0.5px solid var(--glass-border);
}

/* Light mode modern trades container */
[data-theme="light"] .modern-trades-container {
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Light mode trades header */
[data-theme="light"] .trades-header {
    background: var(--glass-bg-light);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid var(--glass-border);
}

/* Light mode table adjustments */
[data-theme="light"] .trades-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

    [data-theme="light"] .trades-table thead th:hover {
        background: var(--bg-secondary);
    }

[data-theme="light"] .trades-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

    [data-theme="light"] .trades-table tbody tr:hover {
        background: var(--bg-tertiary);
    }

/* Light mode compressed trades table */
[data-theme="light"] .compressed-trades-table {
    background-color: rgba(255, 255, 255, 0.6);
}

    [data-theme="light"] .compressed-trades-table thead th {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-color);
    }

        [data-theme="light"] .compressed-trades-table thead th:hover {
            background: var(--bg-secondary);
        }

    [data-theme="light"] .compressed-trades-table tbody tr {
        border-bottom: 1px solid var(--border-color);
    }

        [data-theme="light"] .compressed-trades-table tbody tr:hover {
            background: var(--bg-tertiary);
        }

/* Light mode alerts table wrapper */
[data-theme="light"] .trades-table-wrapper:has(.alerts-table) {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Light mode filter inputs and selects */
[data-theme="light"] .filter-input,
[data-theme="light"] .filter-select {
    background: var(--bg-primary);
    border: 0.5px solid var(--border-color);
    color: var(--text-primary);
}

    [data-theme="light"] .filter-input:focus,
    [data-theme="light"] .filter-select:focus {
        border-color: var(--accent-blue);
        box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
    }

/* Light mode filter groups */
[data-theme="light"] .filter-group {
    border-bottom: 0.5px solid var(--border-color);
}

/* Light mode checkbox styling */
[data-theme="light"] .checkbox-item input[type="checkbox"] {
    accent-color: var(--accent-blue);
}

/* Light mode button adjustments */
[data-theme="light"] .filter-btn {
    background: var(--accent-blue);
    color: white;
}

    [data-theme="light"] .filter-btn:hover {
        background: var(--accent-blue-hover);
    }

    [data-theme="light"] .filter-btn.reset-btn {
        background: transparent;
        color: var(--text-secondary);
        border: 1px solid var(--border-color);
    }

        [data-theme="light"] .filter-btn.reset-btn:hover {
            background: var(--bg-tertiary);
        }

/* Light mode toggle switch */
[data-theme="light"] .toggle-switch {
    background-color: var(--border-color);
}

    [data-theme="light"] .toggle-switch.active {
        background-color: var(--accent-blue);
    }

/* Light mode user button */
[data-theme="light"] .user-btn:hover {
    background-color: var(--bg-tertiary);
}

/* Light mode notification button */
[data-theme="light"] .notification-btn:hover {
    background-color: var(--bg-tertiary);
}

/* Light mode nav item active state - ensure white text on blue background */
[data-theme="light"] .nav-item.active {
    background: var(--accent-blue);
    color: white;
}

    [data-theme="light"] .nav-item.active .nav-icon {
        color: white;
    }

    [data-theme="light"] .nav-item.active .nav-text {
        color: white;
    }

/* Light mode nav submenu item hover */
[data-theme="light"] .nav-submenu-item:hover {
    background: var(--bg-tertiary);
}

[data-theme="light"] .nav-submenu-item.active {
    background: var(--bg-tertiary);
}

/* Light mode chart links and ticker links */
[data-theme="light"] .chart-link {
    /*color: #ffffff;*/
}

    [data-theme="light"] .chart-link:hover {
        background: var(--accent-blue-hover);
        color: white;
    }

[data-theme="light"] .ticker-link {
    color: var(--accent-blue);
}

    [data-theme="light"] .ticker-link:hover {
        color: var(--accent-blue);
    }

/* Light mode pagination (if any custom styling exists) */
[data-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-primary) !important;
}

    [data-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: var(--accent-blue) !important;
        color: white !important;
    }

    [data-theme="light"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
        background: var(--bg-tertiary) !important;
        color: var(--text-primary) !important;
    }

/* Light mode Highcharts tooltip container */
[data-theme="light"] .highcharts-tooltip-container {
    color: #000000 !important;
}

/* Light mode Highcharts stock tools */
[data-theme="light"] .highcharts-stocktools-toolbar,
[data-theme="light"] ul.highcharts-stocktools-toolbar,
[data-theme="light"] ul.stocktools-toolbar {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
}

    [data-theme="light"] .highcharts-stocktools-toolbar-item,
    [data-theme="light"] ul.highcharts-stocktools-toolbar li,
    [data-theme="light"] ul.stocktools-toolbar li {
        background: transparent !important;
        border: none !important;
    }

        [data-theme="light"] .highcharts-stocktools-toolbar-button,
        [data-theme="light"] ul.highcharts-stocktools-toolbar li button,
        [data-theme="light"] ul.stocktools-toolbar li button {
            color: var(--text-primary) !important;
        }

            [data-theme="light"] .highcharts-stocktools-toolbar-button:hover,
            [data-theme="light"] ul.highcharts-stocktools-toolbar li button:hover,
            [data-theme="light"] ul.stocktools-toolbar li button:hover {
                background: var(--bg-tertiary) !important;
            }

/* Light mode content placeholder */
[data-theme="light"] .content-placeholder {
    color: var(--text-muted);
}

/* Light mode legend and other UI elements */
[data-theme="light"] .legend-item {
    color: var(--text-primary);
}

/* Light mode data table info */
[data-theme="light"] .dataTables_wrapper .dataTables_info {
    color: var(--text-secondary);
}

/* Light mode filter label */
[data-theme="light"] .filter-label {
    color: var(--text-primary);
}

/* Light mode filters header */
[data-theme="light"] .filters-header {
    border-bottom: 0.5px solid var(--border-color);
}

[data-theme="light"] .filters-title {
    color: var(--text-primary);
}

/* Ensure WatchListConfig page uses all available space */
.trades-table-wrapper:has(.compressed-trades-table) {
    width: 100% !important;
    max-width: 100% !important;
}

/* Add padding to Profile page containers */
main:has(.compressed-trades-table) .trades-table-wrapper:has(.compressed-trades-table) {
    padding: 10px;
}

main:has(.compressed-trades-table) .modern-trades-container:has(.compressed-trades-table) {
    padding: 0;
}

.compressed-trades-table td {
    width: auto;
    max-width: none;
}

/* Override content-placeholder width constraint for WatchListConfig */
.content-placeholder:has(.compressed-trades-table) {
    max-width: 100% !important;
    flex-shrink: 1 !important;
}

/* Ensure form and all containers expand for WatchListConfig */
main:has(.compressed-trades-table) form,
form:has(.compressed-trades-table) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    display: block;
    margin: 0;
    padding: 0;
}

    /* Ensure main-content expands when inside form on WatchListConfig */
    main:has(.compressed-trades-table) form .main-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

main:has(.compressed-trades-table) .content-placeholder {
    max-width: 100% !important;
    flex-shrink: 1 !important;
    box-sizing: border-box;
}

main:has(.compressed-trades-table) .modern-trades-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

main:has(.compressed-trades-table) .trades-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

/* DataTables info padding */
.dataTables_wrapper .dataTables_info {
    padding: 1em !important;
}

.alerts-table td {
    padding: 12px 10px;
    font-size: 13px;
    vertical-align: top;
}

    /* Extra padding for first and last columns */
    .alerts-table thead th:first-child,
    .alerts-table td:first-child {
        /*padding-left: 24px;*/
    }

    .alerts-table thead th:last-child,
    .alerts-table td:last-child {
        /*padding-right: 24px;*/
    }

/* Add padding to alerts table wrapper */
.trades-table-wrapper:has(.alerts-table) {
    background-color: rgba(0, 0, 0, .6);
}

[data-theme="light"] .trades-table-wrapper:has(.alerts-table) {
    background-color: rgba(255, 255, 255, 0.8);
}

.alert-cell {
    color: var(--text-secondary);
    white-space: wrap;
    font-size: 13px;
}

.alertconditions-cell {
    color: var(--text-secondary);
    white-space: nowrap;
    vertical-align: top;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .trades-table {
        /*font-size: 11px;*/
    }

        .trades-table th,
        .trades-table td {
            padding: 8px 4px;
        }

    .chart-link {
        /*font-size: 9px;*/
        padding: 2px 4px;
    }
}

/* Homepage carryover from original site */
.homepage-inset {
    display: -webkit-flex;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.refresh-indicator {
    display: none;
    padding-right: 20px;
    width: 200px;
    color: var(--text-tertiary);
}

.refresh-indicator::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}