/**
 * Chart Type Switcher Styles
 * Styles for the modular chart type switching component
 */

/* Chart Type Switcher Container - Base styles */
.chart-type-switcher {
    display: flex;
    gap: 2px;
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 3px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

/* Toolbar mode - inline with other controls */
.chart-type-switcher-toolbar {
    position: relative;
    margin-right: 8px;
}

/* Absolute positioned variants */
.chart-type-switcher-top-left,
.chart-type-switcher-top-right,
.chart-type-switcher-bottom-left,
.chart-type-switcher-bottom-right {
    position: absolute;
}

.chart-type-switcher-top-left {
    top: 10px;
    left: 10px;
}

.chart-type-switcher-top-right {
    top: 10px;
    right: 100px; /* Account for price scale */
}

.chart-type-switcher-bottom-left {
    bottom: 40px;
    left: 10px;
}

.chart-type-switcher-bottom-right {
    bottom: 40px;
    right: 100px;
}

/* Chart Type Button */
.chart-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.chart-type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.chart-type-btn.active {
    background: rgba(0, 200, 83, 0.2);
    color: #00C853;
}

.chart-type-btn.active:hover {
    background: rgba(0, 200, 83, 0.3);
}

.chart-type-btn svg {
    width: 18px;
    height: 18px;
}

/* Tooltip styling (using title attribute) */
.chart-type-btn[title] {
    position: relative;
}

/* Loading state */
.chart-type-switcher.loading .chart-type-btn {
    opacity: 0.5;
    pointer-events: none;
}

/* Compact mode for smaller charts */
.chart-type-switcher.compact {
    padding: 2px;
    gap: 1px;
}

.chart-type-switcher.compact .chart-type-btn {
    width: 26px;
    height: 26px;
}

.chart-type-switcher.compact .chart-type-btn svg {
    width: 14px;
    height: 14px;
}

/* Animation for type change */
@keyframes chart-type-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.chart-type-btn.active {
    animation: chart-type-pulse 0.2s ease-out;
}

/* Separator between buttons */
.chart-type-switcher .separator {
    width: 1px;
    background: #3a3a3a;
    margin: 4px 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chart-type-switcher {
        padding: 2px;
    }

    .chart-type-btn {
        width: 28px;
        height: 28px;
    }

    .chart-type-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Dark theme overrides (already dark by default) */
.chart-type-switcher.theme-light {
    background: rgba(255, 255, 255, 0.95);
    border-color: #ddd;
}

.chart-type-switcher.theme-light .chart-type-btn {
    color: #666;
}

.chart-type-switcher.theme-light .chart-type-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.chart-type-switcher.theme-light .chart-type-btn.active {
    background: rgba(0, 200, 83, 0.15);
    color: #00a844;
}

/* Fullscreen modal adjustments */
.chart-fullscreen-modal .chart-type-switcher {
    top: 60px; /* Below the header */
}

/* Split screen header integration - inside intervals section */
.split-panel-intervals .chart-type-switcher {
    margin-right: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 2px;
}

.split-panel-intervals .chart-type-btn {
    width: 26px;
    height: 26px;
    background: rgba(60, 60, 60, 0.6);
    border-radius: 4px;
}

.split-panel-intervals .chart-type-btn:hover {
    background: rgba(80, 80, 80, 0.8);
}

.split-panel-intervals .chart-type-btn.active {
    background: rgba(0, 200, 83, 0.25);
}

.split-panel-intervals .chart-type-btn svg {
    width: 14px;
    height: 14px;
}

/* Separator after chart type buttons */
.split-panel-intervals .chart-type-switcher::after {
    content: '';
    width: 1px;
    height: 20px;
    background: #444;
    margin-left: 6px;
}

/* Split screen adjustments */
.split-chart-container .chart-type-switcher {
    top: 8px;
    left: 8px;
}

.split-chart-container .chart-type-switcher-top-right {
    right: 90px;
}
