:root {
    --color-primary: #DA291C;
    --color-primary-hover: #B82318;
    --color-primary-active: #9A1E14;
    --color-primary-light: rgba(218, 41, 28, 0.1);
    --color-primary-border: rgba(218, 41, 28, 0.2);
}

body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ============================================
   Filter Section Toggle
   ============================================ */

.filter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.filter-content.expanded {
    max-height: 600px;
}

.filter-toggle-icon {
    transition: transform 0.3s ease-in-out;
}

.filter-toggle-icon.rotated {
    transform: rotate(180deg);
}


/* ============================================
   Multiselect Component
   ============================================ */

.multiselect-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.multiselect-trigger:hover {
    border-color: #9ca3af;
}

.multiselect-trigger:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.multiselect-placeholder {
    color: #9ca3af;
    font-size: 0.8125rem;
}

.multiselect-dropdown {
    position: absolute;
    z-index: 30;
    width: 100%;
    margin-top: 4px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #374151;
    transition: background-color 0.1s ease;
}

.multiselect-option:hover {
    background-color: #f9fafb;
}

.multiselect-option input[type="checkbox"] {
    accent-color: var(--color-primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
    border-radius: 3px;
}


/* ============================================
   Chips
   ============================================ */

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid var(--color-primary-border);
    line-height: 1.4;
}

.chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.chip-remove:hover {
    opacity: 1;
}

.chip-remove .material-icons {
    font-size: 14px;
}


/* ============================================
   Loading Spinner
   ============================================ */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================
   Chart Container
   ============================================ */

.js-plotly-plot {
    width: 100% !important;
}

.js-plotly-plot .plotly .modebar {
    top: 4px !important;
    right: 4px !important;
}


/* ============================================
   Error State
   ============================================ */

.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #6b7280;
}

.chart-error .material-icons {
    font-size: 48px;
    margin-bottom: 8px;
    color: #d1d5db;
}

.chart-error p {
    margin: 2px 0;
    font-size: 0.875rem;
}

.chart-error .error-detail {
    font-size: 0.75rem;
    color: #9ca3af;
}


/* ============================================
   Scrollbar Styling
   ============================================ */

.multiselect-dropdown::-webkit-scrollbar {
    width: 6px;
}

.multiselect-dropdown::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.multiselect-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
