* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #0d1117;
    --bg-panel: #161b22;
    --bg-hover: #21262d;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --green: #3fb950;
    --red: #f85149;
    --blue: #58a6ff;
    --orange: #d29922;
    --blink-green: #00ff88;
    --blink-red: #ff4757;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.dashboard {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.logo-icon {
    font-size: 22px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#refresh-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

#refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pair-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.pair-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.pair-item:hover {
    background: var(--bg-hover);
}

.pair-item.active {
    background: rgba(88, 166, 255, 0.12);
    border-color: var(--blue);
}

.pair-name {
    font-weight: 600;
    font-size: 15px;
}

.pair-signal {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.pair-signal.none {
    color: var(--text-secondary);
    background: transparent;
}

.pair-signal.bullish {
    background: rgba(63, 185, 80, 0.2);
    color: var(--green);
}

.pair-signal.bearish {
    background: rgba(248, 81, 73, 0.2);
    color: var(--red);
}

/* Blinking animation */
.pair-item.blink-bullish {
    animation: blinkGreen 0.6s ease-in-out infinite;
    border-color: var(--blink-green);
}

.pair-item.blink-bearish {
    animation: blinkRed 0.6s ease-in-out infinite;
    border-color: var(--blink-red);
}

@keyframes blinkGreen {
    0%, 100% { background: rgba(0, 255, 136, 0.15); box-shadow: 0 0 12px rgba(0, 255, 136, 0.3); }
    50% { background: rgba(0, 255, 136, 0.35); box-shadow: 0 0 20px rgba(0, 255, 136, 0.5); }
}

@keyframes blinkRed {
    0%, 100% { background: rgba(255, 71, 87, 0.15); box-shadow: 0 0 12px rgba(255, 71, 87, 0.3); }
    50% { background: rgba(255, 71, 87, 0.35); box-shadow: 0 0 20px rgba(255, 71, 87, 0.5); }
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

/* Chart Area */
.chart-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
    overflow: hidden;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.chart-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.timeframe-btns {
    display: flex;
    gap: 6px;
}

.tf-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.tf-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tf-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.tv-chart-container {
    flex: 1;
    min-height: 400px;
}

/* Instructions Panel */
.instructions-panel {
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    max-height: 220px;
    overflow-y: auto;
}

.instruction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.instruction-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-weight: 500;
}

.badge.bullish {
    background: rgba(63, 185, 80, 0.2);
    color: var(--green);
}

.badge.bearish {
    background: rgba(248, 81, 73, 0.2);
    color: var(--red);
}

.instruction-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.instruction-body p {
    margin-bottom: 8px;
}

.instruction-body ul {
    margin-left: 18px;
    margin-top: 8px;
}

.instruction-body li {
    margin-bottom: 4px;
}

.long {
    color: var(--green);
    font-weight: 700;
}

.short {
    color: var(--red);
    font-weight: 700;
}

.signal-box {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
}

.signal-box.bullish {
    border-left: 4px solid var(--green);
}

.signal-box.bearish {
    border-left: 4px solid var(--red);
}

.signal-box h4 {
    margin-bottom: 6px;
    font-size: 14px;
}

.signal-box p {
    font-size: 13px;
    margin: 0;
}

/* Scrollbar */
.pair-list::-webkit-scrollbar,
.instructions-panel::-webkit-scrollbar {
    width: 6px;
}

.pair-list::-webkit-scrollbar-track,
.instructions-panel::-webkit-scrollbar-track {
    background: transparent;
}

.pair-list::-webkit-scrollbar-thumb,
.instructions-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        width: 220px;
    }
}