/* Global Font Styling */
body {
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* Navigation links – clean hover effect */
.nav-link {
    transition: opacity 0.2s ease !important;
}

.nav-link:hover {
    opacity: 1 !important;
}

/* Dropdown Styling */
.Select-control {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

.Select-control:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.Select-control.is-focused {
    border: 1px solid #1f77b4 !important;
    box-shadow: 0 0 0 3px rgba(31, 119, 180, 0.1) !important;
}

.Select-input > input {
    background-color: #fff !important;
    color: #333 !important;
}

.Select-placeholder {
    color: #999 !important;
}

.Select-value {
    color: #333 !important;
}

.Select-menu-outer {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
}

/* Filter row: label above dropdown */
.filter-row {
    display: block;
    margin-bottom: 12px;
}

.filter-label {
    display: block;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
}

.filter-dd {
    display: block;
    width: 100%;
}

/* Restore natural dropdown option style –
   override Bootstrap's label rules which break Dash multi-select */
.Select-option label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    width: 100% !important;
}

/* Selected value text wrapping */
.Select-value-label,
.Select-value {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
}

.Select-arrow {
    border-top-color: #999 !important;
}

/* Slider Styling */
.rc-slider {
    background-color: #ddd !important;
}

.rc-slider-track {
    background-color: #1f77b4 !important;
}

.rc-slider-handle {
    background-color: #1f77b4 !important;
    border-color: #1f77b4 !important;
}

.rc-slider-handle:hover {
    box-shadow: 0 0 5px rgba(31, 119, 180, 0.5) !important;
}

.rc-slider-mark-text {
    color: #666 !important;
    font-size: 12px;
}

/* Radio and Checkbox */
.rc-checkbox-checked .rc-checkbox-inner,
.rc-radio-checked .rc-radio-inner {
    background-color: #1f77b4 !important;
    border-color: #1f77b4 !important;
}

/* Tables */
.dash-table-container .dash-spreadsheet thead th {
    background-color: #f0f0f0 !important;
    font-weight: 600;
}

/* Tabs – sticky menu bar for tab labels */
#tabs > .tab-parent {
    position: sticky;
    top: 56px;              /* sits right below the 56px navbar */
    z-index: 1000;
    background-color: #ffffff;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    margin: -20px -20px 16px -20px;
    padding: 0 20px;
    display: flex;
    gap: 0;
}

#tabs > .tab-parent .tab {
    color: #555 !important;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px !important;
    background-color: transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
}

#tabs > .tab-parent .tab:hover {
    color: #1f77b4 !important;
    background-color: rgba(31, 119, 180, 0.04);
}

#tabs > .tab-parent .tab--selected {
    color: #1f77b4 !important;
    border-bottom-color: #1f77b4 !important;
    font-weight: 600;
    background-color: transparent;
}

.Tabs__tab {
    color: #666 !important;
    border-bottom: 2px solid #ddd;
    padding: 12px 24px !important;
    background-color: transparent;
}

.Tabs__tab.is-selected {
    color: #1f77b4 !important;
    border-bottom-color: #1f77b4 !important;
    font-weight: 600;
}

.Tabs__tab:hover {
    background-color: #f9f9f9;
}

/* Input Fields */
input[type="text"],
input[type="date"],
input[type="number"],
textarea,
select {
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: #1f77b4 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(31, 119, 180, 0.1) !important;
}

/* Buttons */
button {
    transition: all 0.2s ease-in-out;
}

button:hover {
    opacity: 0.95;
}

/* Datasets checklists – align labels and trash icons */
#datasets-checklist-sample label,
#datasets-checklist-upload label {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 3px 0 !important;
    border-bottom: 1px solid #f0f0f0;
}

#datasets-checklist-sample label > div,
#datasets-checklist-upload label > div {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Same style for costs checklist */
#costs-checklist label {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 3px 0 !important;
    border-bottom: 1px solid #f0f0f0;
}

#costs-checklist label > div {
    flex: 1 !important;
    min-width: 0 !important;
}

/* MCF / PR grade distribution sliders – hide all marks and tooltips */
#sample-mcf-range .rc-slider-mark,
#sample-pr-range .rc-slider-mark,
#sample-mcf-range div[class*="tooltip"],
#sample-pr-range div[class*="tooltip"] {
    display: none !important;
}

/* Hide the Dash 2.x min/max value input boxes at each end of the slider.
   These appear on 2-handle RangeSliders (MCF). Nuclear approach: */
#sample-mcf-range input[type="number"],
#sample-pr-range input[type="number"],
#sample-mcf-range input:not([type]),
#sample-pr-range input:not([type]),
#sample-mcf-range > input,
#sample-pr-range > input,
#sample-mcf-range input {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    position: absolute !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

/* Documentation Sliding Sidebar */
.docs-sidebar {
    position: fixed;
    top: 0;
    right: -570px;
    width: 550px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.docs-sidebar.open {
    right: 0;
}

.docs-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.docs-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.doc-nav-link {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px 8px 0;
    color: #1f77b4;
    text-decoration: none;
    border: 1px solid #1f77b4;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    cursor: pointer;
}

.doc-nav-link:hover {
    background: #1f77b4;
    color: white;
}

.doc-nav-link.active {
    background: #1f77b4;
    color: white;
}

#docs-content {
    line-height: 1.6;
}

#docs-content h1, #docs-content h2, #docs-content h3 {
    color: #1f77b4;
    margin-top: 24px;
    margin-bottom: 12px;
}

#docs-content h1:first-child, #docs-content h2:first-child {
    margin-top: 0;
}

#docs-content p {
    margin-bottom: 12px;
}

#docs-content ul, #docs-content ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

#docs-content code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

#help-btn:hover {
    opacity: 1 !important;
}

@media (max-width: 576px) {
    .docs-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Tab help button */
.tab-help-btn {
    background: transparent;
    border: none;
    color: #c0c0c0;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    opacity: 1;
    transition: color 0.2s ease;
    position: absolute;
    right: 10px;
    top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-help-btn:hover {
    color: #1f77b4;
}

/* Help icon next to labels (inline with text) */
.label-help-btn {
    background: transparent;
    border: none;
    color: #d0d0d0;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 4px;
    opacity: 1;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    flex-shrink: 0;
}

.label-help-btn:hover {
    color: #1f77b4;
}

/* About model link in sidebar */
#help-btn-modeling {
    transition: opacity 0.2s ease;
}

#help-btn-modeling:hover {
    opacity: 0.7;
}

.tab-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}