

/* Unified container for the chart and its tools */
.chart-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}
.chart-section {
  height: 350px;
}
/* Row logic: Side-by-side on desktop, stacked on mobile */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.chart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.range-group {
    background: var(--table-header);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    gap: 2px;
}

.range-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.range-btn.active {
    background: var(--card-bg);
    color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* MOBILE VIEW: Only stack on separate rows here */
@media (max-width: 600px) {
    .chart-header {
        flex-direction: column; /* This creates the separate rows */
        align-items: flex-start; /* Aligns title and buttons to the left */
        gap: 12px; /* Space between the title row and the button row */
    }

  .chart-section {
    height: 250px;
  }
    .range-group {
        width: 100%; /* Stretch buttons to fill the width of the row */
    }

    .range-btn {
        flex: 1; /* Make all buttons equal width on mobile */
        text-align: center;
    }
}

.navigator-container {
    height: 60px; /* Short height like Highcharts */
    width: 100%;
    margin-top: 10px;
    position: relative;
    border-top: 1px solid var(--border-color);
}
.navigator-container {
    height: 60px;
    width: 100%;
    margin-top: 15px;
    position: relative;
    background: var(--table-header); /* Slightly darker than card bg */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden; /* Clips the chart edges for a clean look */
    user-select: none; /* Prevents text selection while dragging */
}

/* Add a "Track" feel */
.navigator-container::before {
    content: "DRAG TO EXPLORE";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    opacity: 0.2;
    letter-spacing: 2px;
    pointer-events: none;
}
#chartNavigator, #marketCapChart {
    touch-action: none; /* Prevents the browser from handling touch (scrolling/zooming) */
    -webkit-user-select: none; /* Prevents text selection during drag */
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* Removes the grey flicker on tap */
}
