/* Global dark theme overrides */
body {
  background-color: #121212;
  color: #e5e5e5;
}

/* Primary containers */
#generate-tab-container,
#review-tab-container,
#explore-tab-container,
.tab-content,
.tab-pane,
.container-fluid,
.row {
  background-color: #121212 !important;
  color: #e5e5e5 !important;
}

/* Top nav/tabs */
.nav-tabs,
.nav-tabs .nav-link {
  background-color: #0f0f0f !important;
  border-color: #333 !important;
  color: #e5e5e5 !important;
}
.tab-content {
  background-color: #121212 !important;
  color: #e5e5e5 !important;
}

.dash-tabs {
  background-color: #0f0f0f !important;
}

/* dcc.Tabs default classes */
.dash-tabs .tab {
  background-color: #0f0f0f !important;
  color: #e5e5e5 !important;
  border: 1px solid #333 !important;
  padding: 8px 14px !important;
}
.dash-tabs .tab--selected {
  background-color: #1a1a1a !important;
  color: #fff !important;
  border-color: #555 !important;
}
.dash-tabs .tab:not(.tab--selected):hover {
  background-color: #151515 !important;
  color: #fff !important;
}

/* Nested tabs (review sub-tabs) */
.tab-content .dash-tabs .tab {
  background-color: #0f0f0f !important;
  color: #e5e5e5 !important;
  border: 1px solid #333 !important;
  padding: 6px 12px !important;
}
.tab-content .dash-tabs .tab--selected {
  background-color: #1a1a1a !important;
  color: #fff !important;
  border-color: #555 !important;
}
.tab-content .dash-tabs .tab:not(.tab--selected):hover {
  background-color: #151515 !important;
  color: #fff !important;
}

/* dcc.Dropdown (indicator selector and query file selector) */
.indicator-selector .Select-control,
#gen-query-file-selector .Select-control {
  background-color: #1c1c1c !important;
  border-color: #444 !important;
  color: #e5e5e5 !important;
}
.indicator-selector .Select-placeholder,
.indicator-selector .Select--single > .Select-control .Select-value,
#gen-query-file-selector .Select-placeholder,
#gen-query-file-selector .Select--single > .Select-control .Select-value {
  color: #ffffff !important;
}
.indicator-selector .Select-value-label,
#gen-query-file-selector .Select-value-label {
  color: #ffffff !important;
}
.indicator-selector .Select-value,
#gen-query-file-selector .Select-value {
  color: #ffffff !important;
}
.indicator-selector .Select-menu-outer,
#gen-query-file-selector .Select-menu-outer {
  background-color: #1c1c1c !important;
  border-color: #444 !important;
  color: #e5e5e5 !important;
}
.indicator-selector .Select-option,
#gen-query-file-selector .Select-option {
  background-color: #1c1c1c !important;
  color: #e5e5e5 !important;
}
.indicator-selector .Select-option.is-focused,
.indicator-selector .Select-option:hover,
#gen-query-file-selector .Select-option.is-focused,
#gen-query-file-selector .Select-option:hover {
  background-color: #2a2a2a !important;
  color: #fff !important;
}
.indicator-selector .Select-input > input,
#gen-query-file-selector .Select-input > input {
  color: #e5e5e5 !important;
}

/* Explore: filter dropdown */
#profile-filter-dropdown .Select-control,
#profile-filter-dropdown .Select-menu-outer,
#profile-filter-dropdown .Select-option,
#profile-filter-dropdown .Select-placeholder,
#profile-filter-dropdown .Select--single > .Select-control .Select-value,
#profile-filter-dropdown .Select-value-label {
  background-color: #1c1c1c !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}
#profile-filter-dropdown .Select-option.is-focused,
#profile-filter-dropdown .Select-option:hover {
  background-color: #2a2a2a !important;
  color: #fff !important;
}
#profile-filter-dropdown .Select-input > input {
  color: #e5e5e5 !important;
}

/* Explore: query selector dropdown */
#query-selector-dropdown .Select-control,
#query-selector-dropdown .Select-menu-outer,
#query-selector-dropdown .Select-option,
#query-selector-dropdown .Select-placeholder,
#query-selector-dropdown .Select--single > .Select-control .Select-value,
#query-selector-dropdown .Select-value-label {
  background-color: #1c1c1c !important;
  color: #e5e5e5 !important;
  border-color: #444 !important;
}
#query-selector-dropdown .Select-option.is-focused,
#query-selector-dropdown .Select-option:hover {
  background-color: #2a2a2a !important;
  color: #fff !important;
}
#query-selector-dropdown .Select-input > input {
  color: #e5e5e5 !important;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
  background-color: #1a1a1a !important;
  color: #fff !important;
  border-color: #555 !important;
}

a {
  color: #80bfff;
}
a:hover {
  color: #cce5ff;
}

.card, .dbc-card, .dbc-card-body {
  background-color: #1b1b1b !important;
  color: #e5e5e5 !important;
}

.navbar, .navbar-nav {
  background-color: #0f0f0f !important;
}

/* Tables */
table {
  color: #e5e5e5;
}

/* Form controls */
.form-control, select, textarea, input {
  background-color: #1c1c1c !important;
  color: #e5e5e5 !important;
  border-color: #333 !important;
}

/* Buttons (outline variants) */
.btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info {
  color: #e5e5e5 !important;
  border-color: #555 !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover {
  background-color: #2a2a2a !important;
  color: #fff !important;
}

/* Details/Summary */
details {
  background-color: #1a1a1a;
  padding: 6px 8px;
  border: 1px solid #333;
  border-radius: 4px;
  margin-bottom: 8px;
}

summary {
  color: #e5e5e5;
  cursor: pointer;
}

/* Toasts and alerts */
.toast, .alert {
  background-color: #1b1b1b !important;
  color: #e5e5e5 !important;
  border-color: #333 !important;
}

/* Selected label color for comparison modal radio items */
.comparison-radio label > input[type="radio"]:checked + span {
  color: #0d6efd !important;
}

/* Artifact badges */
.badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 3px;
  color: #fff;
}
.badge-query { background-color: #ff7f0e; }
.badge-functional { background-color: #1f77b4; }
.badge-test { background-color: #2ca02c; }

/* Fix cursor pointer for Explore tab buttons */
#explore-tab-container button,
#explore-tab-container .btn {
  cursor: pointer !important;
}

/* Plotly graph cursor styles based on dragmode */
.dragmode-zoom,
.dragmode-zoom .svg-container,
.dragmode-zoom .plotly,
.dragmode-zoom .nsewdrag {
  cursor: zoom-in !important;
}

.dragmode-pan,
.dragmode-pan .svg-container,
.dragmode-pan .plotly,
.dragmode-pan .nsewdrag {
  cursor: grab !important;
}

.dragmode-pan:active,
.dragmode-pan:active .svg-container,
.dragmode-pan:active .plotly,
.dragmode-pan:active .nsewdrag {
  cursor: grabbing !important;
}

.dragmode-select,
.dragmode-select .svg-container,
.dragmode-select .plotly,
.dragmode-select .nsewdrag {
  cursor: crosshair !important;
}

/* Ensure cursor applies to all child elements in plot area */
.dragmode-zoom *,
.dragmode-pan *,
.dragmode-select * {
  cursor: inherit !important;
}
