:root {
    --bg-color: #080809;
    --card-bg: #111114;
    --border-color: #1f1f23;
    --text-primary: #ffffff;
    --text-secondary: #88888e;
    --accent: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --card-radius: 12px;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header & Controls */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    gap: 20px;
    width: 100%;
}

.brand {
    flex: 1;
    min-width: 0; /* Чтобы текст не распирал контейнер */
}

.brand h1 {
    font-size: clamp(1.2rem, 4vw, 1.5rem); /* Адаптивный размер заголовка */
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* Custom Dropdown */
.custom-dropdown {
    position: relative;
    width: 220px;
    user-select: none;
    z-index: 1000;
}

.dropdown-trigger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: inset 0 0 0 rgba(255, 255, 255, 0);
}

.dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.05);
}

.dropdown-trigger:active {
    transform: translateY(0) scale(0.98);
}

.dropdown-trigger span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.dropdown-trigger:hover span {
    color: #fff;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.04); /* Еще прозрачнее */
    backdrop-filter: blur(30px) saturate(210%);
    -webkit-backdrop-filter: blur(30px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        inset 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateY(-10px) scale(0.97);
    transform-origin: top center;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 1001;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-option {
    padding: 10px 16px;
    margin: 2px 0;
    border-radius: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateX(4px);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.dropdown-option.selected {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

/* Charts Grid */
.charts-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.chart-container {
    background: rgba(17, 17, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--card-radius);
    padding: clamp(16px, 3vw, 24px);
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    backdrop-filter: blur(40px) saturate(180%); /* Еще сильнее размытие и сочность */
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.chart-info {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.legend-item.hidden {
    opacity: 0.35;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.chart-info i {
    width: 16px;
    height: 16px;
}

.chart-info span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.current-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.canvas-wrapper {
    height: 280px;
    width: 100%;
    position: relative;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    .controls {
        width: 100%;
    }
    .custom-dropdown {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 24px 16px;
    }
    .chart-container {
        padding: 16px;
    }
    .chart-header {
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 16px;
    }
    .chart-info {
        flex: 1 1 auto;
    }
    .chart-legend {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
        position: static;
        transform: none;
    }
    .canvas-wrapper {
        height: 240px; /* Чуть меньше для экономии места на экране */
    }
    .brand h1 {
        white-space: normal;
    }
}
.chart-cursor-line, .dots-x-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.2s ease;
}

.chart-cursor-line {
    border-left: 1px dashed rgba(255, 255, 255, 0.3);
}

.chart-cursor-line.visible, .dots-x-slider.visible {
    opacity: 1;
}

.floating-dot {
    position: absolute;
    left: -4px; /* Центрируем по линии */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #fff;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    transition: transform 0.15s cubic-bezier(0.23, 1, 0.32, 1); /* Только вертикальное движение */
}

.chart-info i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.dropdown-trigger i {
    width: 14px; /* Уменьшил с 16px */
    height: 14px;
    color: var(--text-secondary); /* Приглушенный цвет */
    display: flex;
    align-items: center;
}

.dropdown-trigger .chevron-icon {
    transition: transform 0.3s ease;
}

.custom-dropdown.open .chevron-icon {
    transform: rotate(180deg);
}
.custom-tooltip {
    position: fixed;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 1px solid rgba(255, 255, 255, 0.25); /* Световой блик сверху */
    border-radius: 14px;
    padding: 12px 18px;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    line-height: 1.7;
    z-index: 9999;
    opacity: 0;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 40px -8px rgba(0, 0, 0, 0.6),
        inset 0 0 12px rgba(255, 255, 255, 0.02); /* Внутреннее свечение */
    transition: transform 0.1s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.2s ease;
    text-align: left;
}

.custom-tooltip.visible {
    opacity: 1;
}

.custom-tooltip .row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.custom-tooltip .label { 
    color: rgba(255, 255, 255, 0.5); 
    font-weight: 500;
}

.custom-tooltip .value { 
    color: #ffffff; 
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}
