/* Custom CSS for TradingAgents Dash UI */

/* ═══════════════════════════════════════════════════════════════════════════
   THEME VARIABLES - Dark Theme (Default)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --border-color: #334155;
    --accent-primary: #3B82F6;
    --accent-secondary: #10B981;
    --accent-warning: #F59E0B;
    --accent-danger: #EF4444;
    --card-bg: #1E293B;
    --input-bg: #1E293B;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --gradient-start: #0F172A;
    --gradient-end: #1E293B;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT (WHITE) THEME
   ═══════════════════════════════════════════════════════════════════════════ */
body.theme-bw {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #E2E8F0;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --border-color: #CBD5E1;
    --accent-primary: #3B82F6;
    --accent-secondary: #10B981;
    --accent-warning: #F59E0B;
    --accent-danger: #EF4444;
    --card-bg: #FFFFFF;
    --input-bg: #FFFFFF;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-start: #F8FAFC;
    --gradient-end: #FFFFFF;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}

.dash-markdown {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Card styling */
.card {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    margin-bottom: 20px;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Button styling */
.btn-primary {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    filter: brightness(0.9);
}

body.theme-bw .btn-primary {
    background-color: #3B82F6;
    border-color: #3B82F6;
    color: #FFFFFF;
}

body.theme-bw .btn-primary:hover {
    background-color: #2563EB;
    border-color: #2563EB;
    color: #FFFFFF;
}

/* Navigation buttons */
.btn-link {
    padding: 0.25rem 0.5rem;
    margin: 0 0.25rem;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: none;
}

/* Status colors */
.text-pending {
    color: #94A3B8;
}

.text-in-progress {
    color: #F59E0B;
}

.text-completed {
    color: #10B981;
}

.text-error {
    color: #EF4444;
}

/* Table styling */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
}

.table td, .table th {
    border-top: 1px solid var(--border-color);
}

/* Input styling */
.form-control {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: var(--input-bg);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

body.theme-bw .form-control {
    background-color: #FFFFFF;
    border-color: #CBD5E1;
    color: #1E293B;
}

body.theme-bw .form-control:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Tabs styling */
.nav-tabs {
    border-bottom: 1px solid #334155;
}

.nav-tabs .nav-link {
    color: #64748B;
    border: none;
}

.nav-tabs .nav-link.active {
    color: #F1F5F9;
    background-color: transparent;
    border-bottom: 2px solid #3B82F6;
}

.tab-content {
    padding: 1rem 0;
}

/* Chart container */
.chart-container {
    height: 1000px;
    width: 100%;
}

/* Progress indicators */
.progress {
    background-color: #334155;
}

.progress-bar {
    background-color: #3B82F6;
}

/* Researcher Debate styling */
.researcher-debate {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1E293B;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.debate-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-weight: bold;
    border-bottom: 1px solid #334155;
    margin-bottom: 15px;
}

.bull-header {
    color: #10B981;
    padding-left: 20px;
    font-size: 1.1rem;
}

.bear-header {
    color: #EF4444;
    padding-right: 20px;
    font-size: 1.1rem;
}

.debate-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px 0;
}

.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 12px;
}

.bull-message, .bear-message {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 10px;
    white-space: pre-wrap;
    line-height: 1.5;
}

.bull-message {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 4px solid #10B981;
    margin-right: auto;
    color: #F1F5F9;
}

.bear-message {
    background-color: rgba(239, 68, 68, 0.1);
    border-right: 4px solid #EF4444;
    margin-left: auto;
    text-align: right;
    color: #F1F5F9;
}

.message-spacer {
    flex: 1;
    min-width: 20px;
}

/* Enhanced Alpaca account section styling */
.enhanced-alpaca-section {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.enhanced-account-summary {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.enhanced-summary-item {
    background: rgba(59, 130, 246, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin: 5px;
    border: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.3s ease;
}

.enhanced-summary-item:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.summary-item {
    text-align: center;
}

.summary-label {
    font-size: 0.9rem;
    color: #94A3B8;
    font-weight: 600;
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #3B82F6;
}

.summary-value.positive {
    color: #10B981;
}

.summary-value.negative {
    color: #EF4444;
}

/* Enhanced Table Styling */
.enhanced-table-container {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #334155;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.enhanced-table-container.error-state {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

.enhanced-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    font-size: 0.9rem;
}

.table-header {
    background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
    color: #F1F5F9;
    font-weight: 600;
    padding: 15px 12px;
    text-align: left;
    border: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-header:first-child {
    border-top-left-radius: 8px;
}

.table-header:last-child {
    border-top-right-radius: 8px;
}

.table-row-hover {
    background-color: rgba(30, 41, 59, 0.5);
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.table-row-hover:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

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

.table-row-hover td {
    padding: 15px 12px;
    border: none;
    vertical-align: middle;
}

.symbol-cell {
    width: 25%;
}

.value-cell, .pnl-cell {
    width: 20%;
}

.action-cell {
    width: 15%;
    text-align: center;
}

.side-cell, .filled-cell, .price-cell, .status-cell {
    width: 20%;
}

.symbol-text {
    color: #3B82F6;
    font-weight: 600;
    font-size: 1rem;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Liquidate Button Styling */
.liquidate-btn {
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-width: 2px;
}

.liquidate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Markdown Table Styling - ChatGPT-like appearance */
.dash-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background-color: transparent;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dash-markdown table thead {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.dash-markdown table thead th {
    color: #FFFFFF;
    font-weight: 600;
    padding: 16px 20px;
    text-align: left;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.dash-markdown table thead th:first-child {
    border-top-left-radius: 10px;
}

.dash-markdown table thead th:last-child {
    border-top-right-radius: 10px;
}

.dash-markdown table tbody tr {
    background-color: rgba(30, 41, 59, 0.3);
    border-bottom: 1px solid rgba(51, 65, 85, 0.2);
    transition: all 0.3s ease;
}

.dash-markdown table tbody tr:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.dash-markdown table tbody tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.2);
}

.dash-markdown table tbody tr:nth-child(even):hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
}

.dash-markdown table tbody td {
    padding: 14px 20px;
    color: #F1F5F9;
    font-size: 0.9rem;
    line-height: 1.5;
    border: none;
    vertical-align: middle;
}

.dash-markdown table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
}

.dash-markdown table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
}

/* Special styling for different types of table cells */
.dash-markdown table td:contains("BUY"),
.dash-markdown table td:contains("LONG"),
.dash-markdown table td:contains("Bullish") {
    color: #10B981;
    font-weight: 600;
}

.dash-markdown table td:contains("SELL"),
.dash-markdown table td:contains("SHORT"),
.dash-markdown table td:contains("Bearish") {
    color: #EF4444;
    font-weight: 600;
}

.dash-markdown table td:contains("HOLD"),
.dash-markdown table td:contains("NEUTRAL"),
.dash-markdown table td:contains("Neutral") {
    color: #F59E0B;
    font-weight: 600;
}

/* Responsive table styling */
@media (max-width: 768px) {
    .dash-markdown table {
        font-size: 0.8rem;
    }
    
    .dash-markdown table thead th,
    .dash-markdown table tbody td {
        padding: 10px 12px;
    }
    
    .dash-markdown table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Code blocks in markdown for better formatting */
.dash-markdown pre {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
    margin: 1rem 0;
    overflow-x: auto;
    color: #E2E8F0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}

.dash-markdown code {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

/* Enhanced markdown headers */
.dash-markdown h1,
.dash-markdown h2,
.dash-markdown h3,
.dash-markdown h4,
.dash-markdown h5,
.dash-markdown h6 {
    color: #F1F5F9;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.dash-markdown h1 {
    font-size: 2rem;
    border-bottom: 2px solid #3B82F6;
    padding-bottom: 0.5rem;
}

.dash-markdown h2 {
    font-size: 1.6rem;
    color: #3B82F6;
}

.dash-markdown h3 {
    font-size: 1.3rem;
    color: #60A5FA;
}

.dash-markdown h4 {
    font-size: 1.1rem;
    color: #93C5FD;
}

/* Lists styling */
.dash-markdown ul,
.dash-markdown ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.dash-markdown li {
    margin: 0.5rem 0;
    line-height: 1.6;
    color: #E2E8F0;
}

/* Blockquotes */
.dash-markdown blockquote {
    border-left: 4px solid #3B82F6;
    background-color: rgba(59, 130, 246, 0.05);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    color: #E2E8F0;
    font-style: italic;
}

/* Strong text and emphasis */
.dash-markdown strong {
    color: #F1F5F9;
    font-weight: 700;
}

.dash-markdown em {
    color: #CBD5E1;
    font-style: italic;
}

/* Horizontal rules */
.dash-markdown hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #334155, transparent);
    margin: 2rem 0;
}

/* Table container wrapper for better spacing */
.dash-markdown {
    max-width: 100%;
    overflow-x: auto;
}

/* Enhanced Reports Panel Styling */
.reports-panel-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.report-title {
    color: #F1F5F9;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.report-title i {
    color: #3B82F6;
}

.report-divider {
    background: linear-gradient(90deg, transparent, #334155, transparent);
    border: none;
    height: 1px;
    margin: 1rem 0;
}

.pagination-row {
    background-color: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.current-symbol-container {
    color: #94A3B8;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-symbol-container i {
    color: #3B82F6;
}

.symbol-display {
    color: #3B82F6;
    font-weight: 700;
    font-size: 1.4rem;
}

/* Enhanced Tabs Styling */
.enhanced-tabs .nav-tabs {
    background: linear-gradient(135deg, #334155 0%, #1E293B 100%);
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #3B82F6;
    padding: 0.25rem 0.5rem 0 0.5rem;
}

.enhanced-tabs .nav-tabs .nav-link {
    color: #94A3B8;
    border: none;
    background: transparent;
    border-radius: 6px 6px 0 0;
    padding: 0.75rem 1rem;
    margin-right: 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.enhanced-tabs .nav-tabs .nav-link:hover {
    color: #E2E8F0;
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.enhanced-tabs .nav-tabs .nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Tab content containers */
[id$="-tab-content"] {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: 0 0 8px 8px;
    padding: 1.5rem;
    min-height: 1000px;
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-top: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Enhanced markdown content within tabs */
[id$="-tab-content"] .enhanced-markdown-content {
    background: transparent;
    border: none;
    padding: 0;
    min-height: auto;
    color: #E2E8F0;
    line-height: 1.6;
}

/* Loading messages in tab content */
[id$="-tab-content"] .loading-message {
    color: #3B82F6;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

[id$="-tab-content"] .loading-description {
    color: #94A3B8;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    text-align: center;
    font-style: italic;
}

/* Debate content wrapper styling */
[id$="-tab-content"] .debate-content-wrapper {
    background: transparent;
    padding: 0;
    min-height: 850px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Mobile responsiveness for tab content */
@media (max-width: 768px) {
    [id$="-tab-content"] {
        padding: 1rem;
        min-height: 300px;
    }
    
    .enhanced-tabs .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

.dash-markdown {
    max-width: 100%;
    overflow-x: auto;
}

/* Enhanced Reports Panel Styling */
.reports-panel-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.report-title {
    color: #F1F5F9;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.report-title i {
    color: #3B82F6;
}

.report-divider {
    background: linear-gradient(90deg, transparent, #334155, transparent);
    border: none;
    height: 1px;
    margin: 1rem 0;
}

.pagination-row {
    background-color: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.current-symbol-container {
    color: #94A3B8;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-symbol-container i {
    color: #3B82F6;
}

.symbol-display {
    color: #3B82F6;
    font-weight: 700;
    font-size: 1.4rem;
}

/* Symbol Pagination Styling */
.symbol-pagination-container {
    background-color: rgba(15, 23, 42, 0.3);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

.symbol-pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.symbol-btn {
    transition: all 0.15s ease !important;
    min-width: 60px;
    font-weight: 500;
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border: 1px solid #475569;
    color: #E2E8F0;
    transform: translateY(0);
    margin: 0 2px;
    border-radius: 6px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.symbol-btn:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    border-color: #2563EB !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3) !important;
}

/* IMMEDIATE CLICK FEEDBACK - This fires instantly! */
.symbol-btn:active {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%) !important;
    border-color: #1E40AF !important;
    color: white !important;
    transform: translateY(0) scale(0.95) !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.4) !important;
    transition: all 0.05s ease !important;
}

/* SELECTED STATE - This updates after callback */
.symbol-btn.active {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    border-color: #059669 !important;
    color: white !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3) !important;
}

/* SELECTED STATE HOVER */
.symbol-btn.active:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border-color: #047857 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.4) !important;
}

/* SELECTED STATE CLICK */
.symbol-btn.active:active {
    background: linear-gradient(135deg, #047857 0%, #065F46 100%) !important;
    border-color: #065F46 !important;
    transform: translateY(0) scale(0.98) !important;
    transition: all 0.05s ease !important;
}

/* Touch device support for immediate feedback */
@media (hover: none) and (pointer: coarse) {
    .symbol-btn:active {
        background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%) !important;
        border-color: #1E40AF !important;
        color: white !important;
        transform: scale(0.95) !important;
        transition: all 0.1s ease !important;
    }
    
    .symbol-btn.active:active {
        background: linear-gradient(135deg, #047857 0%, #065F46 100%) !important;
        border-color: #065F46 !important;
        transform: scale(0.95) !important;
    }
    
    /* Larger touch targets on mobile */
    .symbol-btn {
        min-height: 44px;
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Symbol Button Group Styling */
.btn-group .symbol-btn:not(:last-child) {
    margin-right: 2px;
}

.btn-group .symbol-btn:not(:first-child) {
    margin-left: 2px;
}

/* Button group container */
.symbol-pagination-wrapper .btn-group {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Focus states for accessibility */
.symbol-btn:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.symbol-btn.active:focus {
    outline: 2px solid #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Navigation Info */
.symbol-pagination-wrapper .text-muted {
    font-size: 0.85rem;
    color: #64748B !important;
    font-weight: 500;
}

.symbol-pagination-wrapper .text-muted i {
    color: #3B82F6;
    margin-right: 0.5rem;
}

/* Responsive Symbol Pagination */
@media (max-width: 768px) {
    .symbol-btn {
        min-width: 50px !important;
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem !important;
        margin: 0 1px !important;
    }
    
    .symbol-pagination-wrapper .btn-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-row {
        padding: 8px;
    }
}

/* Enhanced Tabs Styling */
.enhanced-tabs .nav-tabs {
    border-bottom: 1px solid #334155;
    background-color: rgba(15, 23, 42, 0.5);
    border-radius: 8px 8px 0 0;
    padding: 0.5rem;
}

.enhanced-tabs .nav-tabs .nav-link {
    color: #94A3B8;
    border: none;
    border-radius: 6px;
    margin: 0 2px;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: transparent;
}

.enhanced-tabs .nav-tabs .nav-link:hover {
    color: #E2E8F0;
    background-color: rgba(59, 130, 246, 0.1);
    border-color: transparent;
}

.enhanced-tabs .nav-tabs .nav-link.active {
    color: #FFFFFF;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Loading States for Symbol Pagination */
.symbol-pagination-container .text-muted {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #64748B;
    font-style: italic;
}

/* Animation for Symbol Button Clicks */
@keyframes symbolClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.symbol-btn:active {
    animation: symbolClick 0.15s ease;
}

/* Enhanced Visual Feedback */
.symbol-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* Gradient Background for Active State */
.symbol-btn.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Debate iframe styling */
.debate-iframe {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.debate-iframe:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* Enhanced styling for debate content containers */
[id$="debate-tab-content"] {
    padding: 0 !important;
    background: #1E293B !important;
    border: 1px solid #334155;
}

[id$="debate-tab-content"] .debate-content-wrapper {
    min-height: 850px;
}

/* Mobile responsiveness for debates */
@media (max-width: 768px) {
    .debate-iframe {
        height: 1000px !important;
    }
    
    [id$="debate-tab-content"] {
        padding: 0.5rem !important;
    }
}

/* Prompt Modal and Button Styling */
.show-prompt-btn {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    opacity: 0.8;
    transition: all 0.2s ease;
    border-radius: 4px !important;
}

.show-prompt-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.report-header {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(51, 65, 85, 0.3);
    margin-bottom: 1rem;
}

.report-header-title {
    color: #E2E8F0;
    font-weight: 600;
    margin: 0;
}

.report-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.prompt-modal .modal-content {
    background-color: #1E293B;
    border: 1px solid #334155;
    border-radius: 12px;
}

.prompt-modal-header {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-bottom: 1px solid #334155;
    border-radius: 12px 12px 0 0;
}

.prompt-modal-header h4 {
    color: #E2E8F0;
    margin: 0;
}

.prompt-modal-body {
    background-color: #1E293B;
    color: #E2E8F0;
}

.prompt-content {
    background: #0F172A !important;
    border: 1px solid #334155 !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
    font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #E2E8F0 !important;
    white-space: pre-wrap !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #334155 #1E293B;
}

.prompt-content::-webkit-scrollbar {
    width: 8px;
}

.prompt-content::-webkit-scrollbar-track {
    background: #1E293B;
    border-radius: 4px;
}

.prompt-content::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.prompt-content::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.prompt-modal .modal-footer {
    background-color: #1E293B;
    border-top: 1px solid #334155;
    border-radius: 0 0 12px 12px;
}

.prompt-modal .btn-outline-primary {
    border-color: #3B82F6;
    color: #3B82F6;
}

.prompt-modal .btn-outline-primary:hover {
    background-color: #3B82F6;
    border-color: #3B82F6;
    color: #FFFFFF;
}

.prompt-modal .btn-secondary {
    background-color: #64748B;
    border-color: #64748B;
    color: #FFFFFF;
}

.prompt-modal .btn-secondary:hover {
    background-color: #475569;
    border-color: #475569;
}

/* Animation for prompt buttons */
@keyframes promptButtonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.show-prompt-btn:active {
    animation: promptButtonPulse 0.15s ease;
}

/* Responsive design for prompt modal */
@media (max-width: 768px) {
    .prompt-modal .modal-dialog {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .report-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .report-header-actions {
        justify-content: center;
    }
    
    .prompt-content {
        font-size: 12px !important;
        max-height: 300px !important;
    }
}

/* Tool Outputs Modal Styling */
.show-tool-outputs-btn {
    transition: all 0.2s ease-in-out;
    border-radius: 6px;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.show-tool-outputs-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.report-debug-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.tool-outputs-modal .modal-content {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #374151;
}

.tool-outputs-modal-header {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
    border-bottom: 1px solid #4B5563;
}

.tool-outputs-modal-header h4 {
    color: #FCD34D;
    font-weight: 600;
}

.tool-outputs-modal-body {
    max-height: 70vh;
    background: #0F172A;
}

.tool-outputs-content {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    line-height: 1.6;
    background: #111827 !important;
    border: 1px solid #374151 !important;
    border-radius: 8px !important;
    padding: 1.5rem !important;
    color: #F8FAFC !important;
    max-height: 500px;
    overflow-y: auto;
}

.tool-outputs-content h1 {
    color: #FCD34D !important;
    border-bottom: 2px solid #4B5563;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tool-outputs-content h2 {
    color: #34D399 !important;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.3rem;
    margin-bottom: 0.8rem;
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

.tool-outputs-content h3 {
    color: #60A5FA !important;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.tool-outputs-content p {
    color: #E5E7EB !important;
    margin-bottom: 0.5rem;
}

.tool-outputs-content strong {
    color: #F3F4F6 !important;
    font-weight: 600;
}

.tool-outputs-content code {
    background: #1E293B !important; /* slightly lighter than pre */
    color: #93C5FD !important;      /* soft blue text */
    border: 1px solid #334155;
}

/* ---------- Better code block readability in Tool Outputs ---------- */
.tool-outputs-content pre {
    background: #0F172A !important;   /* darker background */
    border: 1px solid #334155 !important;
    color: #F1F5F9 !important;       /* lighter text */
    border-radius: 6px;
    padding: 1rem !important;
    overflow-x: auto;
    font-size: 13px;
}

.tool-outputs-content pre code {
    background: #afbddf !important;   /* darker background */
    color: #0F172A !important;
}

.tool-outputs-content::-webkit-scrollbar {
    width: 8px;
}

.tool-outputs-content::-webkit-scrollbar-track {
    background: #1F2937;
    border-radius: 4px;
}

.tool-outputs-content::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 4px;
}

.tool-outputs-content::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

.tool-outputs-modal .modal-footer {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    border-top: 1px solid #374151;
}

.tool-outputs-modal .btn-outline-warning {
    border-color: #F59E0B;
    color: #F59E0B;
}

.tool-outputs-modal .btn-outline-warning:hover {
    background-color: #F59E0B;
    color: #1F2937;
}

.tool-outputs-modal .btn-outline-primary {
    border-color: #3B82F6;
    color: #3B82F6;
}

.tool-outputs-modal .btn-outline-primary:hover {
    background-color: #3B82F6;
    color: #FFFFFF;
}

.tool-outputs-modal .btn-outline-success {
    border-color: #10B981;
    color: #10B981;
}

.tool-outputs-modal .btn-outline-success:hover {
    background-color: #10B981;
    color: #FFFFFF;
}

.tool-outputs-modal .btn-secondary {
    background-color: #4B5563;
    border-color: #4B5563;
    color: #F9FAFB;
}

.tool-outputs-modal .btn-secondary:hover {
    background-color: #374151;
    border-color: #374151;
}

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

.show-tool-outputs-btn:active {
    animation: toolOutputButtonPulse 0.2s ease-in-out;
}

@media (max-width: 768px) {
    .tool-outputs-modal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .report-debug-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .tool-outputs-content {
        font-size: 12px;
        max-height: 300px;
    }
}


/* ================================
   Collapsible Card Styles
   ================================ */

.collapsible-card {
    border: 1px solid #334155;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.collapsible-card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.collapsible-header {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-bottom: 1px solid #334155;
    padding: 14px 18px;
    transition: all 0.2s ease;
    user-select: none;
}

.collapsible-header:hover {
    background: linear-gradient(135deg, #2D3B4F 0%, #1A2332 100%);
}

.collapsible-header:active {
    background: linear-gradient(135deg, #3D4B5F 0%, #2A3342 100%);
}

.collapsible-header .panel-icon {
    font-size: 1.1rem;
}

.collapsible-header .panel-title {
    font-size: 1rem;
    color: #F1F5F9;
    letter-spacing: 0.025em;
}

.collapsible-header .chevron-icon {
    color: #94A3B8;
    font-size: 0.85rem;
    transition: transform 0.3s ease, color 0.2s ease;
}

.collapsible-header:hover .chevron-icon {
    color: #F1F5F9;
}

.collapsible-header .badge-pill {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #FFFFFF;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.collapsible-body {
    background-color: #1E293B;
    padding: 16px;
}

/* Smooth collapse animation */
.collapsible-card .collapse {
    transition: height 0.3s ease;
}

.collapsible-card .collapsing {
    transition: height 0.3s ease;
}

/* Panel-specific colors */
.collapsible-card.alpaca-panel .collapsible-header {
    border-left: 3px solid #10B981;
}

.collapsible-card.scanner-panel .collapsible-header {
    border-left: 3px solid #8B5CF6;
}

.collapsible-card.config-panel .collapsible-header {
    border-left: 3px solid #3B82F6;
}

.collapsible-card.chart-panel .collapsible-header {
    border-left: 3px solid #F59E0B;
}

.collapsible-card.status-panel .collapsible-header {
    border-left: 3px solid #06B6D4;
}

.collapsible-card.decision-panel .collapsible-header {
    border-left: 3px solid #EF4444;
}

.collapsible-card.reports-panel .collapsible-header {
    border-left: 3px solid #EC4899;
}

/* Badge variations */
.badge-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
}

.badge-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
}

.badge-info {
    background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%) !important;
}

/* Focus states for accessibility */
.collapsible-header:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.collapsible-header:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .collapsible-header .chevron-icon,
    .collapsible-card .collapse,
    .collapsible-card .collapsing {
        transition: none;
    }
}

/* ================================
   Scanner Cards Scrollable Layout
   ================================ */

.scanner-cards-scroll {
    scrollbar-width: thin;
    scrollbar-color: #3B82F6 #1E293B;
}

.scanner-cards-scroll::-webkit-scrollbar {
    height: 8px;
}

.scanner-cards-scroll::-webkit-scrollbar-track {
    background: #1E293B;
    border-radius: 4px;
}

.scanner-cards-scroll::-webkit-scrollbar-thumb {
    background: #3B82F6;
    border-radius: 4px;
}

.scanner-cards-scroll::-webkit-scrollbar-thumb:hover {
    background: #2563EB;
}

.scanner-result-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.scanner-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .scanner-cards-scroll {
        padding-left: 5px;
        padding-right: 5px;
    }
    
    .scanner-result-card {
        min-width: 160px !important;
    }
}

/* ================================
   Ticker Progress Panel
   ================================ */

.ticker-progress-item {
    padding: 12px 16px;
    border-bottom: 1px solid #334155;
    transition: background-color 0.2s ease;
}

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

.ticker-progress-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.ticker-symbol {
    font-size: 1.1em;
    color: #60A5FA;
    min-width: 60px;
}

.ticker-progress-bar {
    border-radius: 4px;
}

.agent-badges-row {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.agent-badge {
    font-size: 0.65em;
    padding: 2px 6px;
    min-width: 26px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Badge color overrides for better visibility */
.agent-badge.badge.bg-success {
    background-color: #10B981 !important;
}

.agent-badge.badge.bg-warning {
    background-color: #F59E0B !important;
    color: #000 !important;
}

.agent-badge.badge.bg-secondary {
    background-color: #475569 !important;
}

/* Responsive adjustments for progress panel */
@media (max-width: 768px) {
    .ticker-progress-item {
        padding: 10px 12px;
    }

    .ticker-symbol {
        font-size: 1em;
    }

    .agent-badge {
        font-size: 0.6em;
        padding: 1px 4px;
        min-width: 22px;
    }
}

/* ================================
   Pro Trader Layout Styles
   ================================ */

.pro-trader-layout {
    min-height: 100vh;
}

/* Compact Account Bar */
.compact-account-bar {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.account-bar-container {
    margin-bottom: 1rem;
}

/* Main Trading Row */
.main-trading-row {
    min-height: 600px;
}

/* Chart Card */
.chart-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chart-section {
    height: 100%;
}

/* Trading Panel Card */
.trading-panel-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.trading-panel-section {
    height: 100%;
}

/* Trading Control Panel */
.trading-control-panel {
    padding: 0;
}

.ticker-input-field {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Settings Card */
.settings-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    margin-top: 1rem;
}

/* Signal Card */
.signal-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 15px;
    min-height: 120px;
}

.signal-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.signal-display-content {
    width: 100%;
}

.signal-icon-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.signal-text {
    font-size: 2rem;
    letter-spacing: 2px;
}

/* Compact Decision Panel */
.compact-decision-panel {
    max-height: 350px;
    overflow-y: auto;
}

.decision-details-container {
    margin-top: 1rem;
}

.decision-details-scroll {
    max-height: 150px;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 10px;
}

.compact-markdown {
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Agent Progress Compact */
.agent-progress-compact {
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 6px;
    padding: 10px;
}

.agent-progress-compact .ticker-progress-item {
    padding: 8px 10px;
}

.agent-progress-compact .ticker-symbol {
    font-size: 0.95em;
}

/* Positions & Orders Section */
.positions-orders-section .enhanced-table-container {
    margin-bottom: 0;
    max-height: 300px;
    overflow-y: auto;
}

/* Responsive Pro Trader Layout */
@media (max-width: 991px) {
    .main-trading-row {
        min-height: auto;
    }

    .chart-section,
    .trading-panel-section {
        height: auto;
    }

    .compact-account-bar {
        padding: 10px 15px;
    }

    .compact-account-bar .row {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .compact-account-bar {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .signal-text {
        font-size: 1.5rem;
    }

    .signal-icon-wrapper {
        width: 45px;
        height: 45px;
    }

    .decision-details-scroll {
        max-height: 120px;
    }
}

/* Button Styles for Trading Control */
#control-btn {
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

#control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#toggle-settings-btn {
    transition: all 0.2s ease;
}

#toggle-settings-btn:hover {
    background-color: rgba(148, 163, 184, 0.1);
}

/* Scrollbar for compact sections */
.compact-decision-panel::-webkit-scrollbar,
.agent-progress-compact::-webkit-scrollbar,
.decision-details-scroll::-webkit-scrollbar {
    width: 6px;
}

.compact-decision-panel::-webkit-scrollbar-track,
.agent-progress-compact::-webkit-scrollbar-track,
.decision-details-scroll::-webkit-scrollbar-track {
    background: #1E293B;
    border-radius: 3px;
}

.compact-decision-panel::-webkit-scrollbar-thumb,
.agent-progress-compact::-webkit-scrollbar-thumb,
.decision-details-scroll::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.compact-decision-panel::-webkit-scrollbar-thumb:hover,
.agent-progress-compact::-webkit-scrollbar-thumb:hover,
.decision-details-scroll::-webkit-scrollbar-thumb:hover {
    background: #64748B;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REPORTS PANEL - ORGANIZED NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

/* Reports panel body */
.reports-panel-body {
    padding: 1rem;
}

/* Navigation section container */
.reports-nav-section {
    margin-bottom: 1rem;
}

/* Symbol navigation row */
.symbol-nav-row {
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Current symbol badge */
.current-symbol-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-radius: 6px;
    color: #FFFFFF;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Navigation groups container */
.nav-groups-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    margin-bottom: 1rem;
}

/* Individual navigation group */
.nav-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.3);
}

/* Group label */
.nav-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748B;
    letter-spacing: 0.5px;
    white-space: nowrap;
    padding-right: 0.5rem;
    border-right: 1px solid rgba(51, 65, 85, 0.5);
}

/* Pills group within nav-group */
.nav-pills-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
}

/* Navigation pill styling */
.report-nav-pill {
    color: #94A3B8 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    white-space: nowrap;
}

.report-nav-pill:hover {
    color: #E2E8F0 !important;
    background: rgba(59, 130, 246, 0.15) !important;
}

.report-nav-pill.active,
.nav-pills .nav-link.active.report-nav-pill {
    color: #FFFFFF !important;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3) !important;
}

/* Hide default tabs nav - we use custom nav above */
.reports-tabs-hidden-nav > .nav-tabs {
    display: none !important;
}

/* Tab content styling */
.reports-tabs-hidden-nav .tab-content {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.3);
    min-height: 400px;
}

.reports-tabs-hidden-nav .tab-pane {
    padding: 1rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .nav-groups-container {
        gap: 0.75rem;
    }

    .nav-group {
        padding: 0.25rem 0.5rem;
    }

    .report-nav-pill {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 992px) {
    .nav-groups-container {
        justify-content: center;
    }

    .nav-group-label {
        display: none;
    }

    .nav-group {
        border: none;
        background: transparent;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .symbol-nav-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .symbol-nav-row > div {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }

    .symbol-nav-row .text-end {
        text-align: center !important;
    }

    .nav-groups-container {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-group {
        justify-content: center;
    }

    .nav-pills-group {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME - COMPREHENSIVE OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Light Theme - Cards and Containers */
body.theme-bw .card {
    background-color: #FFFFFF;
    border-color: #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.theme-bw .card-header {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
    color: #1E293B;
}

body.theme-bw .card-body {
    background-color: #FFFFFF;
    color: #1E293B;
}

/* Light Theme - Navigation */
body.theme-bw .nav-group {
    background: rgba(248, 250, 252, 0.9);
    border-color: #E2E8F0;
}

body.theme-bw .nav-group-label {
    color: #64748B;
    border-color: #CBD5E1;
}

body.theme-bw .report-nav-pill {
    color: #475569 !important;
}

body.theme-bw .report-nav-pill:hover {
    color: #1E293B !important;
    background: rgba(59, 130, 246, 0.1) !important;
}

body.theme-bw .report-nav-pill.active,
body.theme-bw .nav-pills .nav-link.active.report-nav-pill {
    color: #FFFFFF !important;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3) !important;
}

/* Light Theme - Symbol Buttons */
body.theme-bw .symbol-btn {
    background-color: #F1F5F9 !important;
    border-color: #CBD5E1 !important;
    color: #475569 !important;
}

body.theme-bw .symbol-btn:hover {
    background-color: #E2E8F0 !important;
    border-color: #94A3B8 !important;
    color: #1E293B !important;
}

body.theme-bw .symbol-btn.active {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    color: #FFFFFF !important;
    border-color: #3B82F6 !important;
}

/* Light Theme - Current Symbol Badge */
body.theme-bw .current-symbol-badge {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Light Theme - Tabs */
body.theme-bw .reports-tabs-hidden-nav .tab-content {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

/* Light Theme - Markdown Content */
body.theme-bw .enhanced-markdown-content {
    background: #FFFFFF !important;
    border-color: #E2E8F0 !important;
    color: #1E293B !important;
}

/* Light Theme - Progress Bars */
body.theme-bw .progress {
    background-color: #E2E8F0;
}

body.theme-bw .progress-bar {
    background-color: #3B82F6;
}

/* Light Theme - Buttons */
body.theme-bw .btn-success {
    background-color: #10B981;
    border-color: #10B981;
    color: #FFFFFF;
}

body.theme-bw .btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: #FFFFFF;
}

body.theme-bw .btn-danger {
    background-color: #EF4444;
    border-color: #EF4444;
    color: #FFFFFF;
}

body.theme-bw .btn-outline-secondary {
    border-color: #CBD5E1;
    color: #475569;
}

body.theme-bw .btn-outline-secondary:hover {
    background-color: #F1F5F9;
    border-color: #94A3B8;
    color: #1E293B;
}

/* Light Theme - Account Bar */
body.theme-bw .compact-account-bar {
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
    border-color: #E2E8F0;
}

body.theme-bw .account-stat-card {
    background: #FFFFFF;
    border-color: #E2E8F0;
}

/* Light Theme - Chart Panel */
body.theme-bw .chart-card {
    background-color: #FFFFFF;
    border-color: #E2E8F0;
}

/* Light Theme - Trading Panel */
body.theme-bw .trading-panel-card {
    background-color: #FFFFFF;
    border-color: #E2E8F0;
}

/* Light Theme - Signal Card */
body.theme-bw .signal-card {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

/* Light Theme - Text Colors */
body.theme-bw .text-muted {
    color: #64748B !important;
}

body.theme-bw .text-success {
    color: #10B981 !important;
}

body.theme-bw .text-danger {
    color: #EF4444 !important;
}

body.theme-bw .text-warning {
    color: #F59E0B !important;
}

body.theme-bw .text-primary {
    color: #3B82F6 !important;
}

body.theme-bw h1, body.theme-bw h2, body.theme-bw h3,
body.theme-bw h4, body.theme-bw h5, body.theme-bw h6 {
    color: #1E293B;
}

body.theme-bw p, body.theme-bw span, body.theme-bw div {
    color: inherit;
}

/* Light Theme - Select/Dropdown */
body.theme-bw .form-select,
body.theme-bw select {
    background-color: #FFFFFF;
    border-color: #CBD5E1;
    color: #1E293B;
}

/* Light Theme - Checklist/Radio */
body.theme-bw .form-check-input:checked {
    background-color: #3B82F6;
    border-color: #3B82F6;
}

body.theme-bw .form-check-label {
    color: #1E293B;
}

/* Light Theme - Collapsible Headers */
body.theme-bw .card-header[style*="cursor: pointer"] {
    background-color: #F8FAFC;
}

body.theme-bw .card-header[style*="cursor: pointer"]:hover {
    background-color: #F1F5F9;
}

/* Light Theme - Scrollbars */
body.theme-bw ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.theme-bw ::-webkit-scrollbar-track {
    background: #F1F5F9;
}

body.theme-bw ::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

body.theme-bw ::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Light Theme - Symbol Navigation Row */
body.theme-bw .symbol-nav-row {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-color: #E2E8F0;
}

/* Light Theme - Modals */
body.theme-bw .modal-content {
    background-color: #FFFFFF;
    border-color: #E2E8F0;
}

body.theme-bw .modal-header {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
    color: #1E293B;
}

body.theme-bw .modal-footer {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
}

/* Light Theme - Tables */
body.theme-bw .table {
    color: #1E293B;
}

body.theme-bw .table thead th {
    background-color: #F8FAFC;
    color: #475569;
    border-color: #E2E8F0;
}

body.theme-bw .table td {
    border-color: #E2E8F0;
}

/* Light Theme - Alerts */
body.theme-bw .alert {
    border-width: 1px;
}

/* Light Theme - Settings Card */
body.theme-bw .settings-card {
    background-color: #F8FAFC;
    border-color: #E2E8F0;
}

/* Light Theme - Nav Tabs */
body.theme-bw .nav-tabs {
    border-color: #E2E8F0;
}

body.theme-bw .nav-tabs .nav-link {
    color: #64748B;
}

body.theme-bw .nav-tabs .nav-link.active {
    color: #1E293B;
    background-color: #FFFFFF;
    border-color: #E2E8F0 #E2E8F0 #FFFFFF;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WATCHLIST STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.watchlist-panel {
    max-height: 300px;
    overflow-y: auto;
}

.watchlist-input {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

.watchlist-add-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.watchlist-items-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.watchlist-empty-msg {
    font-style: italic;
}

.watchlist-item {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.watchlist-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.watchlist-symbol {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.watchlist-price {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.watchlist-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.watchlist-action-btn {
    padding: 2px 6px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.watchlist-action-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.watchlist-action-btn.text-danger:hover {
    color: var(--accent-danger) !important;
}

/* Light theme adjustments */
body.theme-bw .watchlist-item {
    background: #F8FAFC;
    border-color: #E2E8F0;
}

body.theme-bw .watchlist-item:hover {
    background: #F1F5F9;
    border-color: #3B82F6;
}

body.theme-bw .watchlist-input {
    background-color: #FFFFFF;
    border-color: #CBD5E1;
    color: #1E293B;
}

body.theme-bw .watchlist-symbol,
body.theme-bw .watchlist-price {
    color: #1E293B;
}

body.theme-bw .watchlist-action-btn {
    color: #64748B;
}

body.theme-bw .watchlist-action-btn:hover {
    color: #3B82F6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UX ENHANCEMENTS - Settings Summary, Agent Summary, Toast
   ═══════════════════════════════════════════════════════════════════════════ */

/* Active Settings Summary Row */
.active-settings-row {
    padding: 6px 10px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.active-settings-row .badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 8px;
}

/* Agent Quick Summary Container */
.agent-quick-summary-container {
    min-height: 40px;
}

.agent-summary-content {
    font-size: 0.85rem;
    line-height: 1.4;
}

.agent-summary-content i {
    font-size: 0.75rem;
    width: 16px;
}

/* Toast Notification Styling */
#analysis-toast {
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

#analysis-toast .toast-header {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

#analysis-toast .toast-body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Light theme adjustments */
body.theme-bw .active-settings-row {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}

body.theme-bw .agent-summary-content {
    background: rgba(59, 130, 246, 0.05) !important;
    border-color: rgba(59, 130, 246, 0.15) !important;
}

body.theme-bw #analysis-toast {
    border-color: #CBD5E1;
}

body.theme-bw #analysis-toast .toast-header {
    background: #F8FAFC;
    color: #1E293B;
    border-bottom-color: #E2E8F0;
}

body.theme-bw #analysis-toast .toast-body {
    background: #FFFFFF;
    color: #1E293B;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CLICKABLE SYMBOL LINKS - Positions & Orders Tables
   ═══════════════════════════════════════════════════════════════════════════ */

.symbol-link {
    text-decoration: none;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.symbol-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.symbol-link .symbol-text {
    color: inherit;
}

/* Light theme adjustments */
body.theme-bw .symbol-link {
    color: #2563EB;
}

body.theme-bw .symbol-link:hover {
    color: #1D4ED8;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HISTORY SELECTOR - Analysis History Feature
   ═══════════════════════════════════════════════════════════════════════════ */

.history-row {
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.history-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    max-width: 300px;
}

.history-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

#save-history-btn,
#refresh-history-btn {
    font-size: 0.75rem;
}

/* Light theme adjustments */
body.theme-bw .history-row {
    background: rgba(59, 130, 246, 0.03);
    border-color: rgba(59, 130, 246, 0.15);
}

body.theme-bw .history-select {
    background: #FFFFFF;
    border-color: #CBD5E1;
    color: #1E293B;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOG PANEL - Real-time Application Logs
   ═══════════════════════════════════════════════════════════════════════════ */

.log-panel-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.log-panel-card .card-header {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
}

.log-panel-card .card-body {
    background: var(--bg-secondary);
    padding: 8px !important;
}

.log-container {
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Consolas', monospace !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    background: #0D1117 !important;
    border-radius: 6px;
    scrollbar-width: thin;
    scrollbar-color: #3B82F6 #1E293B;
}

.log-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #1E293B;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #3B82F6;
}

.log-entry {
    padding: 1px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.2);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Log Level Colors */
.log-level-debug { color: #6B7280; }
.log-level-info { color: #3B82F6; }
.log-level-warning { color: #F59E0B; }
.log-level-error { color: #EF4444; font-weight: 600; }
.log-level-critical { color: #EF4444; font-weight: 700; background: rgba(239, 68, 68, 0.1); }

/* Log Panel Controls */
#log-level-filter {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
    font-size: 0.75rem;
}

#log-auto-scroll .form-check-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

#clear-logs-btn {
    padding: 4px 8px;
}

#log-panel-toggle {
    padding: 4px 8px;
}

#log-count-badge {
    font-size: 0.7rem;
    padding: 3px 6px;
}

/* Light theme adjustments */
body.theme-bw .log-panel-card {
    border-color: #E2E8F0;
}

body.theme-bw .log-panel-card .card-header {
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
    border-color: #E2E8F0;
}

body.theme-bw .log-panel-card .card-body {
    background: #FFFFFF;
}

body.theme-bw .log-container {
    background: #F8FAFC !important;
    color: #1E293B !important;
    border: 1px solid #E2E8F0;
}

body.theme-bw .log-entry {
    border-color: rgba(203, 213, 225, 0.3);
}

body.theme-bw .log-entry:hover {
    background: rgba(59, 130, 246, 0.05);
}

body.theme-bw #log-level-filter {
    background: #FFFFFF;
    border-color: #CBD5E1;
    color: #1E293B;
}

body.theme-bw #log-auto-scroll .form-check-label {
    color: #64748B;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WATCHLIST DRAG & DROP STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.watchlist-item {
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.watchlist-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    background: var(--bg-tertiary);
}

.watchlist-item.drag-over {
    border-top: 2px solid var(--accent-primary);
    padding-top: 6px;
}

.watchlist-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    margin-right: 8px;
    opacity: 0.5;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.watchlist-item:hover .watchlist-drag-handle {
    opacity: 1;
}

.watchlist-drag-handle:hover {
    color: var(--accent-primary);
}

/* Light theme drag and drop adjustments */
body.theme-bw .watchlist-item.dragging {
    background: #E2E8F0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.theme-bw .watchlist-item.drag-over {
    border-top-color: #3B82F6;
}

body.theme-bw .watchlist-drag-handle {
    color: #94A3B8;
}

body.theme-bw .watchlist-drag-handle:hover {
    color: #3B82F6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RUN QUEUE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.run-watchlist-panel {
    max-height: 300px;
    overflow-y: auto;
}

.run-watchlist-items-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.run-watchlist-empty-msg {
    font-style: italic;
}

.run-watchlist-item {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-secondary);
    transition: all 0.2s ease;
}

.run-watchlist-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-secondary);
}

.run-watchlist-symbol {
    font-size: 1rem;
    color: var(--text-primary);
}

.run-watchlist-remove-btn {
    opacity: 0.6;
    transition: all 0.2s ease;
}

.run-watchlist-remove-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Run Queue Status in Config Panel */
.run-queue-status-container {
    background: rgba(16, 185, 129, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.run-queue-status {
    font-size: 1rem;
}

/* Watchlist Tabs Styling */
.watchlist-tabs .nav-tabs {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.watchlist-tabs .nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-radius: 4px 4px 0 0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.watchlist-tabs .nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.1);
}

.watchlist-tabs .nav-tabs .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--accent-primary);
}

/* Light theme Run Queue adjustments */
body.theme-bw .run-watchlist-item {
    background: #F8FAFC;
    border-color: #E2E8F0;
    border-left-color: #10B981;
}

body.theme-bw .run-watchlist-item:hover {
    background: #F1F5F9;
    border-color: #10B981;
}

body.theme-bw .run-watchlist-symbol {
    color: #1E293B;
}

body.theme-bw .run-queue-status-container {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
}

body.theme-bw .watchlist-tabs .nav-tabs {
    border-color: #E2E8F0;
}

body.theme-bw .watchlist-tabs .nav-tabs .nav-link {
    color: #64748B;
}

body.theme-bw .watchlist-tabs .nav-tabs .nav-link:hover {
    color: #1E293B;
}

body.theme-bw .watchlist-tabs .nav-tabs .nav-link.active {
    color: #1E293B;
    background: #F1F5F9;
    border-bottom-color: #3B82F6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRADINGVIEW LIGHTWEIGHT CHARTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Main chart container */
.tradingview-chart {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#tv-chart-container {
    min-height: 460px;
    width: 100%;
    background-color: #1E293B;
}

/* Light theme chart container */
body.theme-bw #tv-chart-container {
    background-color: #FFFFFF;
}

body.theme-bw .tradingview-chart {
    border-color: #CBD5E1;
}

/* Chart loading state */
.tradingview-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(59, 130, 246, 0.1),
        transparent
    );
    animation: chartShimmer 1.5s infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tradingview-chart.loading::before {
    opacity: 1;
}

@keyframes chartShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Chart hover effects */
.tradingview-chart:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

body.theme-bw .tradingview-chart:hover {
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Responsive chart sizing */
@media (max-width: 768px) {
    #tv-chart-container {
        min-height: 345px;
        height: 400px;
    }

    .tradingview-chart {
        border-radius: 6px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    #tv-chart-container {
        height: 520px;
    }
}

@media (min-width: 1201px) {
    #tv-chart-container {
        height: 575px;
    }
}

/* Chart legend styling override */
.tv-lightweight-charts .tv-lightweight-charts--legend {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Ensure chart takes full width of parent */
.tv-lightweight-charts {
    width: 100% !important;
}

/* Indicator pane styling */
.tradingview-indicator-pane {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 6px 6px;
    border: 1px solid var(--border-color);
    border-top: none;
    background-color: var(--bg-secondary);
    margin-top: -1px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#tv-rsi-container,
#tv-macd-container,
#tv-obv-container {
    width: 100%;
    background-color: #1E293B;
}

/* First indicator pane gets special border treatment */
.tradingview-chart + .tradingview-indicator-pane {
    border-radius: 0;
}

/* Last visible indicator pane gets bottom border radius */
.tradingview-indicator-pane:last-of-type {
    border-radius: 0 0 8px 8px;
}

/* Light theme indicator panes */
body.theme-bw .tradingview-indicator-pane {
    border-color: #CBD5E1;
}

body.theme-bw #tv-rsi-container,
body.theme-bw #tv-macd-container,
body.theme-bw #tv-obv-container {
    background-color: #FFFFFF;
}

/* Indicator pane labels */
.tradingview-indicator-pane::after {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 10;
}

#tv-rsi-container::after {
    content: 'RSI (14)';
    color: #7c4dff;
}

#tv-macd-container::after {
    content: 'MACD (12/26/9)';
    color: #2196f3;
}

#tv-obv-container::after {
    content: 'OBV';
    color: #06b6d4;
}

/* Responsive indicator pane sizing */
@media (max-width: 768px) {
    #tv-rsi-container,
    #tv-macd-container,
    #tv-obv-container {
        height: 100px;
    }
}

@media (min-width: 769px) {
    #tv-rsi-container,
    #tv-macd-container,
    #tv-obv-container {
        height: 120px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHART FULLSCREEN MODE
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fullscreen wrapper */
.chart-fullscreen-wrapper {
    position: relative;
    transition: all 0.3s ease;
}

/* Fullscreen header (hidden by default) */
.fullscreen-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    border-bottom: 1px solid #334155;
}

.fullscreen-symbol {
    font-size: 1.5rem;
    font-weight: 700;
    color: #F1F5F9;
}

.exit-fullscreen-btn {
    font-size: 1.2rem;
    padding: 4px 12px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.exit-fullscreen-btn:hover {
    opacity: 1;
}

/* Fullscreen button styling */
#chart-fullscreen-btn {
    font-size: 1.1rem;
    padding: 4px 10px;
    transition: all 0.2s ease;
}

#chart-fullscreen-btn:hover {
    transform: scale(1.1);
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Active fullscreen state */
.chart-fullscreen-wrapper.is-fullscreen {
    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;
    background-color: #0F172A;
    display: flex;
    flex-direction: column;
    border-radius: 0 !important;
}

.chart-fullscreen-wrapper.is-fullscreen .fullscreen-header {
    display: flex;
}

/* Main chart takes remaining space in fullscreen */
.chart-fullscreen-wrapper.is-fullscreen #tv-chart-container {
    flex: 1;
    height: auto !important;
    min-height: 0 !important;
    border-radius: 0;
}

/* Indicator panes in fullscreen */
.chart-fullscreen-wrapper.is-fullscreen .tradingview-indicator-pane {
    height: 150px !important;
    border-radius: 0;
    flex-shrink: 0;
}

.chart-fullscreen-wrapper.is-fullscreen .tradingview-chart {
    border-radius: 0;
    border: none;
}

/* Hide body scroll when fullscreen is active */
body.chart-fullscreen-active {
    overflow: hidden !important;
}

/* Light theme fullscreen */
body.theme-bw .chart-fullscreen-wrapper.is-fullscreen {
    background-color: #F8FAFC;
}

body.theme-bw .fullscreen-header {
    background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 100%);
    border-bottom-color: #CBD5E1;
}

body.theme-bw .fullscreen-symbol {
    color: #1E293B;
}

/* Fullscreen mode responsive adjustments */
@media (max-width: 768px) {
    .chart-fullscreen-wrapper.is-fullscreen .tradingview-indicator-pane {
        height: 120px !important;
    }

    .fullscreen-symbol {
        font-size: 1.2rem;
    }

    .fullscreen-header {
        padding: 8px 12px;
    }
}
