/* BCD Chart Core - Shared Styles */

/* Base wrapper for frontend chart */
.bcd-frontend-chart {
    width: 100%;
    max-width: 100%;
    position: relative;
}

.bcd-chart-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    position: relative;
}

.bcd-y-axis-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: stretch;
}

.chart-container {
    position: relative;
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

#myChart, #bcdChart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: calc(100% - 30px) !important;
}

.custom-x-axis {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    overflow-x: hidden;
}

.custom-x-axis-frontend {
    bottom: -30px;
    left: 25px;
}

.custom-x-axis-label {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

/* ========== Dropdown Styles ========== */
.bcd-dropdown-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.bcd-dropdown-wrapper {
    display: inline-flex;
    flex-direction: column;
    flex: 0 0 auto; /* Don't grow or shrink - size to content */
}

.bcd-dropdown-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    white-space: nowrap; /* Label determines width */
}

.bcd-dropdown-select {
    width: 100%; /* Match wrapper width (set by label) */
    min-width: 0; /* Allow shrinking below intrinsic width */
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23495057'/%3E%3C/svg%3E") no-repeat right 0.5rem center/10px 6px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    text-overflow: ellipsis;
    overflow: hidden;
}

.bcd-dropdown-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* ========== Legend ========== */
.bcd-legend {
    text-align: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
}

.bcd-legend-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ========== Notifications ========== */
#bcd-notification {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 20px 40px;
    font-size: 18px;
    font-weight: 700;
    background: #2196f3;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    opacity: 0;
    z-index: 10000;
    transition: opacity 0.25s;
    pointer-events: none;
}

#bcd-notification.visible { 
    opacity: 1; 
}

.bcd-chart-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    background: rgba(33, 150, 243, 0.95);
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    opacity: 0;
    z-index: 100;
    transition: opacity 0.25s ease;
    pointer-events: none;
    white-space: nowrap;
}

.bcd-chart-notification.visible {
    opacity: 1;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .bcd-dropdown-container { 
        flex-direction: column; 
    }
    .bcd-dropdown-wrapper { 
        width: 100%;
        flex: 1 1 100%;
    }
    .bcd-chart-wrapper { 
        flex-direction: column; 
    }
    .bcd-y-axis-label { 
        writing-mode: horizontal-tb; 
        transform: none; 
        padding: 8px 0; 
        text-align: center; 
    }
    .chart-container { 
        min-height: 300px; 
    }
    .bcd-chart-notification {
        padding: 12px 24px;
        font-size: 14px;
    }
}