/* ===== MODERN MARKETSURGE CHART STYLES ===== */

/* CSS Variables for Theme */
:root {
    --primary-color: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #3385d6;
    --success-color: #00cc66;
    --danger-color: #ff4444;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    --bg-primary: #0a0e1a;
    --bg-secondary: #141827;
    --bg-tertiary: #1e2433;
    --bg-card: rgba(30, 36, 51, 0.8);
    
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.05);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --sidebar-width: 360px;
    --header-height: 80px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 50%, #0f1419 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated Background Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(0, 102, 204, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(23, 162, 184, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.app-header {
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-md);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.brand-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.brand-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
}

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.icon-button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

/* ===== MAIN LAYOUT ===== */
/* ===== MAIN LAYOUT ===== */
.main-layout {
    display: flex;
    flex: 1;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 2000px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - var(--header-height));
    min-height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-height) - 3rem);
}

.sidebar-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    margin-bottom: 1.5rem;  /* ADD THIS LINE */
}

.sidebar-section:last-child {
    margin-bottom: 0;  /* ADD THIS TOO */
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ===== LOOKUP SECTION ===== */
.lookup-section {
    position: relative;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.stock-primary-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.symbol-display {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.price-info {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price.positive { color: var(--success-color); }
.price.negative { color: var(--danger-color); }

.change {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: var(--glass-bg);
}

.change.positive { 
    background: rgba(0, 204, 102, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(0, 204, 102, 0.3);
}

.change.negative { 
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.data-source-indicator {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border-color);
    background: var(--glass-bg);
}

.data-source-indicator.live { 
    background: rgba(0, 204, 102, 0.2);
    border-color: var(--success-color);
    color: var(--success-color);
}

.data-source-indicator.loading { 
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--primary-color);
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Quick Lookup */
.quick-lookup {
    position: relative;
    z-index: 101;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-box {
    position: relative;
    z-index: 102;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.search-icon {
    font-size: 1.25rem;
    opacity: 0.6;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.5rem 0;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.primary-button {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    white-space: nowrap;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.4);
}

.primary-button:active {
    transform: translateY(0);
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-button {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-button:hover {
    background: var(--glass-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.action-button.patterns {
    border-color: #28a745;
}

.action-button.patterns:hover {
    background: rgba(40, 167, 69, 0.1);
    border-color: #28a745;
}

.action-button.pivots {
    border-color: #ff6b35;
}

.action-button.pivots:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: #ff6b35;
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    align-items: center;
}

.quick-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.preset-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeframe-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeframe-btn:hover:not(.active) {
    background: var(--glass-bg);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.timeframe-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.timeframe-btn.active:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
    box-shadow: 0 3px 10px rgba(0, 102, 204, 0.4);
    transform: translateY(-1px);
}

.custom-timeframe {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

.custom-timeframe select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-timeframe select:hover,
.custom-timeframe select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.data-points-estimate {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid rgba(0, 102, 204, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.data-points-estimate.warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    color: var(--warning-color);
}

.data-points-estimate.error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
    color: var(--danger-color);
}

.csv-button {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.csv-button:hover {
    background: var(--glass-bg);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.csv-button:active {
    transform: translateY(0);
}

.dropdown-arrow-inline {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.csv-button.active .dropdown-arrow-inline {
    transform: rotate(180deg);
}

/* ===== CHART SECTION ===== */
.chart-section {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.chart-container-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.chart-main {
    flex: 1;
    min-height: 500px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: stretch;
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
}

.volume-chart {
    height: 240px;
    min-height: 220px;
    max-height: 260px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 0;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: stretch;
    padding: 0.75rem 0.75rem 2.5rem 0.75rem;
}

/* Chart SVG and Canvas - Fill container completely */
.chart-main svg,
.volume-chart svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

canvas {
    pointer-events: none !important;
    position: absolute;
    z-index: 1;
}

/* Pattern Toggle */
.pattern-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 100;
    transition: all 0.3s ease;
    user-select: none;
}

.pattern-toggle:hover {
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.pattern-toggle.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Legend */
.legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.legend-item:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Help Panel */
.help-panel {
    background: var(--glass-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0;
    flex-shrink: 0;
}

.help-panel h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.indicator-status {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-item {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.status-item.active {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success-color);
}

.status-item.warning {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
}

.status-item.danger {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger-color);
}

/* ===== ADDITIONAL SIDEBAR SECTIONS ===== */

.sidebar-section:hover {
    transform: translateY(-2px);
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ratings Grid */
.ratings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.rating-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.rating-card:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.rating-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

.rating-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Rating Colors */
.rating-excellent { 
    background: linear-gradient(135deg, #00cc66, #00aa55);
    border-color: #00aa55 !important;
}

.rating-good { 
    background: linear-gradient(135deg, #66ccff, #0099cc);
    border-color: #0099cc !important;
}

.rating-average { 
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    border-color: #ff9900 !important;
}

.rating-poor { 
    background: linear-gradient(135deg, #ff6666, #cc0000);
    border-color: #cc0000 !important;
}

.rating-excellent, .rating-good, .rating-average, .rating-poor {
    color: white !important;
}

.rating-excellent .rating-label,
.rating-good .rating-label,
.rating-average .rating-label,
.rating-poor .rating-label,
.rating-excellent .rating-value,
.rating-good .rating-value,
.rating-average .rating-value,
.rating-poor .rating-value {
    color: white !important;
}

/* Pattern Section - For Dynamically Generated HTML */
.pattern-section {
    border-color: rgba(0, 102, 204, 0.3);
}

.pattern-section .pattern-header {
    margin-bottom: 1rem;
}

.pattern-section .pattern-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.pattern-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.pattern-icon.cup-handle { background: #28a745; }
.pattern-icon.flat-base { background: #007bff; }
.pattern-icon.double-bottom { background: #6f42c1; }
.pattern-icon.ascending-base { background: #fd7e14; }
.pattern-icon.high-tight-flag { background: #ff9500; }
.pattern-icon.bull-flag { background: #ff5722; }
.pattern-icon.consolidation { background: #6c757d; }

.pattern-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pattern-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pattern-status {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
    margin-left: 0.5rem;
}

.pattern-status.recent,
.pattern-status.status-recent {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

/* Pattern Metrics Grid - THIS IS THE KEY */
.pattern-section .pattern-metrics-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
}

.pattern-section .pattern-metrics-grid .metric-item {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-light) !important;
}

.pattern-section .metric-item .metric-label {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
}

.pattern-section .metric-item .metric-value {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
    text-align: right !important;
    margin: 0 !important;
}

.pattern-section .metric-value.medium {
    color: #ffc107 !important;
}

.pattern-section .metric-value.high {
    color: #28a745 !important;
}

.pattern-section .metric-value.low {
    color: #dc3545 !important;
}

/* Volume Info Section */
.pattern-section .pattern-volume-info {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-light) !important;
}

.pattern-section .volume-label {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 0 !important;
}

.pattern-section .pattern-volume-info .pattern-metric-value {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: var(--primary-color) !important;
    text-align: right !important;
    margin: 0 !important;
}

.pattern-section .pattern-metric-value.volume-good {
    color: #28a745 !important;
}

.pattern-section .pattern-metric-value.volume-excellent {
    color: #17a2b8 !important;
}

/* Pattern Status Badge */

.pattern-status.status-forming {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.pattern-status.status-recent {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.pattern-status.status-stale {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* Pocket Pivot Section - Enhanced */
.pivot-section {
    border-color: rgba(255, 107, 53, 0.3);
}

.pivot-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pocket-pivot-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff6b35;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    color: white;
}

.pocket-pivot-count {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: inline-block;
}

/* ADD THESE STYLES */
.pivot-metrics,
#pocketPivotDetails,
.pocket-pivot-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pivot-metrics .metric-row,
#pocketPivotDetails > div,
.pocket-pivot-metric {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-light) !important;
}

.pivot-metrics .metric-label,
.pattern-metric-label,
#pocketPivotDetails .pattern-metric-label {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0 !important;
}

.pivot-metrics .metric-value,
.pattern-metric-value,
#pocketPivotDetails .pattern-metric-value {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #ff6b35 !important;
    text-align: right !important;
    margin-top: 0 !important;
}

/* This is the key fix */
#pocketPivotDetails .metric-row,
.pivot-metrics .metric-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.75rem !important;
    background: var(--bg-tertiary) !important;
    border-radius: 6px !important;
    min-height: 44px;
}

#pocketPivotDetails .metric-label,
.pivot-metrics .metric-label {
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0;
}

#pocketPivotDetails .metric-value,
.pivot-metrics .metric-value {
    font-size: 1rem !important;
    font-weight: 800 !important;
    color: #ff6b35 !important;
    text-align: right;
    margin-left: auto;
}

/* Pin Bar Markers */
.pin-bar-marker {
    pointer-events: all !important;
    cursor: pointer;
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.pin-bar-circle {
    transition: stroke-width 0.2s ease;
}

.pin-bar-symbol {
    pointer-events: none !important;
    user-select: none;
}

.pin-bar-hover-area {
    pointer-events: all !important;
}


/* Zones Section */
.zones-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.zone-card {
    background: var(--bg-tertiary);
    border-left: 4px solid;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zone-card.buy-zone { border-left-color: var(--primary-color); }
.zone-card.profit-zone { border-left-color: var(--success-color); }
.zone-card.stop-zone { border-left-color: var(--danger-color); }

.zone-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.zone-value {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Signals Section */
.signals-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.signal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.signal-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.signal-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}
/* ===== LOADING STATUS PANEL ===== */
.loading-status-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    z-index: 10000;
    box-shadow: var(--shadow-lg);
}

.loading-status-panel.active {
    display: block;
}

.loading-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.loading-progress {
    background: var(--bg-tertiary);
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.loading-progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
}

.api-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse-status 2s infinite;
}

.api-status-indicator.connecting {
    background: var(--warning-color);
}

.api-status-indicator.error {
    background: var(--danger-color);
    animation: none;
}

@keyframes pulse-status {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.loading-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.loading-metric {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.loading-metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.loading-metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.retry-section,
.error-details {
    display: none;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.retry-section.show,
.error-details.show {
    display: block;
}

.error-details {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
}

.retry-section h4,
.error-details h4 {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.retry-section button {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-section button:hover {
    transform: translateY(-2px);
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.modal-content h3 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem;
}

.modal-content p,
.modal-content li {
    color: var(--text-secondary);
    line-height: 1.6;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
}

/* ===== TOOLTIP ===== */
#tooltip {
    position: absolute;
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    pointer-events: none !important;
    z-index: 10000 !important;
    max-width: 300px;
    line-height: 1.6;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    display: none;
}

#tooltip.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

#tooltip table {
    width: 100%;
    border-collapse: collapse;
}

#tooltip td {
    padding: 0.25rem 0;
    border: none;
}

#tooltip td:first-child {
    color: rgba(255, 255, 255, 0.7);  /* Lighter grey for better readability */
    padding-right: 1rem;
}

#tooltip td:last-child {
    font-weight: 700;
    text-align: right;
}

/* ===== D3 CHART ELEMENTS ===== */
.axis {
    font-size: 12px;
}

.axis text {
    fill: var(--text-secondary);
    font-weight: 500;
}

.axis path,
.axis line {
    stroke: var(--border-color);
    shape-rendering: crispEdges;
}

.grid line {
    stroke: var(--border-color);
    stroke-dasharray: 2, 2;
    opacity: 1.0;
}

.grid path {
    stroke-width: 0;
}

/* Moving Average Lines */
.ma-line {
    fill: none;
    stroke-width: 2;
    opacity: 0.8;
    transition: stroke-width 0.2s ease, opacity 0.2s ease;
}

.ma-line:hover {
    stroke-width: 3;
    opacity: 1;
}

.ema21 { stroke: #8B4513; }
.sma50 { stroke: #FFA500; }
.sma200 { stroke: #4169E1; }

/* Candlestick Elements - 3D Enhanced (JavaScript controlled only) */
.candle {
    pointer-events: all !important;
    cursor: crosshair;
}

.candle .wick {
    stroke: #666;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
    filter: drop-shadow(0.3px 0.3px 0.5px rgba(0, 0, 0, 0.2));
    transition: none;
}

.candle .body {
    stroke-width: 1;
    pointer-events: none;
    transition: none;
}

.candle .body-highlight {
    pointer-events: none;
    mix-blend-mode: screen;
    transition: none;
}

.candle .body-shadow {
    pointer-events: none;
    mix-blend-mode: multiply;
    transition: none;
}

/* Volume Bars - 3D Enhanced (JavaScript controlled) */
.volume-bar {
    pointer-events: all !important;
    cursor: pointer;
    transition: none;
}

.volume-bar-highlight {
    pointer-events: none;
    mix-blend-mode: screen;
}

.volume-bar-shadow {
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* Remove CSS hover effects - JavaScript handles this */


/* RS Indicators */
.rs-high,
.rs-low {
    pointer-events: all !important;
    cursor: pointer;
    transition: stroke-width 0.1s ease, filter 0.1s ease;
}

.rs-high {
    fill: #66ccff;
    stroke: #0066cc;
    stroke-width: 2;
}

.rs-low {
    fill: #ff9900;
    stroke: #cc6600;
    stroke-width: 2;
}

.rs-high:hover,
.rs-low:hover {
    stroke-width: 3 !important;
    filter: brightness(1.2);
}

/* Pocket Pivot Markers */
.pocket-pivot-marker {
    pointer-events: all !important;
    cursor: pointer;
    transition: stroke-width 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}

.pocket-pivot-hover-area {
    pointer-events: all !important;
    cursor: pointer;
    fill: transparent;
}

.pocket-pivot-circle {
    pointer-events: none !important;
    fill: #ff6b35;
    stroke: #ffffff;
    stroke-width: 2;
    opacity: 0.9;
}

.pocket-pivot-marker:hover .pocket-pivot-circle {
    stroke-width: 3 !important;
    opacity: 1 !important;
    filter: drop-shadow(0 3px 6px rgba(255, 107, 53, 0.4));
}

.pocket-pivot-label {
    pointer-events: none !important;
}

.pocket-pivot-label text {
    fill: #000;
    font-weight: 600;
    font-size: 10px;
}

.pocket-pivot-label rect {
    fill: #ffeb3b;
    stroke: #333;
    stroke-width: 1px;
}

/* Pattern Overlays */
.pattern-overlay {
    pointer-events: none !important;
    opacity: 0.8;
}

.pattern-boundary {
    pointer-events: none !important;
    fill: none;
    stroke-width: 2;
    stroke-dasharray: 4, 2;
    opacity: 0.8;
}

.cup-pattern { stroke: #28a745; }
.handle-pattern { stroke: #17a2b8; }
.flat-base-pattern { stroke: #007bff; }
.double-bottom-pattern { stroke: #6f42c1; }
.ascending-base-pattern { stroke: #fd7e14; }
.high-tight-flag-pattern { stroke: #ff9500; }

.pattern-label {
    font-size: 11px;
    font-weight: bold;
    text-anchor: middle;
    fill: var(--text-primary);
    opacity: 0.9;
}

/* Trading Zone Lines */
.trading-zone-line {
    pointer-events: none !important;
    stroke-width: 2;
    stroke-dasharray: 5, 3;
    opacity: 0.8;
}

.buy-zone-line { stroke: var(--primary-color); }
.profit-zone-line { stroke: var(--success-color); }
.stop-zone-line { stroke: var(--danger-color); }

.trading-zone-label,
.trading-zone-price {
    pointer-events: none !important;
    font-size: 11px;
    font-weight: 600;
}

/* Crosshair */
.crosshair {
    pointer-events: none;
}

.crosshair-line-vertical,
.crosshair-line-horizontal line {
    stroke: var(--text-secondary);
    stroke-width: 1;
    stroke-dasharray: 3, 3;
    opacity: 0.7;
}

/* Zoom Listener */
.zoom-listener {
    pointer-events: all !important;
    fill: none !important;
    opacity: 0 !important;
}

/* Pattern Visibility States */
.patterns-visible .pattern-overlay {
    opacity: 1 !important;
    pointer-events: auto;
}

.patterns-hidden .pattern-overlay {
    opacity: 0 !important;
    pointer-events: none;
    display: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1400px) {
    :root {
        --sidebar-width: 320px;
    }
}

@media (max-width: 1200px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: none;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sidebar-section {
        flex: 1;
        min-width: 280px;
    }
    
    .chart-main {
        height: 650px;
        min-height: 550px;
    }
    
    .volume-chart {
        height: 200px;
        min-height: 160px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    .app-header {
        padding: 0 1rem;
    }
    
    .brand-info h1 {
        font-size: 1.25rem;
    }
    
    .brand-info p {
        display: none;
    }
    
    .main-layout {
        padding: 1rem;
        gap: 1rem;
    }
    
    .lookup-section,
    .chart-section,
    .sidebar-section {
        padding: 1rem;
    }
    
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .stock-primary-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .symbol-display {
        font-size: 1.5rem;
    }
    
    .price {
        font-size: 1.5rem;
    }
    
    .search-box {
        flex-wrap: wrap;
    }
    
    .primary-button {
        width: 100%;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-button {
        width: 100%;
    }
    
    .timeframe-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quick-presets,
    .custom-timeframe {
        width: 100%;
    }
    
    .chart-main {
        height: 500px;
        min-height: 450px;
    }
    
    .volume-chart {
        height: 180px;
        min-height: 140px;
    }
    
    .legend {
        gap: 1rem;
    }
    
    .ratings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .loading-details {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        flex-direction: column;
    }
    
    .sidebar-section {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0 0.75rem;
    }
    
    .brand-icon {
        font-size: 1.5rem;
    }
    
    .brand-info h1 {
        font-size: 1rem;
    }
    
    .icon-button {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .main-layout {
        padding: 0.75rem;
    }
    
    .symbol-display {
        font-size: 1.25rem;
    }
    
    .price {
        font-size: 1.25rem;
    }
    
    .change {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }
    
    .timeframe-btn,
    .action-button {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    .chart-main {
        height: 400px;
        min-height: 350px;
    }
    
    .volume-chart {
        height: 150px;
        min-height: 120px;
    }
    
    .legend {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ratings-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-toggles {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .pattern-toggle,
    .pocket-pivot-toggle {
        min-width: 130px;
        padding: 0.35rem 0.625rem;
        font-size: 0.7rem;
        height: 28px;
    }
    
    #tooltip {
        max-width: 240px;
        padding: 0.75rem;
        font-size: 0.75rem;
    }
    
    .modal-content {
        padding: 1.5rem;
        margin: 10% auto;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --border-light: rgba(255, 255, 255, 0.2);
    }
    
    .pocket-pivot-marker .pocket-pivot-circle {
        stroke-width: 3 !important;
        stroke: #000000 !important;
    }
}

/* Focus Indicators */
button:focus-visible,
input:focus-visible,
select:focus-visible,
.rating-card:focus-visible,
.legend-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.candle:focus,
.volume-bar:focus,
.rs-high:focus,
.rs-low:focus,
.pocket-pivot-marker:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.pocket-pivot-circle,
#tooltip,
.loading-spinner {
    will-change: transform, opacity;
}

.pattern-toggle,
.action-button,
.primary-button,
.icon-button {
    will-change: transform;
}

/* Optimize rendering for large datasets */
.candle,
.volume-bar,
.pocket-pivot-marker {
    shape-rendering: optimizeSpeed;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }
    
    .app-header,
    .icon-button,
    .action-button,
    .primary-button,
    .loading-status-panel,
    .modal,
    #tooltip {
        display: none !important;
    }
    
    .main-layout {
        flex-direction: column;
        padding: 0;
    }
    
    .chart-section {
        page-break-inside: avoid;
    }
    
    .sidebar {
        page-break-before: always;
    }
}

/* ===== DARK MODE ENHANCEMENTS ===== */
@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f8f9fa;
        --bg-tertiary: #e9ecef;
        --bg-card: rgba(255, 255, 255, 0.9);
        
        --text-primary: #1a202c;
        --text-secondary: #4a5568;
        --text-muted: #a0aec0;
        
        --border-color: rgba(0, 0, 0, 0.1);
        --border-light: rgba(0, 0, 0, 0.05);
        
        --glass-bg: rgba(0, 0, 0, 0.02);
    }
    
    body {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #ffffff 100%);
    }
    
    body::before {
        background: 
            radial-gradient(circle at 20% 50%, rgba(0, 102, 204, 0.05) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(23, 162, 184, 0.05) 0%, transparent 50%);
    }
}

/* ===== LOADING STATES ===== */
.pattern-loading-state,
.pocket-pivot-loading-state {
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pattern-loading-state .loading-spinner,
.pocket-pivot-loading-state .loading-spinner {
    width: 32px;
    height: 32px;
    margin: 1rem auto;
}

.loading-substeps {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.substep {
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.substep.active {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.substep.completed {
    background: rgba(0, 204, 102, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

/* ===== LOADING STEPS CHECKLIST ===== */
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 1rem 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.loading-step .step-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.loading-step .step-label {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.loading-step .step-source {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.loading-step[data-status="pending"] {
    opacity: 0.5;
}

.loading-step[data-status="loading"] {
    opacity: 1;
    border-left: 3px solid var(--warning-color);
}

.loading-step[data-status="loading"] .step-icon {
    animation: pulse 1s infinite;
}

.loading-step[data-status="complete"] {
    opacity: 1;
    border-left: 3px solid var(--success-color);
}

.loading-step[data-status="error"] {
    opacity: 1;
    border-left: 3px solid var(--danger-color);
}

.loading-step[data-status="skipped"] {
    opacity: 0.4;
    border-left: 3px solid var(--text-secondary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.loading-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #ffc107;
}

.loading-note .note-icon {
    font-size: 1rem;
}

/* ===== UTILITY CLASSES ===== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-tertiary { background: var(--bg-tertiary); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ===== CHART CONTROLS DROPDOWN ===== */
.chart-controls-dropdown {
    position: fixed;
    z-index: 10000;
    display: none;
}

.chart-controls-dropdown.show {
    display: block;
}

.chart-controls-button {
    display: none; /* Hidden - now using csv-button class instead */
}

.dropdown-arrow {
    display: none; /* Hidden - using dropdown-arrow-inline instead */
}

.chart-controls-menu {
    display: block;
    position: relative;
    top: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 240px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.control-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: grab;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.control-item:active {
    cursor: grabbing;
}

.control-item:hover {
    background: var(--glass-bg);
}

.control-item.drag-over-top {
    border-top: 2px solid var(--primary-color);
    padding-top: calc(0.5rem - 2px);
}

.control-item.drag-over-bottom {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: calc(0.5rem - 2px);
}

.control-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    pointer-events: auto;
}

.control-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    user-select: none;
    cursor: grab;
    flex: 1;
    pointer-events: none;
}

.control-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* ===== VOLUME PROFILE STYLES ===== */
.volume-profile-group {
    pointer-events: none;
    z-index: 50;
}

.volume-profile-bar {
    transition: opacity 0.2s ease;
}

.volume-profile-bar:hover {
    opacity: 0.9 !important;
}

.poc-bar {
    stroke-width: 2;
}

.volume-profile-label text {
    pointer-events: none;
    font-family: Arial, sans-serif;
}

.volume-profile-label line {
    pointer-events: none;
}

.volume-profile-label rect {
    pointer-events: none;
}


/* Mobile responsive dropdown */
@media (max-width: 1024px) {
    .chart-controls-button {
        min-width: 160px;
        padding: 0.4rem 0.875rem;
        font-size: 0.8rem;
        height: 32px;
    }
    
    .chart-controls-menu {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .chart-controls-dropdown {
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .chart-controls-button {
        min-width: 150px;
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        height: 30px;
    }
    
    .chart-controls-menu {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .chart-controls-dropdown {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .chart-controls-button {
        min-width: 130px;
        padding: 0.35rem 0.625rem;
        font-size: 0.7rem;
        height: 28px;
    }
    
    .chart-controls-menu {
        min-width: 160px;
    }
}

/* Momentum Alpha Panel Styles */
.momentum-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.momentum-section h3 {
    color: white;
    margin-bottom: 15px;
}

.momentum-score-display {
    text-align: center;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    margin-bottom: 15px;
}

.momentum-score-value {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.momentum-score-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-top: 5px;
}

.momentum-tier-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    gap: 8px;
}

.momentum-tier-badge.exceptional {
    background: rgba(255, 68, 68, 0.3);
    border: 2px solid #ff4444;
}

.momentum-tier-badge.strong {
    background: rgba(255, 140, 0, 0.3);
    border: 2px solid #ff8c00;
}

.momentum-tier-badge.moderate {
    background: rgba(76, 175, 80, 0.3);
    border: 2px solid #4CAF50;
}

.momentum-tier-badge.weak {
    background: rgba(158, 158, 158, 0.3);
    border: 2px solid #9e9e9e;
}

.momentum-tier-badge.negative {
    background: rgba(102, 102, 102, 0.3);
    border: 2px solid #666;
}

.tier-icon {
    font-size: 20px;
}

.tier-text {
    font-size: 14px;
}

.momentum-metrics {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
}

.momentum-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 8px;
}

.momentum-metrics .metric-row {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.momentum-metrics .metric-row:last-child {
    border-bottom: none;
}

.momentum-metrics .metric-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}

.momentum-metrics .metric-value {
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.momentum-metrics .metric-value.positive {
    color: #4ade80;
}

.momentum-metrics .metric-value.negative {
    color: #f87171;
}

.momentum-explanation {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    opacity: 0.9;
}
/* Momentum Tool Tip */
.custom-tooltip {
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px;
    border-radius: 8px;
    max-width: 350px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 12px;
    line-height: 1.4;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.momentum-tooltip .tooltip-header {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    color: #ffd700;
}

.momentum-tooltip .tooltip-body p {
    margin: 6px 0;
}

.momentum-tooltip .tooltip-body strong {
    color: #4ade80;
}

.momentum-tooltip .tooltip-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.7;
}

/* Visual indicator that score is hoverable */
.momentum-score-display:hover {
    background: rgba(255, 255, 255, 0.2);
}

.momentum-score-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
/* Premarket Analysis Panel - Base Structure */
.sidebar-section#premarket-analysis {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-md);
}

.sidebar-section#premarket-analysis h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Data delay notice - unique to premarket */
.data-delay-notice {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 11px;
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

/* Premarket stats grid - reuses existing stat patterns */
.pm-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.pm-stat {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-light);
}

.pm-stat .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pm-stat .value {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
}

/* RVOL-specific color classes */
.rvol-extreme {
    color: #ff00ff !important;
    font-weight: bold;
}

.rvol-high {
    color: #00ff41 !important;
    font-weight: bold;
}

.rvol-significant {
    color: #ffeb3b !important;
}

.rvol-normal {
    color: #4caf50 !important;
}

.rvol-low {
    color: #666 !important;
}

/* Comparison chart container */
#pm-comparison-chart {
    width: 100%;
    height: 120px;
    margin: 15px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border-light);
}

/* Premarket history table - extends existing table styles */
.pm-history-table {
    margin-top: 15px;
    overflow-x: auto;
}

.pm-history-table table {
    width: 100%;
    font-size: 11px;
    border-collapse: collapse;
}

.pm-history-table th,
.pm-history-table td {
    padding: 6px 4px;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.pm-history-table th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.pm-history-table td {
    color: var(--text-primary);
}

/* Premarket subsections */
.pm-subsection {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.pm-subsection:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.pm-subheader {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Volume trend indicator - unique to PM panel */
.trend-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid var(--border-light);
}

.trend-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.trend-arrow {
    font-size: 24px;
    transition: all 0.3s ease;
}

.trend-arrow.strong-bullish {
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.trend-arrow.bullish {
    color: #4caf50;
}

.trend-arrow.neutral {
    color: #888;
}

.trend-arrow.bearish {
    color: #ff9800;
}

.trend-arrow.strong-bearish {
    color: #ff0040;
    text-shadow: 0 0 10px rgba(255, 0, 64, 0.5);
}

.trend-details {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.trend-details small {
    color: var(--text-secondary);
}

/* Institutional score meter - unique visualization */
.score-meter {
    position: relative;
    height: 30px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
    border: 1px solid var(--border-light);
}

.score-bar {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.score-bar.score-extreme {
    background: linear-gradient(90deg, #ff00ff, #00ff41);
}

.score-bar.score-high {
    background: linear-gradient(90deg, #00ff41, #00d4ff);
}

.score-bar.score-moderate {
    background: linear-gradient(90deg, #ffeb3b, #4caf50);
}

.score-bar.score-low {
    background: linear-gradient(90deg, #ff9800, #ffeb3b);
}

.score-bar.score-minimal {
    background: #666;
}

.score-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Pattern alerts in premarket */
#pm-pattern-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#pm-pattern-alerts .pattern-alert {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    padding: 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
}

#pm-pattern-alerts .pattern-type {
    font-weight: 700;
    color: #ffc107;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

#pm-pattern-alerts .pattern-description {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 11px;
}

#pm-pattern-alerts .pattern-confidence {
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 4px;
}

/* Responsive for PM stats grid only */
@media (max-width: 1400px) {
    .pm-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== TAB NAVIGATION (INLINE WITH HEADER) ===== */
.tab-navigation-inline {
    display: flex;
    gap: 0.5rem;
    margin: 0 auto;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(0, 102, 204, 0.1);
}

/* ===== SCANNER RESULTS AREA (MAIN CONTENT) ===== */
.scanner-results-area {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    min-height: 600px;
}

.scanner-header {
    margin-bottom: 2rem;
}

.scanner-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scanner-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Scanner Loading State */
.scanner-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.scanner-loading .loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.scanner-loading p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Scanner Error */
.scanner-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 1.5rem;
    color: var(--danger-color);
    margin: 2rem 0;
}

/* Scanner Results */
.scanner-results {
    margin-top: 2rem;
}

.results-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.results-summary span {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.results-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: var(--bg-tertiary);
}

.results-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.results-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.results-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.results-table td {
    padding: 1rem;
    font-size: 0.95rem;
}

.symbol-cell {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
}

.pattern-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pattern-badge.pattern-cup-handle {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.pattern-badge.pattern-flat-base {
    background: rgba(0, 102, 204, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.pattern-badge.pattern-double-bottom {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.pattern-badge.pattern-ascending-base {
    background: rgba(23, 162, 184, 0.2);
    color: var(--info-color);
    border: 1px solid var(--info-color);
}

.pattern-badge.pattern-bull-flag {
    background: rgba(255, 87, 34, 0.2);
    color: #ff5722;
    border: 1px solid #ff5722;
}

.pattern-badge.pattern-high-tight-flag {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
    border: 1px solid #ff9500;
}

.pattern-badge.pattern-consolidation {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid #6c757d;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-forming {
    background: rgba(255, 193, 7, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.status-badge.status-complete {
    background: rgba(0, 204, 102, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-badge.status-breakout {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.status-badge.status-near-pivot {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid #17a2b8;
}


.view-chart-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-chart-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

/* Scanner Empty State */
.scanner-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.scanner-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.scanner-empty h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scanner-empty p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ===== SCANNER SIDEBAR CONTROLS ===== */


.scanner-control-group {
    margin-bottom: 1.5rem;
}

.scanner-control-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.watchlist-dropdown {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.watchlist-dropdown:hover {
    border-color: var(--primary-color);
}

.watchlist-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.scan-button-sidebar {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.scan-button-sidebar:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.scan-button-sidebar:active {
    transform: translateY(0);
}

#stop-scan-btn {
    background: var(--danger-color) !important;
}

#stop-scan-btn:hover {
    background: #cc0000 !important;
}

.scanner-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.scanner-info p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.scanner-info p:last-child {
    margin-bottom: 0;
}

.scanner-info strong {
    color: var(--text-primary);
}

/* Scanner Stats Panel */
.scanner-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

/* Pattern Distribution Panel */
.pattern-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pattern-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.pattern-type {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.pattern-count {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

/* Scanner Tips */
.scanner-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.scanner-tips li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
    line-height: 1.5;
}

.scanner-tips li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.scanner-tips li:first-child {
    padding-top: 0;
}

/* Changelog Button in Header */
.changelog-button {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.changelog-button:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.changelog-button span {
    font-size: 1rem;
}

/* Changelog Modal */


.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Changelog Entry Styling */
.changelog-entry {
    margin-bottom: 2rem;
}

.changelog-entry:last-child {
    margin-bottom: 0;
}

.version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.version-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.version-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.changelog-content {
    color: var(--text-primary);
    line-height: 1.6;
}

.changelog-content p {
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    color: var(--text-primary);
}

.changelog-content ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
}

.changelog-content li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* Scrollbar styling for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
/* ===== SCANNER TYPE DROPDOWN ===== */
.scanner-dropdown {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.scanner-dropdown:hover {
    border-color: var(--primary-color);
}

.scanner-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===== VOLUME DRY-UP SCANNER RESULTS ===== */
.volume-dryup-cell {
    color: #00cc66;
    font-weight: 600;
}

.location-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.location-badge.handle {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

.location-badge.base_low {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.location-badge.tight_area {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.location-badge.consolidation {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.quality-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.quality-badge.excellent {
    background: rgba(0, 204, 102, 0.2);
    color: #00cc66;
}

.quality-badge.good {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.quality-badge.moderate {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
}

/* ===== RS NEW HIGH SCANNER RESULTS ===== */
.rs-status {
    font-weight: 600;
}

.rs-status.new-high {
    color: #00cc66;
}

.rs-percent {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ===== NEAR PIVOT SCANNER RESULTS ===== */
.distance-cell {
    color: #17a2b8;
    font-weight: 600;
}

/* ===== VOLUME DRY-UP SIDEBAR SIGNAL ===== */
.signal-value.volume-dryup-excellent {
    color: #00cc66 !important;
}

.signal-value.volume-dryup-good {
    color: #ffc107 !important;
}

.signal-value.volume-dryup-moderate {
    color: #ff9800 !important;
}

.signal-value.volume-dryup-none {
    color: var(--text-muted) !important;
}

/* ===== BASE COUNT BADGES ===== */
.base-count-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.base-count-badge.early-stage {
    background: rgba(0, 204, 102, 0.2);
    color: #00cc66;
    border: 1px solid #00cc66;
}

.base-count-badge.mid-stage {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.base-count-badge.late-stage {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

/* ===== CUSTOM TOOLTIPS FOR TABLE HEADERS on Scanners===== */
.results-table th {
    position: relative;
    cursor: help;
}

.results-table th .tooltip-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.results-table th .tooltip-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.results-table th:hover .tooltip-icon {
    opacity: 1;
}

.results-table th .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 220px;
    max-width: 300px;
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-secondary);
    line-height: 1.5;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    pointer-events: none;
}

.results-table th .tooltip-content::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: var(--primary-color);
}

.results-table th .tooltip-content::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-bottom-color: var(--bg-card);
}

.results-table th:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(8px);
}

.results-table th .tooltip-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: block;
}

/* Adjust tooltip position for edge columns */
.results-table th:first-child .tooltip-content {
    left: 0;
    transform: translateX(0) translateY(5px);
}

.results-table th:first-child:hover .tooltip-content {
    transform: translateX(0) translateY(8px);
}

.results-table th:first-child .tooltip-content::before,
.results-table th:first-child .tooltip-content::after {
    left: 20px;
    transform: none;
}

.results-table th:last-child .tooltip-content {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(5px);
}

.results-table th:last-child:hover .tooltip-content {
    transform: translateX(0) translateY(8px);
}

.results-table th:last-child .tooltip-content::before,
.results-table th:last-child .tooltip-content::after {
    left: auto;
    right: 20px;
    transform: none;
}

.results-table-container {
    overflow-x: auto;
    overflow-y: visible;
}

.scanner-results {
    overflow: visible;
}

.results-table thead {
    position: relative;
    z-index: 10;
}


/* ===== CONFIDENCE CELL WITH LABEL AND BAR ===== */
.confidence-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 130px;
}

.confidence-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    min-width: 55px;
    text-transform: uppercase;
}

.confidence-label.confidence-high {
    color: #00cc66;
}

.confidence-label.confidence-medium {
    color: #ffc107;
}

.confidence-label.confidence-low {
    color: #ff4444;
}

.confidence-bar-container {
    flex: 1;
    min-width: 50px;
    max-width: 80px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

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

.confidence-bar-fill.confidence-high {
    background: linear-gradient(90deg, #00cc66, #00ff88);
}

.confidence-bar-fill.confidence-medium {
    background: linear-gradient(90deg, #ffc107, #ffd54f);
}

.confidence-bar-fill.confidence-low {
    background: linear-gradient(90deg, #ff4444, #ff8080);
}

/* ===== SUBCHART CONTROLS DROPDOWN (matches chart-controls exactly) ===== */
.subchart-controls-dropdown {
    position: fixed;
    z-index: 10000;
    display: none;
}

.subchart-controls-dropdown.show {
    display: block;
}

.subchart-controls-menu {
    display: block;
    position: relative;
    top: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
}

.subchart-controls-menu .control-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.subchart-controls-menu .control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.subchart-controls-menu .control-item:hover {
    background: var(--bg-secondary);
}

.subchart-controls-menu .control-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.subchart-controls-menu .control-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

#subchartControlsButton {
    margin-left: 8px;
}

#subchartControlsButton.active .dropdown-arrow-inline {
    transform: rotate(180deg);
}


/* ===== SHARED PANEL CONTROLS (Subcharts & Sidebar) ===== */

.panel-header {
    display: flex;
    align-items: center;
    user-select: none;
}

.panel-drag-handle {
    cursor: grab;
    padding: 4px 8px;
    margin-right: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    letter-spacing: 2px;
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.panel-drag-handle:hover {
    opacity: 1;
    color: var(--primary-color);
}

.panel-drag-handle:active {
    cursor: grabbing;
}

.panel-collapse-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: auto;
}

.panel-collapse-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.panel-collapse-btn .collapse-icon {
    line-height: 1;
    user-select: none;
    transition: transform 0.2s ease;
}

/* Drag states (shared) */
.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary-color) !important;
}

.drag-over-top {
    border-top: 3px solid var(--primary-color) !important;
}

.drag-over-bottom {
    border-bottom: 3px solid var(--primary-color) !important;
}

/* ===== SIDEBAR SECTION ENHANCEMENTS ===== */

.sidebar-section {
    transition: all 0.3s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.sidebar-section .sidebar-section-header {
    display: flex;
    align-items: center;
    padding: 0;
    margin-bottom: 1rem;
}

.sidebar-section .sidebar-section-header h3 {
    flex: 1;
    margin: 0;
}

.sidebar-section.collapsed .sidebar-section-content {
    display: none;
}

.sidebar-section.collapsed .sidebar-section-header {
    margin-bottom: 0;
}

.sidebar-section.collapsed {
    padding-bottom: 0.75rem;
}

.sidebar-section.collapsed .panel-collapse-btn .collapse-icon {
    transform: rotate(-90deg);
}

/* ===== SYMBOL AUTOCOMPLETE & RECENT SYMBOLS ===== */

/* Search box needs relative positioning for dropdown */
.search-box {
    position: relative;
    z-index: 1001;
}

/* Autocomplete Dropdown */
.symbol-autocomplete {
    position: absolute;
    top: 100%;
    left: 40px;
    right: 120px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 280px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}

.symbol-autocomplete.visible {
    display: block;
}

.autocomplete-section-label {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #e8f4fc;
}

.autocomplete-item.highlighted {
    background-color: #d0e8f7;
}

.autocomplete-symbol {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
    min-width: 65px;
}

.autocomplete-name {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-recent-icon {
    margin-right: 6px;
    font-size: 12px;
    color: #f59e0b;
}

.autocomplete-no-results {
    padding: 16px 12px;
    text-align: center;
    color: #888;
    font-size: 13px;
}

/* Recent Symbols Chips */
.recent-symbols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    min-height: 32px;
}

.recent-symbols:empty {
    display: none;
}

.recent-symbols-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #666;
    padding-right: 4px;
}

.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px 5px 12px;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8ecf0 100%);
    border: 1px solid #d0d7de;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-chip:hover {
    background: linear-gradient(135deg, #e0e8f0 0%, #d8e0e8 100%);
    border-color: #0066cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.15);
}

.recent-chip-symbol {
    pointer-events: none;
}

.recent-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: transparent;
    color: #888;
    font-size: 14px;
    line-height: 1;
    transition: all 0.15s ease;
}

.recent-chip:hover .recent-chip-remove {
    background: #ff4d4d;
    color: white;
}

.recent-chip-remove:hover {
    transform: scale(1.1);
}

/* Scrollbar styling for autocomplete */
.symbol-autocomplete::-webkit-scrollbar {
    width: 8px;
}

.symbol-autocomplete::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 8px 0;
}

.symbol-autocomplete::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.symbol-autocomplete::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* ===== SORTABLE TABLE HEADERS ===== */
.results-table th.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.results-table th.sortable-header:hover {
    background: var(--bg-secondary);
}

.results-table th .sort-arrow {
    opacity: 0.3;
    margin-left: 4px;
    font-size: 0.65rem;
    vertical-align: middle;
}

.results-table th.sortable-header:hover .sort-arrow {
    opacity: 0.6;
}

.results-table th .sort-arrow.active {
    opacity: 1;
    color: var(--primary-color);
}

/* ===== RECENT NEWS PANEL ===== */

.news-section {
    max-height: 400px;
}

.news-refresh-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    margin-left: auto;
    margin-right: 8px;
}

.news-refresh-btn:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: rotate(180deg);
}

#news-articles-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.news-article {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.news-article:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
    transform: translateX(2px);
}

.news-article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.news-publisher {
    font-size: 10px;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-time {
    font-size: 10px;
    color: var(--text-secondary);
}

.news-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.news-description {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-bottom: 6px;
}

.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.news-sentiment {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.sentiment-positive {
    color: #00cc66;
    background: rgba(0, 204, 102, 0.1);
}

.sentiment-negative {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.sentiment-neutral {
    color: #888;
    background: rgba(136, 136, 136, 0.1);
}

.news-tickers {
    font-size: 10px;
    color: var(--text-secondary);
}

.news-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 12px;
}

.news-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    gap: 8px;
}

.news-empty-icon {
    font-size: 24px;
    opacity: 0.5;
}

/* Custom scrollbar for news container */
#news-articles-container::-webkit-scrollbar {
    width: 4px;
}

#news-articles-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 2px;
}

#news-articles-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===== TRADING SIGNALS TOOLTIPS ===== */
.signal-tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: help;
}

.signal-tooltip-icon {
    font-size: 0.7rem;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.signal-tooltip-trigger:hover .signal-tooltip-icon {
    opacity: 1;
    color: var(--primary-color);
}

.signal-tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateY(-8px);
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 220px;
    max-width: 280px;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    pointer-events: none;
}

.signal-tooltip-content::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 8px solid transparent;
    border-top-color: var(--primary-color);
}

.signal-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 21px;
    border: 7px solid transparent;
    border-top-color: var(--bg-card);
}

.signal-tooltip-trigger:hover .signal-tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(-12px);
}

.signal-tooltip-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: block;
    font-size: 0.8rem;
}

.signal-tooltip-content strong {
    color: var(--primary-color);
}

/* ===== COLLAPSIBLE CONTROL SECTIONS ===== */

.control-section.collapsible {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
    margin-bottom: 0;
}

.control-section.collapsible:last-child {
    border-bottom: none;
}

.control-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.control-section-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.section-collapse-icon {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    width: 12px;
}

.control-section.collapsed .section-collapse-icon {
    transform: rotate(-90deg);
}

.control-section-header .control-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.control-section-content {
    padding: 0 8px 8px 8px;
    transition: all 0.2s ease;
}

.control-section.collapsed .control-section-content {
    display: none;
}

/* Pivot sub-options indentation */
.pivot-sub-option {
    padding-left: 24px !important;
    opacity: 0.85;
}

.pivot-sub-option .control-label {
    font-size: 0.8rem;
}

/* ===== Section master toggle checkbox in header for Chart Overlays ==== */
.section-master-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
}

.section-master-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.section-master-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Save Layout Modal - Layout List Items */
.saved-layout-item:hover {
    background: #2a4a6a;
}

.saved-layout-item:active {
    background: #3a5a7a;
}

/* ===== AUTHENTICATION STYLES ===== */

/* Auth Buttons in Header */
.account-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem !important;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    border: none !important;
    color: white !important;
    font-weight: 600;
    min-width: auto;
}

.account-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.admin-button {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.admin-button:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: authFadeIn 0.2s ease-out;
}

@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: authSlideIn 0.3s ease-out;
}

.auth-modal-small {
    max-width: 360px;
}

.auth-modal-large {
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes authSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.auth-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.auth-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* Auth Forms */
.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.auth-form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.auth-form-group input::placeholder {
    color: var(--text-muted);
}

.auth-form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auth-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    min-height: 1.25rem;
}

.auth-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-submit-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Account Info */
.auth-account-info {
    margin-bottom: 1.5rem;
}

.auth-account-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.auth-account-label {
    color: var(--text-secondary);
}

.auth-account-value {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-role-admin {
    color: #f59e0b;
}

.auth-role-user {
    color: var(--primary-color);
}

.auth-account-actions {
    display: flex;
    gap: 0.75rem;
}

.auth-logout-btn {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-logout-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

/* Auth Notification */
.auth-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 10003;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.auth-notification.show {
    transform: translateX(0);
}

.auth-notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.auth-notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.auth-notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

/* Account Settings Section */
.auth-settings-section {
    margin: 1.25rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.auth-settings-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.auth-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.auth-setting-row:last-child {
    margin-bottom: 0;
}

.auth-setting-info {
    flex: 1;
}

.auth-setting-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.auth-setting-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Toggle Switch */
.auth-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.auth-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.auth-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.auth-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.auth-toggle input:checked + .auth-toggle-slider {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    border-color: #9333ea;
}

.auth-toggle input:checked + .auth-toggle-slider:before {
    transform: translateX(20px);
    background: white;
}

.auth-toggle:hover .auth-toggle-slider {
    border-color: #9333ea;
}

/* Admin Panel Styles */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-stat {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.admin-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.admin-users-list {
    overflow-x: auto;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-users-table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.admin-users-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.admin-users-table tr:hover {
    background: var(--bg-tertiary);
}

.current-user-row {
    background: rgba(0, 102, 204, 0.1) !important;
}

.admin-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-status.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.admin-status.status-approved {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.admin-status.status-paused {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.admin-status.status-deleted {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.admin-role {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-role.role-admin {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.admin-role.role-user {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.admin-role-select {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color, #3a3f4b);
    background: var(--bg-tertiary, #2a2f3a);
    color: var(--text-primary, #e0e0e0);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-role-select:hover {
    border-color: var(--primary-color, #3b82f6);
}

.admin-role-select:focus {
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.admin-role-select option {
    background: var(--bg-secondary, #1e222d);
    color: var(--text-primary, #e0e0e0);
}

.admin-actions-cell {
    white-space: nowrap;
}

.admin-action-btn {
    padding: 0.375rem 0.625rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.375rem;
    transition: all 0.2s;
}

.admin-action-btn.approve {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.admin-action-btn.approve:hover {
    background: #10b981;
    color: white;
}

.admin-action-btn.pause {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.admin-action-btn.pause:hover {
    background: #6b7280;
    color: white;
}

.admin-action-btn.unpause {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.admin-action-btn.unpause:hover {
    background: #3b82f6;
    color: white;
}

.admin-action-btn.promote {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.admin-action-btn.promote:hover {
    background: #f59e0b;
    color: white;
}

.admin-action-btn.delete {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.admin-action-btn.delete:hover {
    background: #ef4444;
    color: white;
}

.admin-you-label {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
}

/* ===== LOGIN GATE (Full Screen Blocker) ===== */
.auth-login-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 50%, #0d1117 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: gateFadeIn 0.3s ease-out;
}

.auth-login-gate.hiding {
    animation: gateFadeOut 0.3s ease-out forwards;
}

@keyframes gateFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gateFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.auth-gate-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 
                0 0 100px rgba(0, 102, 204, 0.1);
    animation: gateSlideIn 0.4s ease-out;
}

@keyframes gateSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-gate-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-gate-logo {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.auth-gate-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-gate-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.auth-gate-form h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* Header Auth Buttons */
#accountButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.875rem;
    white-space: nowrap;
}

#accountButton .auth-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
}

#accountButton .auth-btn-text {
    font-size: 0.8rem;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

#adminButton {
    padding: 0.5rem 0.75rem;
}

/* Hide app until auth is checked */
.auth-loading body,
.auth-loading .app-container {
    visibility: hidden;
}

.auth-checking {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0e1a;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-checking-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 102, 204, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========= Forgot Password Link */
.auth-forgot-link {
    text-align: right;
    margin: -10px 0 15px 0;
}

.auth-forgot-link a {
    color: #94a3b8;
    font-size: 0.85rem;
    text-decoration: none;
}

.auth-forgot-link a:hover {
    color: #3b82f6;
}

/* Success Message */
.auth-success {
    color: #22c55e;
    font-size: 0.9rem;
    min-height: 20px;
    margin-bottom: 10px;
}

/* Admin Reset Button */
.admin-action-btn.reset {
    background: #8b5cf6;
}

.admin-action-btn.reset:hover {
    background: #7c3aed;
}

/* ===== AUTH ERROR ANIMATIONS ===== */
@keyframes authShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.auth-shake {
    animation: authShake 0.5s ease-in-out;
}

.auth-input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}
/* ===== DARK POOL NOTIFICATIONS ===== */
.darkpool-notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10004;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.darkpool-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(20, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border-left: 4px solid #9333ea;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 20px rgba(147, 51, 234, 0.2);
    min-width: 300px;
    max-width: 380px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.darkpool-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.darkpool-notification.hiding {
    transform: translateX(120%);
    opacity: 0;
}

.darkpool-notification-darkpool {
    border-left-color: #9333ea;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 20px rgba(147, 51, 234, 0.2);
}

.darkpool-notification-sweep {
    border-left-color: #ea580c;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 20px rgba(234, 88, 12, 0.2);
}

.darkpool-notification-lit {
    border-left-color: #f59e0b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
                0 0 20px rgba(245, 158, 11, 0.2);
}

.darkpool-notification-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.darkpool-notification-content {
    flex: 1;
    min-width: 0;
}

.darkpool-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.darkpool-notification-type {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9333ea;
}

.darkpool-notification-sweep .darkpool-notification-type {
    color: #ea580c;
}

.darkpool-notification-lit .darkpool-notification-type {
    color: #f59e0b;
}

.darkpool-notification-time {
    font-size: 0.7rem;
    color: #888;
}

.darkpool-notification-details {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.darkpool-notification-ticker {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.darkpool-notification-size {
    font-size: 0.8rem;
    color: #ccc;
}

.darkpool-notification-value {
    font-size: 0.85rem;
    color: #bbb;
}

.darkpool-notification-value strong {
    color: #22c55e;
    font-weight: 700;
}

.darkpool-notification-close {
    background: none;
    border: none;
    color: #666;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
    flex-shrink: 0;
}

.darkpool-notification-close:hover {
    opacity: 1;
    color: #fff;
}

/* PM Scanner RVOL colors */
.rvol-extreme {
    color: #9333ea !important;
    font-weight: 700;
}

.rvol-high {
    color: #00ff41 !important;
    font-weight: 600;
}

.rvol-normal {
    color: #ccc;
}

/* PM Direction badges for Scanner*/
.direction-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.direction-bullish {
    background: rgba(0, 204, 102, 0.2);
    color: #00cc66;
}

.direction-bearish {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.direction-neutral {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
}

/* PM Direction badges */
.direction-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.direction-bullish {
    background: rgba(0, 204, 102, 0.2);
    color: #00cc66;
}

.direction-bearish {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.direction-gapup {
    background: rgba(0, 180, 216, 0.2);
    color: #00b4d8;
}

.direction-gapdown {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa500;
}

.direction-neutral {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
}
/* PM Score badge */
.pm-score-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    min-width: 32px;
    text-align: center;
}

.pm-score-badge.score-high {
    background: rgba(0, 255, 65, 0.2);
    color: #00ff41;
}

.pm-score-badge.score-medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.pm-score-badge.score-low {
    background: rgba(255, 255, 255, 0.1);
    color: #888;
}

/* Late Surge colors */
.surge-extreme {
    color: #9333ea !important;
    font-weight: 700;
}

.surge-high {
    color: #00ff41 !important;
    font-weight: 600;
}

.surge-normal {
    color: #ccc;
}

/* Institutional value colors Premarket*/
.inst-extreme {
    color: #9333ea !important;
    font-weight: 700;
}

.inst-high {
    color: #00ff41 !important;
    font-weight: 600;
}

.inst-normal {
    color: #ccc;
}
/* ===== FULLSCREEN MODE ===== */

/* Fullscreen Toggle Button - Top Right of Chart */
.fullscreen-toggle-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.fullscreen-toggle-btn:hover {
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: scale(1.1);
}

.fullscreen-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.fullscreen-icon {
    line-height: 1;
}

body.fullscreen-mode .app-header,
body.fullscreen-mode .sidebar,
body.fullscreen-mode #darkpool-content,
body.fullscreen-mode #scanner-content,
body.fullscreen-mode #darkpool-sidebar,
body.fullscreen-mode #scanner-sidebar,
body.fullscreen-mode .tab-navigation-inline {
    display: none !important;
}

/* Ensure chart content is visible in fullscreen even if on another tab */
body.fullscreen-mode #chart-content {
    display: block !important;
}

body.fullscreen-mode #chart-sidebar {
    display: none !important;
}

/* Fullscreen: Compact single-row toolbar */
body.fullscreen-mode .lookup-section {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0.5rem 1rem !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
}

body.fullscreen-mode .lookup-section .stock-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    gap: 0.75rem !important;
    flex-shrink: 0 !important;
}

body.fullscreen-mode .lookup-section .stock-primary-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

body.fullscreen-mode .lookup-section .symbol-display {
    font-size: 1.25rem !important;
}

body.fullscreen-mode .lookup-section .price {
    font-size: 1.1rem !important;
}

body.fullscreen-mode .lookup-section .change {
    font-size: 0.8rem !important;
    padding: 0.2rem 0.5rem !important;
}

body.fullscreen-mode .lookup-section .data-source-indicator {
    display: none !important;
}

/* Quick lookup - inline compact */
body.fullscreen-mode .lookup-section .quick-lookup {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

body.fullscreen-mode .lookup-section .search-box {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    min-width: auto !important;
    gap: 0.25rem !important;
}

body.fullscreen-mode .lookup-section .search-box .search-icon {
    display: none !important;
}

body.fullscreen-mode .lookup-section #symbolInput {
    width: 120px !important;
    padding: 0.35rem 0.5rem !important;
    font-size: 0.85rem !important;
}

body.fullscreen-mode .lookup-section .search-box .primary-button {
    padding: 0.35rem 0.6rem !important;
    font-size: 0.75rem !important;
    width: auto !important;
    min-width: auto !important;
}

body.fullscreen-mode .lookup-section .recent-symbols,
body.fullscreen-mode .lookup-section .quick-actions {
    display: none !important;
}

/* Timeframe selector - inline */
body.fullscreen-mode .lookup-section .timeframe-selector {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.25rem !important;
    padding: 0 !important;
    border: none !important;
    margin: 0 !important;
    flex-wrap: nowrap !important;
}

body.fullscreen-mode .lookup-section .quick-presets {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.25rem !important;
}

body.fullscreen-mode .lookup-section .quick-presets .preset-label {
    display: none !important;
}

body.fullscreen-mode .lookup-section .timeframe-btn {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.7rem !important;
}

body.fullscreen-mode .lookup-section .custom-timeframe {
    display: none !important;
}

body.fullscreen-mode .lookup-section .csv-button {
    padding: 0.3rem 0.5rem !important;
    font-size: 0.7rem !important;
    white-space: nowrap !important;
}

body.fullscreen-mode .lookup-section .csv-button .dropdown-arrow-inline {
    font-size: 0.55rem !important;
}

body.fullscreen-mode .main-layout {
    padding: 0 !important;
    gap: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
}

body.fullscreen-mode .main-content {
    padding: 0 !important;
    gap: 0 !important;
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    flex: 1 1 100% !important;
}

body.fullscreen-mode #chart-content {
    height: 100vh !important;
    width: 100vw !important;
    display: flex !important;
    flex-direction: column !important;
}

body.fullscreen-mode .chart-section {
    flex: 1 !important;
    height: 100vh !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0.5rem !important;
    box-sizing: border-box !important;
}

body.fullscreen-mode .chart-container-wrapper {
    height: calc(100vh - 1rem) !important;
    width: 100% !important;
    flex: 1 !important;
    margin: 0 !important;
}

body.fullscreen-mode .chart-main {
    flex: 1 !important;
    min-height: 0 !important;
    height: calc(100vh - 320px) !important;
    width: 100% !important;
    border-radius: 0 !important;
    margin: 0 0 0.5rem 0 !important;
}

body.fullscreen-mode .chart-main svg {
    width: 100% !important;
    height: 100% !important;
}

body.fullscreen-mode .volume-chart {
    height: 240px !important;
    min-height: 220px !important;
    max-height: 260px !important;
    width: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0.75rem 0.75rem 2.5rem 0.75rem !important;
}

body.fullscreen-mode .subcharts-container {
    width: 100% !important;
    border-radius: 0 !important;
}

body.fullscreen-mode .subchart {
    border-radius: 0 !important;
}

/* Fullscreen button shows exit icon when active */
body.fullscreen-mode .fullscreen-toggle-btn {
    top: 1rem;
    right: 1rem;
    background: rgba(255, 68, 68, 0.2);
    border-color: var(--danger-color);
}

body.fullscreen-mode .fullscreen-toggle-btn:hover {
    background: rgba(255, 68, 68, 0.4);
}

body.fullscreen-mode .fullscreen-toggle-btn .fullscreen-icon::after {
    content: '✕';
}

body.fullscreen-mode .fullscreen-toggle-btn .fullscreen-icon {
    font-size: 0;
}

body.fullscreen-mode .fullscreen-toggle-btn .fullscreen-icon::after {
    font-size: 1.1rem;
}

/* Fullscreen mode mobile adjustments */
@media (max-width: 768px) {
    body.fullscreen-mode .lookup-section {
        padding: 0.35rem 0.5rem !important;
        flex-wrap: wrap !important;
    }
    
    body.fullscreen-mode .lookup-section .stock-header {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
    }
    
    body.fullscreen-mode .lookup-section .quick-lookup {
        display: none !important;
    }
    
    body.fullscreen-mode .lookup-section .timeframe-selector {
        display: none !important;
    }
    
    body.fullscreen-mode .lookup-section .symbol-display {
        font-size: 1.1rem !important;
    }
    
    body.fullscreen-mode .lookup-section .price {
        font-size: 0.95rem !important;
    }
    
    body.fullscreen-mode .lookup-section .change {
        font-size: 0.7rem !important;
    }
    
    body.fullscreen-mode .volume-chart {
        height: 180px !important;
        min-height: 160px !important;
        max-height: 200px !important;
        padding: 0.5rem 0.5rem 1.5rem 0.5rem !important;
    }
    
    body.fullscreen-mode .chart-main {
        height: calc(100vh - 220px) !important;
    }
    
    body.fullscreen-mode .fullscreen-toggle-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 32px;
        height: 32px;
    }
}

/* ===== FLOW CHART FULLSCREEN ===== */
.dp-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.dp-chart-header h3 {
    margin: 0;
}

.dp-fullscreen-btn {
    width: 32px;
    height: 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.dp-fullscreen-btn:hover {
    background: rgba(0, 102, 204, 0.2);
    border-color: var(--primary-color);
    color: var(--text-primary);
    transform: scale(1.1);
}

.dp-fullscreen-btn.active {
    background: rgba(255, 68, 68, 0.2);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Hide SVG and show X in fullscreen mode */
.dp-chart-panel.dp-fullscreen-mode .dp-fullscreen-btn svg {
    display: none;
}

.dp-chart-panel.dp-fullscreen-mode .dp-fullscreen-btn::after {
    content: '✕';
    font-size: 1.1rem;
}

/* Fullscreen mode for flow chart */
.dp-chart-panel.dp-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: var(--bg-card, #ffffff) !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

.dp-chart-panel.dp-fullscreen-mode .dp-chart-container {
    height: calc(100vh - 100px) !important;
}

.dp-chart-panel.dp-fullscreen-mode .dp-chart-header h3 {
    font-size: 1.5rem;
}

.dp-chart-panel.dp-fullscreen-mode .dp-fullscreen-btn {
    background: rgba(255, 68, 68, 0.2);
    border-color: var(--danger-color);
}

.dp-chart-panel.dp-fullscreen-mode .dp-fullscreen-btn:hover {
    background: rgba(255, 68, 68, 0.4);
}

/* Hide other content when flow chart fullscreen */
body.dp-chart-fullscreen-active {
    overflow: hidden !important;
}

body.dp-chart-fullscreen-active .app-header,
body.dp-chart-fullscreen-active .sidebar,
body.dp-chart-fullscreen-active .dp-sidebar,
body.dp-chart-fullscreen-active .dp-stats-row,
body.dp-chart-fullscreen-active .dp-trades-panel,
body.dp-chart-fullscreen-active .tab-nav {
    display: none !important;
}

body.dp-chart-fullscreen-active .dp-charts-row {
    display: block !important;
}

body.dp-chart-fullscreen-active .dp-charts-row > .dp-chart-panel:not(.dp-fullscreen-mode) {
    display: none !important;
}

/* Flow chart fullscreen mobile adjustments */
@media (max-width: 768px) {
    .dp-chart-panel.dp-fullscreen-mode {
        padding: 10px !important;
    }
    
    .dp-chart-panel.dp-fullscreen-mode .dp-chart-container {
        height: calc(100vh - 70px) !important;
    }
    
    .dp-chart-panel.dp-fullscreen-mode .dp-chart-header h3 {
        font-size: 1.2rem;
    }
    
    .dp-fullscreen-btn {
        width: 28px;
        height: 28px;
    }
}
/* ===== FLOW CHART FULLSCREEN CONTROLS ===== */
.dp-fs-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
}
.dp-fullscreen-controls {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.dp-fs-symbol-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dp-fs-input {
    width: 120px;
    padding: 0.35rem 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dp-fs-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dp-fs-input::placeholder {
    color: var(--text-secondary);
}

.dp-fs-load-btn {
    padding: 0.35rem 0.6rem;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dp-fs-load-btn:hover {
    opacity: 0.9;
}

.dp-fs-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-left: 0.75rem;
}

.dp-fs-change {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.dp-fs-change.positive {
    background: rgba(0, 200, 100, 0.2);
    color: #00c864;
}

.dp-fs-change.negative {
    background: rgba(255, 80, 80, 0.2);
    color: #ff5050;
}

.dp-fs-range-section {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dp-fs-range-btn {
    padding: 0.3rem 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dp-fs-range-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.dp-fs-range-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Fullscreen exit button */
.dp-fs-exit-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    color: var(--danger-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dp-fs-exit-btn:hover {
    background: rgba(255, 68, 68, 0.4);
    transform: scale(1.1);
}

/* Show controls only in fullscreen mode */
.dp-chart-panel.dp-fullscreen-mode .dp-fullscreen-controls {
    display: flex;
}

/* Hide regular header in fullscreen */
.dp-chart-panel.dp-fullscreen-mode .dp-chart-header {
    display: none;
}

/* Adjust chart height in fullscreen with controls */
.dp-chart-panel.dp-fullscreen-mode .dp-chart-container {
    height: calc(100vh - 60px) !important;
}

/* Mobile adjustments for fullscreen controls */
@media (max-width: 768px) {
    .dp-fullscreen-controls {
        flex-wrap: wrap;
        padding: 0.35rem 0.5rem;
        gap: 0.5rem;
    }
    
    .dp-fs-symbol-section {
        flex: 1 1 100%;
        justify-content: center;
    }
    
    .dp-fs-range-section {
        flex: 1 1 auto;
        justify-content: center;
    }
    
    .dp-fs-input {
        width: 80px;
    }
    
    .dp-fs-price {
        font-size: 0.95rem;
    }
    
    .dp-fs-exit-btn {
        width: 32px;
        height: 32px;
    }
    
    .dp-chart-panel.dp-fullscreen-mode .dp-chart-container {
        height: calc(100vh - 100px) !important;
    }
}
/* Fullscreen Refresh Button */
.dp-fs-refresh-btn {
    width: 36px;
    height: 36px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dp-fs-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: scale(1.1);
}
/* ===== LIST MAINTENANCE SCANNER STYLES ===== */

.list-maintenance-header {
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.list-maintenance-header h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.list-maintenance-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.list-maintenance-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 15px;
    max-height: 500px;
    overflow-y: auto;
}

.maintenance-column {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 14px;
}

.removal-header {
    background: rgba(255, 0, 64, 0.15);
    border-bottom: 2px solid #ff0040;
    color: #ff4466;
}

.addition-header {
    background: rgba(0, 204, 102, 0.15);
    border-bottom: 2px solid #00cc66;
    color: #00cc66;
}

.column-icon {
    font-size: 16px;
}

.column-title {
    flex: 1;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
    color: var(--text-secondary);
}

.select-all-label input {
    cursor: pointer;
}

.maintenance-list {
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.no-candidates {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

.maintenance-item {
    display: grid;
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto;
    gap: 5px 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-primary);
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.maintenance-item:hover {
    background: var(--bg-tertiary);
}

.removal-item {
    border-left-color: #ff0040;
}

.addition-item {
    border-left-color: #00cc66;
}

.maintenance-checkbox {
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maintenance-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.item-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-symbol {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
}

.item-symbol:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.item-rs {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.rs-maint-weak {
    background: rgba(255, 0, 64, 0.2);
    color: #ff4466;
}

.rs-maint-strong {
    background: rgba(0, 204, 102, 0.2);
    color: #00cc66;
}

.item-percent {
    font-size: 12px;
    color: var(--text-secondary);
}

.item-percent.deep-correction {
    color: #ff4466;
    font-weight: 600;
}

.item-signals {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.signal-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.removal-tag {
    background: rgba(255, 0, 64, 0.1);
    color: #ff6680;
    border: 1px solid rgba(255, 0, 64, 0.3);
}

.addition-tag {
    background: rgba(0, 204, 102, 0.1);
    color: #33dd88;
    border: 1px solid rgba(0, 204, 102, 0.3);
}

.maintenance-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.maintenance-btn {
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.cancel-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.apply-btn {
    background: linear-gradient(135deg, #00cc66, #00aa55);
    border: none;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 204, 102, 0.3);
}

.apply-btn:hover {
    background: linear-gradient(135deg, #00dd77, #00bb66);
    box-shadow: 0 4px 12px rgba(0, 204, 102, 0.4);
    transform: translateY(-1px);
}

/* Responsive - stack columns on smaller screens */
@media (max-width: 900px) {
    .list-maintenance-container {
        grid-template-columns: 1fr;
    }
}

/* ===== DRAWING TOOLS DROPDOWN (matches chart-controls exactly) ===== */
.drawing-tools-dropdown {
    position: fixed;
    z-index: 10000;
    display: none;
}

.drawing-tools-dropdown.show {
    display: block;
}

.drawing-tools-menu {
    display: block;
    position: relative;
    top: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    min-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
}

.drawing-tools-menu .control-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.drawing-tools-menu .control-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.drawing-tools-menu .control-item:hover {
    background: var(--bg-secondary);
}

.drawing-tools-menu .control-item.active {
    background: var(--primary-color);
    color: white;
}

.drawing-tools-menu .control-item.active .tool-hint {
    color: rgba(255, 255, 255, 0.7);
}

.drawing-tools-menu .control-item.danger:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff6666;
}

.drawing-tools-menu .tool-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.drawing-tools-menu .tool-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.drawing-tools-menu .control-item.active .tool-label {
    color: white;
}

.drawing-tools-menu .tool-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.drawing-tools-menu .control-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.4rem 0;
}

#drawingToolsButton.active .dropdown-arrow-inline {
    transform: rotate(180deg);
}

/* Drawn Lines */
.drawn-line {
    pointer-events: none;
}

.drawn-line-hitarea {
    pointer-events: stroke;
    cursor: pointer;
}

.drawn-line-group:hover .drawn-line {
    stroke-width: 3;
}

.drawing-preview-line {
    pointer-events: none;
}

/* Freehand path styles */
.drawn-path {
    pointer-events: none;
}

.drawn-path-hitarea {
    pointer-events: stroke;
    cursor: pointer;
}

.drawn-path-group:hover .drawn-path {
    stroke-width: 3;
}

.drawing-preview-path {
    pointer-events: none;
}

/* ===== ADMIN TABS ===== */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin: -0.75rem -1rem 0 -1rem;
    padding: 0 1rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.admin-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* ===== SECURITY MONITOR ===== */
.security-monitor {
    padding-top: 1rem;
}

.security-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.security-stat {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.security-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.security-stat-value.status-active {
    color: #00cc66;
}

.security-stat-value.status-inactive {
    color: #ff4444;
}

.security-stat-value.threat-low {
    color: #00cc66;
}

.security-stat-value.threat-medium {
    color: #ffc107;
}

.security-stat-value.threat-high {
    color: #ff8c00;
}

.security-stat-value.threat-critical {
    color: #ff4444;
}

.security-stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.25rem;
}

.security-stat-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.25rem;
}

.security-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.security-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.security-section-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.security-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.security-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.security-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.security-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
}

.security-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.security-btn.primary:hover {
    background: var(--primary-light);
}

.security-btn.danger {
    background: rgba(255, 68, 68, 0.1);
    border-color: #ff4444;
    color: #ff4444;
}

.security-btn.danger:hover {
    background: rgba(255, 68, 68, 0.2);
}

/* Security Table */
.security-table-container {
    max-height: 300px;
    overflow-y: auto;
}

.security-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.security-table th {
    background: var(--bg-secondary);
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

.security-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.security-table .ip-address {
    font-family: monospace;
    font-weight: 600;
}

.security-status {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.security-status.blocked {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

.security-action-btn {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.security-action-btn.unblock {
    background: rgba(0, 204, 102, 0.1);
    color: #00cc66;
}

.security-action-btn.unblock:hover {
    background: rgba(0, 204, 102, 0.2);
}

.security-empty {
    text-align: center;
    padding: 2rem !important;
    color: var(--text-secondary);
}

.security-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.security-loading {
    text-align: center;
    padding: 2rem !important;
    color: var(--text-muted);
}

/* Pagination */
.security-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-buttons button {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.pagination-buttons button:hover:not(:disabled) {
    background: var(--bg-card);
    border-color: var(--primary-color);
}

.pagination-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-current {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Security Log */
.security-log {
    max-height: 200px;
    overflow-y: auto;
}

.security-log-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.security-log-entry.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.security-log-entry.success {
    background: rgba(0, 204, 102, 0.1);
    color: #00cc66;
}

.security-log-entry.error {
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
}

.security-log-entry.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.log-icon {
    font-weight: bold;
    width: 16px;
    text-align: center;
}

.log-message {
    flex: 1;
}

.log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .security-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-tabs {
        overflow-x: auto;
    }
}
/* ===== PARTNER LINKS DROPDOWN ===== */
.partner-dropdown {
    position: relative;
}

.partner-button {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    border: none !important;
}

.partner-button:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.partner-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 180px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.partner-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.partner-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
}

.partner-link:hover {
    background: #f0f0f0;
}

.partner-icon {
    font-size: 1rem;
}

.partner-name {
    font-size: 0.9rem;
}

/* Market Leaders Scanner Styles */
.leadership-cell {
    min-width: 80px;
}

.leadership-score {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-primary);
}

.leadership-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.leadership-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.rs-elite { color: #00e676; font-weight: 700; }
.rs-strong { color: #69f0ae; font-weight: 600; }
.rs-good { color: #b2ff59; }

.prob-high { color: #00e676; font-weight: 700; }
.prob-medium { color: #ffc107; font-weight: 600; }
.prob-low { color: #ff9800; }

.confidence-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
}

.confidence-badge.confidence-high {
    background: rgba(0, 230, 118, 0.2);
    color: #00e676;
    border: 1px solid #00e676;
}

.confidence-badge.confidence-medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.confidence-badge.confidence-low {
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    border: 1px solid #ff9800;
}

.no-pattern {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.85em;
}

/* ===== EXPORT TICKERS (minimal additions) ===== */
.export-dropdown-container {
    position: relative;
    display: inline-block;
    margin-left: auto;
}

.export-tickers-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-tickers-btn:hover {
    border-color: var(--primary-color);
}

.export-tickers-btn.copied {
    background: rgba(0, 200, 83, 0.2);
    border-color: #00c853;
    color: #00c853;
}

.export-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
    min-width: 160px;
}

.export-dropdown.show {
    display: block;
}

.export-dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.export-dropdown-item:hover {
    background: var(--bg-tertiary);
}

.export-dropdown-section {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.export-dropdown-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.export-count-select {
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.export-count-select:hover {
    border-color: var(--primary-color);
}

.export-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}
/* ===== DARK POOL TAB STYLES ===== */

/* Control Bar */
.dp-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.dp-symbol-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dp-symbol-section label {
    color: var(--text-secondary);
    font-weight: 600;
}

.dp-symbol-input {
    width: 100px;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dp-symbol-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.dp-load-btn {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dp-load-btn:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.dp-price-display {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.dp-current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dp-price-change {
    font-size: 1rem;
    font-weight: 600;
}

.dp-price-change.positive {
    color: var(--success-color);
}

.dp-price-change.negative {
    color: var(--danger-color);
}

/* Date Range Buttons */
.dp-range-section {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 8px;
}

.dp-range-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dp-range-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.dp-range-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* Results Area */
.darkpool-results-area {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    min-height: 600px;
    position: relative;
}

/* Loading Overlay */
.dp-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    border-radius: 16px;
}

.dp-loading p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

/* Loading Overlay - Fullscreen Fix */
body.dp-heatmap-fullscreen-active #dp-loading,
body.dp-chart-fullscreen-active #dp-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    z-index: 10000;
}

/* Error Display */
.dp-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Empty State */
.dp-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.dp-empty .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.dp-empty h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dp-empty p {
    color: var(--text-secondary);
}

/* Stats Grid */
.dp-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dp-stat-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
}

.dp-stat-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.dp-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.dp-stat-value.cyan { color: #00d4ff; }
.dp-stat-value.green { color: #00cc66; }
.dp-stat-value.blue { color: #0066cc; }
.dp-stat-value.purple { color: #9966ff; }
.dp-stat-value.yellow { color: #ffcc00; }
.dp-stat-value.orange { color: #ff9500; }

.dp-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Charts Row */
.dp-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dp-chart-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.dp-chart-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dp-chart-container {
    min-height: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dp-chart-container svg {
    width: 100%;
    height: 100%;
}

.dp-chart-container .dp-no-data {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Dark Pool Search Box */
.dp-search-box {
    position: relative;
    min-width: 280px;
}

.dp-search-box .symbol-input {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

.dp-search-box .symbol-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.dp-search-box .symbol-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.dp-search-box .symbol-autocomplete.visible {
    display: block;
}

.dp-search-box .autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s ease;
}

.dp-search-box .autocomplete-item:last-child {
    border-bottom: none;
}

.dp-search-box .autocomplete-item:hover,
.dp-search-box .autocomplete-item.highlighted {
    background: var(--bg-tertiary);
}

.dp-search-box .autocomplete-symbol {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-color);
    min-width: 60px;
}

.dp-search-box .autocomplete-name {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dp-search-box .autocomplete-no-results {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* D3 Chart Axis Styling */
.dp-axis text {
    fill: var(--text-secondary);
    font-size: 11px;
}

.dp-axis line,
.dp-axis path {
    stroke: var(--border-color);
}

/* Heatmap */
.heatmap-cell {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.heatmap-cell:hover {
    opacity: 0.8;
    stroke: #fff;
    stroke-width: 2;
}

/* ===== HEATMAP FULLSCREEN ===== */
.dp-heatmap-panel.dp-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #1a1a2e !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.dp-heatmap-panel.dp-fullscreen-mode .dp-chart-header {
    display: none;
}

.dp-heatmap-panel.dp-fullscreen-mode .dp-heatmap-controls {
    display: flex;
}

.dp-heatmap-panel.dp-fullscreen-mode .dp-chart-container {
    height: calc(100vh - 60px) !important;
}

/* Hide other content when heatmap fullscreen */
body.dp-heatmap-fullscreen-active {
    overflow: hidden !important;
}

body.dp-heatmap-fullscreen-active .app-header,
body.dp-heatmap-fullscreen-active .sidebar,
body.dp-heatmap-fullscreen-active .dp-sidebar,
body.dp-heatmap-fullscreen-active .dp-stats-row,
body.dp-heatmap-fullscreen-active .dp-trades-panel,
body.dp-heatmap-fullscreen-active .tab-nav {
    display: none !important;
}

body.dp-heatmap-fullscreen-active .dp-charts-row {
    display: block !important;
}

body.dp-heatmap-fullscreen-active .dp-charts-row > .dp-chart-panel:not(.dp-fullscreen-mode) {
    display: none !important;
}

/* Trades Table Panel */
.dp-trades-panel {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.dp-trades-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dp-table-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

.dp-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.dp-trades-table {
    width: 100%;
    border-collapse: collapse;
}

.dp-trades-table thead {
    position: sticky;
    top: 0;
    background: var(--bg-tertiary);
    z-index: 10;
}

.dp-trades-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.dp-trades-table th:nth-child(3),
.dp-trades-table th:nth-child(4),
.dp-trades-table th:nth-child(5) {
    text-align: right;
}

.dp-trades-table td {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.dp-trades-table td:nth-child(3),
.dp-trades-table td:nth-child(4),
.dp-trades-table td:nth-child(5) {
    text-align: right;
}

.dp-trades-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dp-mono {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.dp-trade-value {
    font-weight: 700;
    color: var(--success-color);
}

.dp-exchange {
    color: var(--text-muted);
}

/* Trade Type Badges */
.dp-trade-type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dp-trade-type-badge.dp-sweep {
    background: rgba(255, 100, 50, 0.2);
    color: #ff6432;
}

.dp-trade-type-badge.lit-sweep {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
}

.dp-trade-type-badge.dp-block {
    background: rgba(153, 102, 255, 0.2);
    color: #9966ff;
}

.dp-trade-type-badge.lit-block {
    background: rgba(0, 102, 204, 0.2);
    color: #0099ff;
}

/* ===== DARK POOL SIDEBAR STYLES ===== */

.dp-insights {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dp-insight-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.dp-insight-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.dp-insight-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.dp-insight-value.cyan { color: #00d4ff; }
.dp-insight-value.green { color: #00cc66; }
.dp-insight-value.yellow { color: #ffcc00; }
.dp-insight-value.red { color: #ff4444; }

/* Top Trades in Sidebar */
.dp-top-trades {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dp-top-trade-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.dp-top-trade-rank {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffcc00;
    min-width: 28px;
}

.dp-top-trade-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dp-top-trade-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dp-top-trade-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dp-top-trade-value {
    font-weight: 700;
    color: var(--success-color);
}

/* Connection Status */
.dp-connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.dp-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dp-status-indicator.connected {
    background: #00cc66;
    box-shadow: 0 0 8px rgba(0, 204, 102, 0.5);
    animation: pulse-green 2s infinite;
}

.dp-status-indicator.disconnected {
    background: #666;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.dp-connection-meta {
    font-size: 0.8rem;
}

.dp-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    color: var(--text-muted);
}

/* Help List */
.dp-help-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dp-help-list li {
    padding: 0.5rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    line-height: 1.4;
}

.dp-help-list li:last-child {
    border-bottom: none;
}

.dp-help-list li strong {
    color: var(--text-primary);
}

.dp-no-data {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

/* Dark Pool Heatmap Tooltip */
.dp-heatmap-tooltip {
    display: none;
    position: absolute;
    z-index: 10000;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px 16px;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    min-width: 160px;
}

.dp-tooltip-header {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dp-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.dp-tooltip-label {
    color: #888;
    font-size: 12px;
}

.dp-tooltip-value {
    color: #00d4ff;
    font-weight: 600;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1400px) {
    .dp-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dp-charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    .dp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dp-control-bar {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ===== DP SWEEP SCANNER STYLES ===== */
.dp-signal-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.dp-signal-badge.signal-bearish {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.dp-signal-badge.signal-bullish {
    background: rgba(0, 200, 100, 0.2);
    color: #00c864;
}

.spike-ratio {
    color: #00d4ff;
    font-weight: 700;
}