/* 
 * BinTrade Chart Control v1.0 
 * Premium Styling
 */

:root {
    --bg-color: #0d0e12;
    --chart-bg: #131722;
    --text-primary: #d1d4dc;
    --text-secondary: #787b86;
    --border-color: #2a2e39;
    --bull-color: #089981;
    --bear-color: #f23645;
    --bull-color-fade: rgba(8, 153, 129, 0.2);
    --bear-color-fade: rgba(242, 54, 69, 0.2);
    --accent-color: #2962ff;
    --crosshair-color: rgba(120, 123, 134, 0.5);
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chart-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--chart-bg);
    gap: 16px;
    z-index: 10;
}

.timeframe-bar {
    display: flex;
    gap: 4px;
    background: rgba(42, 46, 57, 0.4);
    padding: 2px;
    border-radius: 4px;
}

.tf-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.tf-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tf-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.symbol-name {
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.price-info {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.price-change {
    font-weight: 500;
}

.price-change.up { color: var(--bull-color); }
.price-change.down { color: var(--bear-color); }

.chart-container {
    flex: 1;
    position: relative;
    background-color: var(--chart-bg);
    cursor: crosshair;
    user-select: none;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.controls {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.btn {
    background: rgba(42, 46, 57, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.indicator-label {
    position: absolute;
    top: 60px;
    left: 16px;
    z-index: 5;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(19, 23, 34, 0.7);
    padding: 2px 6px;
    border-radius: 2px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.overlay-info {
    position: absolute;
    top: 10px;
    left: 16px;
    z-index: 5;
    font-family: monospace;
    font-size: 11px;
    color: var(--text-secondary);
    pointer-events: none;
}

.side-toolbar {
    width: 38px;
    height: 100%;
    background: var(--chart-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
}
.side-toolbar::-webkit-scrollbar {
    width: 3px;
}
.side-toolbar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.tool-btn {
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.tool-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tool-btn.active {
    color: var(--accent-color);
}
