body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 20px;
    background: #000000;
    color: #e0e0e0;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: auto !important;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 2px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.3;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(180deg, rgba(30, 34, 45, 0.8) 0%, rgba(19, 23, 34, 0) 100%);
    border-radius: 0 0 30px 30px;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.accent {
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.ai-vibe {
    animation: pulse-glow 3s infinite ease-in-out;
    display: inline-block;
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px rgba(0, 255, 65, 0.4));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px rgba(0, 255, 65, 0.8));
    }
}

.header-subtitle {
    color: #888;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    margin-top: 5px;
    letter-spacing: 0.5px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.symbols-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
}

.symbol-card {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 25px;
    border: 1px solid rgba(0, 255, 65, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 255, 65, 0.02);
    height: 900px;
    /* Enforced uniform height */
    display: flex;
    flex-direction: column;
}

.symbol-card:hover {
    border-color: #00ff41;
    transform: translateY(-8px) scale(1.005);
    box-shadow: 0 20px 60px rgba(0, 255, 65, 0.15), 0 0 20px rgba(0, 255, 65, 0.1);
}

.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 {
    position: relative;
    height: 520px;
    margin-bottom: 20px;
    background: #131722;
    border-radius: 8px;
    border: 1px solid #2a2e39;
    overflow: hidden;
}

/* TradingView widget fills its container */
.chart-container>div {
    width: 100% !important;
    height: 100% !important;
}

.chart-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    border-radius: 8px;
}

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

.candlestick-down {
    background-color: #ff6b6b !important;
    border-color: #ff6b6b !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: #4ade80;
}

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

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

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

.signal-sell {
    color: #ff6b6b;
}

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

.signal-hold {
    color: #ff9800;
}

.signal-error {
    color: #757575;
}

.status-bar {
    background: rgba(30, 34, 45, 0.8);
    backdrop-filter: blur(5px);
    padding: 15px 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'Inter', monospace;
}

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

.status-disconnected {
    color: #ff6b6b;
}

.status-connecting {
    color: #ff9800;
}

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

.system-health {
    display: flex;
    gap: 20px;
    background: #1e222d;
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid #2d2d4d;
}

.health-item {
    font-size: 13px;
    color: #b8b8d0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.health-item span {
    color: #fff;
    font-weight: normal;
}

.uptime-tooltip {
    cursor: help;
    color: #4db8ff;
    font-size: 12px;
    margin-left: 4px;
}

.r-score-high {
    color: #4ade80 !important;
    font-weight: bold !important;
}

.r-score-med {
    color: #ff9800 !important;
    font-weight: bold !important;
}

.r-score-low {
    color: #ff6b6b !important;
    font-weight: bold !important;
}

.r-score-learning {
    color: #888 !important;
    font-style: italic;
}

.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 */
}

.btc {
    color: #f7931a;
}

.sol {
    color: #00c58b;
}

.tao {
    color: #3b82f6;
}

.wif {
    color: #a855f7;
}

/* canvas rules removed — charts are now TradingView iframes */

.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: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    grid-column: 1 / -1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.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);
    gap: 15px;
    width: 100%;
}

/* 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: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center vertically */
    align-items: center;
    /* Center horizontally */
}

.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: 4px;
    width: 100%;
    text-align: center !important;
    /* Force center alignment */
}

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

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

/* Explainer Section */
.explainer-section {
    background: #1e222d;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 30px;
    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: #1e222d;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    /* Blue accent color */
    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;
}

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

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

/* Purple */

.explainer-item h3 {
    margin-top: 0;
    margin-bottom: 12px;
    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;
}

/* Signal detail rows under each timeframe prediction */
.timeframe-signals {
    margin-top: 6px;
    border-top: 1px solid #2d2d4d;
    padding-top: 5px;
}

.signal-detail {
    display: flex;
    justify-content: space-between;
    font-size: 0.72em;
    line-height: 1.7;
    color: #c0c0d8;
}

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

/* ── Accordion explainer ── */
.explainer-hint {
    font-size: 0.55em;
    font-weight: 400;
    color: #5555aa;
    vertical-align: middle;
}

.accordion-item {
    overflow: hidden;
}

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

.accordion-header h3 {
    margin: 0;
}

.accordion-arrow {
    font-size: 1.1em;
    color: #4ade80;
    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: 600px;
    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;
}

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

.scanline {
    width: 100%;
    height: 100px;
    z-index: 10000;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 255, 65, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: fixed;
    bottom: 100%;
    left: 0;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        bottom: 100%;
    }

    100% {
        bottom: -100px;
    }
}

.status-pulse {
    animation: terminal-blink 2s infinite alternate;
}

@keyframes terminal-blink {
    0% {
        opacity: 0.8;
        text-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 15px rgba(0, 255, 65, 0.8);
    }
}

.subtitle-tech {
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    color: #00ff41;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* 👾 AI Terminal Console Styles */
.terminal-container {
    background: #090c10;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 30px;
    font-family: 'Inter', monospace;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-left: 4px solid #00ff41;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.terminal-header {
    background: #161b22;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #30363d;
}

.terminal-title {
    font-size: 0.75rem;
    font-weight: bold;
    color: #8b949e;
}

.terminal-id {
    font-size: 0.65rem;
    color: #00ff41;
    opacity: 0.7;
}

.terminal-body {
    height: 120px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.log-entry {
    font-size: 0.75rem;
    line-height: 1.6;
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.log-time {
    color: #4ade80;
    margin-right: 8px;
}

.log-entry.system {
    color: #8b949e;
    font-style: italic;
}

.log-entry.success {
    color: #3fb950;
    border-left-color: #3fb950;
}

.log-entry.error {
    color: #f85149;
    border-left-color: #f85149;
}

.log-entry.request {
    color: #00ff41;
    border-left-color: #00ff41;
}

.log-entry.prediction {
    color: #d2a8ff;
    border-left-color: #d2a8ff;
}

/* Custom Scrollbar for Terminal */
.terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}