body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #0f0f23;
    color: #e0e0e0;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.symbols-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.symbol-card {
    background: #1a1a2e;
    border-radius: 15px;
    padding: 15px;
    border: 1px solid #2d2d4d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.symbol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2d2d4d;
}

.symbol-name {
    font-size: 24px;
    font-weight: bold;
}

.symbol-price {
    font-size: 28px;
    font-weight: bold;
}

.chart-container {
    height: 250px;
    margin-bottom: 10px;
    position: relative;
}

.chart-container {
    position: relative;
    height: 300px;
    /* Increased height for better visibility */
    margin-bottom: 15px;
    background: #0f0f23;
    border-radius: 8px;
    border: 1px solid #2d2d4d;
}

/* Candlestick colors */
.candlestick-up {
    background-color: #4caf50 !important;
    border-color: #4caf50 !important;
}

.candlestick-down {
    background-color: #f44336 !important;
    border-color: #f44336 !important;
}

/* Zoom controls */
.chartjs-zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

.chartjs-zoom-controls button {
    background: #1a1a2e;
    border: 1px solid #2d2d4d;
    color: #e0e0e0;
    padding: 5px 10px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.chartjs-zoom-controls button:hover {
    background: #2d2d4d;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
}

.analysis-item {
    background: #16213e;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 13px;
}

.analysis-item.signal {
    border-left-color: #ff9800;
}

.analysis-item.confidence {
    border-left-color: #2196f3;
}

.analysis-item.prediction {
    border-left-color: #4caf50;
}

.analysis-item.trend {
    border-left-color: #9c27b0;
}

.signal-buy {
    color: #4caf50;
}

.signal-strong_buy {
    color: #2e7d32;
    font-weight: bold;
}

.signal-sell {
    color: #f44336;
}

.signal-strong_sell {
    color: #c62828;
    font-weight: bold;
}

.signal-hold {
    color: #ff9800;
}

.bullish {
    color: #4ade80 !important;
}

.bearish {
    color: #ff6b6b !important;
}

.signal-error {
    color: #757575;
}


.status-bar {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-connected {
    color: #4caf50;
}

.status-disconnected {
    color: #f44336;
}

.status-connecting {
    color: #ff9800;
}

.last-update {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 0 5px;
    gap: 15px;
    /* Add gap between title and controls */
}

.time-scale-selector {
    background: #16213e;
    border: 1px solid #2d2d4d;
    border-radius: 8px;
    padding: 6px 10px;
    /* Reduced padding */
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
    min-width: 80px;
    /* Reduced from 140px */
    max-width: 100px;
    /* Add max-width */
    text-align: center;
    text-align-last: center;
    -moz-text-align-last: center;
    flex-shrink: 0;
}

.time-scale-selector:hover {
    background: #1a1a2e;
}

.time-scale-selector:focus {
    outline: none;
    border-color: #3b82f6;
}

.chart-title {
    font-size: 14px;
    color: #888;
    font-weight: bold;
    flex-shrink: 0;
    /* Prevent title from shrinking */
}

/* Stock Ticker Colors (Mapped from Crypto themes) */
.spy {
    color: #f7931a;
}

.aapl {
    color: #00c58b;
}

.msft {
    color: #3b82f6;
}

.goog {
    color: #a855f7;
}

/* Legacy mappings for safety */
.btc { color: #f7931a; }
.sol { color: #00c58b; }
.tao { color: #3b82f6; }
.wif { color: #a855f7; }

canvas {
    display: block;
    width: 100% !important;
    height: 200px !important;
}

.analysis-controls {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.analysis-controls button {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.analysis-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 204, 255, 0.3);
}

.analysis-item.weekly-prediction {
    border-left-color: #ff6b6b;
    grid-column: span 2;
    /* Make weekly prediction take full width */
}

/* Optional: Adjust grid for 5 items */
.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    /* 3 columns instead of 2 */
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
}

.refresh-chart-btn {
    background: #16213e;
    border: 1px solid #2d2d4d;
    border-radius: 8px;
    padding: 6px 8px;
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
    margin-left: 5px;
}

.refresh-chart-btn:hover {
    background: #1a1a2e;
    border-color: #3b82f6;
}

.timeframe-predictions {
    margin-top: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    grid-column: 1 / -1;
    margin-left: 25px;
    /* Increase this number to shift more right */
}

.timeframe-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 14px;
    color: #ccc;
    text-align: center;
}

.timeframe-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Changed from 5 to 3 */
    gap: 10px;
    justify-content: center;
}

/* Position the 1D in the 3rd column */
.timeframe-item:nth-child(3) {
    grid-column: 3;
}

/* Position the 1W in the 4th column */
.timeframe-item:nth-child(4) {
    grid-column: 4;
}

/* Position the 1M in the 5th column */
.timeframe-item:nth-child(5) {
    grid-column: 5;
}

.timeframe-item {
    text-align: center;
    padding: 15px; /* Increased from 8px */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.timeframe-signals {
    width: 100%;
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}



.timeframe-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    font-weight: bold;
    width: 100%;
    /* Ensure full width for centering */
    text-align: center !important;
    /* Force center alignment */
}

.timeframe-prediction {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 2px;
    width: 100%;
    text-align: center !important;
    /* Force center alignment */
}

.timeframe-confidence {
    font-size: 12px;
    font-weight: bold;
    color: #4db8ff;
    /* A bright technical blue */
    margin-bottom: 4px;
    width: 100%;
    text-align: center;
}

.timeframe-samples {
    font-size: 11px;
    font-weight: 500;
    color: #8888aa;
    margin-bottom: 6px;
    width: 100%;
    text-align: center;
}


.timeframe-change {
    font-size: 11px;
    font-weight: bold;
    width: 100%;
    text-align: center;
}

/* AI Status & Health */
.ai-status {
    display: flex;
    gap: 25px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-health-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ai-health-label {
    font-size: 10px;
    color: #8888aa;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.ai-health-value {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00d9ff;
    font-weight: bold;
}

.timeframe-wyckoff {
    font-size: 0.75rem; 
    color: #888; 
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.signal-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.72em;
    line-height: 1.7;
    color: #c0c0d8;
    padding: 0 4px;
    white-space: nowrap; /* Prevent wrapping */
}


.signal-label {
    color: #9090b8;
    margin-right: 4px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Accordion explainer ── */
.explainer-section {
    background: #1a1a2e;
    border-radius: 15px;
    padding: 25px;
    margin: 30px auto;
    max-width: 1400px;
    border: 1px solid #2d2d4d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.explainer-section h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    color: #e0e0e0;
    font-size: 24px;
    border-bottom: 1px solid #2d2d4d;
    padding-bottom: 15px;
}

.explainer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.explainer-item {
    background: #16213e;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.explainer-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.explainer-item:nth-child(2) {
    border-left-color: #00c58b;
}

.explainer-item:nth-child(3) {
    border-left-color: #f7931a;
}

.explainer-item:nth-child(4) {
    border-left-color: #a855f7;
}

.explainer-item h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
}

.explainer-item p {
    margin: 0;
    color: #b8b8d0;
    font-size: 14px;
    line-height: 1.6;
}

.explainer-item b {
    color: #ffffff;
}

.accordion-item {
    overflow: hidden;
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 2px 0;
}

.accordion-arrow {
    font-size: 1.1em;
    color: #5555aa;
    transition: transform 0.25s ease;
    display: inline-block;
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
}

.accordion-item.open .accordion-body {
    max-height: 300px;
    padding-top: 8px;
}

.accordion-item.open .accordion-arrow {
    transform: rotate(180deg);
}

.explainer-list {
    margin: 0;
    padding-left: 18px;
    color: #b8b8d0;
    font-size: 14px;
    line-height: 1.7;
    list-style-type: none;
}

.explainer-list li {
    margin-bottom: 6px;
}

.sig-positive {
    color: #4ade80;
    font-weight: bold;
}

.sig-negative {
    color: #ff6b6b;
    font-weight: bold;
}