/* Custom styles for Publications Filter */

/* Compact dropdown styling */
.compact-dropdown .Select-control {
    min-height: 36px !important;
    height: 36px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.compact-dropdown .Select-value-label,
.compact-dropdown .Select-input,
.compact-dropdown .Select-placeholder {
    font-size: 13px !important;
    line-height: 1.4;
    padding: 4px 8px;
}

/* Dropdown text overflow handling */
.dash-dropdown .Select-value-label,
.dash-dropdown .Select-menu-outer .Select-option {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Dropdown menu positioning and z-index for overflow */
.dash-dropdown .Select-menu-outer {
    z-index: 1050 !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Dropdown container width */
.dash-dropdown {
    width: 100% !important;
    position: relative;
}

/* Compact year slider styling */
.compact-year-slider {
    margin-top: 8px !important;
    margin-bottom: 20px !important;
}

.compact-year-slider .rc-slider {
    height: 8px;
}

.compact-year-slider .rc-slider-rail {
    height: 6px;
    background-color: #e9ecef;
}

.compact-year-slider .rc-slider-track {
    height: 6px;
    background-color: #007bff;
}

.compact-year-slider .rc-slider-handle {
    width: 16px;
    height: 16px;
    margin-top: -5px;
    border: 2px solid #007bff;
    background-color: #fff;
}

.compact-year-slider .rc-slider-mark-text {
    font-size: 10px !important;
    color: #6c757d;
    margin-top: 5px;
}

/* Filter container improvements */
.publications-filter-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    max-width: 100%;
    overflow: visible;
    position: relative;
    z-index: 10;
}

/* Smooth transitions for filter content */
.publications-filter-section #filter-content {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

/* Filter toggle button styling */
.publications-filter-section .btn-link {
    color: #007bff !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.publications-filter-section .btn-link:hover {
    color: #0056b3 !important;
    text-decoration: none !important;
}

.publications-filter-section .btn-link:focus {
    box-shadow: none;
    outline: none;
}

/* Filter summary styling */
.publications-filter-section .text-muted {
    font-style: italic;
    opacity: 0.8;
}

/* Smooth icon transitions */
.publications-filter-section .btn-link i {
    transition: transform 0.2s ease;
}

/* Filter header improvements */
.publications-filter-section .d-flex.justify-content-between {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Collapsed state improvements */
.publications-filter-section.collapsed {
    padding: 15px 20px;
}

.publications-filter-section .d-flex.justify-content-between.collapsed {
    border-bottom: none;
    margin-bottom: 0;
}

/* Filter icons spacing */
.publications-filter-section .btn-link i.fa-filter {
    color: #6c757d;
    opacity: 0.8;
}

/* Compact label styling */
.filter-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.3;
}

/* Dropdown option styling for long text */
.dash-dropdown .Select-option {
    padding: 8px 12px;
    line-height: 1.4;
    font-size: 13px;
    word-wrap: break-word;
    white-space: normal;
    max-height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-dropdown .Select-option:hover {
    background-color: #e9ecef;
}

/* Trends chart improvements */
.trends-chart-grid {
    margin-bottom: 2rem;
}

.trends-chart-grid .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trends-chart-grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Chart container improvements */
.trends-chart-grid .card-body {
    padding: 1rem;
}

.trends-chart-grid .card-body .js-plotly-plot {
    width: 100% !important;
}

/* Responsive chart adjustments */
@media (max-width: 768px) {
    .trends-chart-grid .col-lg-6 {
        margin-bottom: 1rem;
    }
    
    .trends-chart-grid .card-body {
        padding: 0.75rem;
    }
}

/* Responsive adjustments for better layout */
@media (max-width: 768px) {
    .publications-filter-section {
        padding: 16px;
        margin-bottom: 20px !important;
    }
    
    .dash-dropdown .Select-value-label,
    .dash-dropdown .Select-menu-outer .Select-option {
        font-size: 12px;
    }
    
    .filter-label {
        font-size: 12px;
    }
    
    .compact-dropdown .Select-control {
        min-height: 34px !important;
        height: 34px;
    }
}

/* Prevent filter container expansion and ensure proper spacing */
.publications-filter-section {
    overflow-x: hidden;
    overflow-y: visible;
    clear: both;
    display: block;
    width: 100%;
}

/* Ensure content below filters has proper spacing */
.publications-filter-section + * {
    margin-top: 0 !important;
    clear: both;
}

/* Button styling */
.btn-sm {
    font-size: 12px;
    padding: 4px 8px;
    line-height: 1.2;
}

/* Ensure dropdowns appear above scorecards */
.dash-dropdown .Select-menu-outer {
    z-index: 1050 !important;
}

/* Fix for Bootstrap row spacing in filter layout */
.publications-filter-section .row {
    margin-left: -12px;
    margin-right: -12px;
}

.publications-filter-section .row > * {
    padding-left: 12px;
    padding-right: 12px;
}

/* Additional styling can be added here as needed */
