/* Professional Stock Chart Styles */
.chart-container {
    width: 100%;
    background-color: var(--ga-color-surface);
    /*border-radius: 5px;*/
    /*box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);*/
    padding: 10px;
    margin-bottom: 20px;
}

/* Chart Wrapper */
.chart-wrapper {
    position: relative;
    width: 100%;
    background-color: var(--ga-color-surface);
    border-radius: var(--ga-radius-md);
    overflow: hidden;
}

/* Adjusted chart height for sidebar layout */
.main-analysis-container .stock-chart {
    width: 100% !important;
    height: 700px !important; /* Reduced from 850px to work better with sidebar */
    min-height: 500px;
}

/* Fallback for pages without sidebar */
.stock-chart {
    width: 100%;
    height: 850px;
    min-height: 500px;
}

/* Chart Controls Section */
.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--ga-color-border-soft);
}

/* Toggle Switch Styles */
.chart-toggle {
    display: flex;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 8px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--ga-color-primary-legacy);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--ga-color-primary-legacy);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.toggle-label {
    font-size: 0.9rem;
    color: #2C3E50;
    font-weight: 500;
}

/* Download Button Styles */
.download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: var(--ga-color-primary-legacy);
    color: white;
    border: none;
    border-radius: var(--ga-radius-sm);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.download-btn:hover {
    background-color: var(--ga-color-primary-hover);
}

.download-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    /* Mobile chart heights - sidebar layout */
    .main-analysis-container .stock-chart {
        height: 350px !important;
        min-height: 350px;
    }

    /* Fallback for pages without sidebar */
    .stock-chart {
        height: 600px;
        min-height: 300px;
    }

    .chart-container {
        width: 100%;
        background-color: var(--ga-color-surface);
        padding: 2px;
        margin-bottom: 20px;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    }

    .chart-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-toggle, .download-btn {
        width: 100%;
    }

    .download-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* Mobile chart heights - sidebar layout */
    .main-analysis-container .stock-chart {
        height: 280px !important;
        min-height: 280px;
    }

    /* Fallback for pages without sidebar */
    .stock-chart {
        height: 450px;
        min-height: 250px;
    }
}
