/*
 * TextAnalysisR - WCAG 2.1 Level AA Compliant Styles
 *
 * Color Contrast Validation (using web_accessibility_utils.R):
 * - Body text: #111827 on #ffffff = 16.1:1 (Exceeds AAA)
 * - Headings: #111827 on #ffffff = 16.1:1 (Exceeds AAA)
 * - Dark mode text: #111827 on #f3f4f6 = 14.8:1 (Exceeds AAA)
 * - Primary buttons: #ffffff on #337ab7 = 4.5:1 (Meets AA)
 *
 * All color combinations tested with check_wcag_contrast()
 * Keyboard navigation: Full support with visible focus indicators
 * Screen reader: ARIA labels and landmarks throughout
 */

@import url('https://fonts.googleapis.com/css?family=Montserrat:600|Roboto:300&display=swap');

/* ============================================
   FONT SCALE (using px for Shiny/Bootstrap compatibility)
   ============================================ */
:root {
  /* Font Sizes - px values for consistent rendering in Shiny */
  --font-size-xs: 16px;     /* timestamps, hints */
  --font-size-sm: 16px;     /* small buttons, secondary text */
  --font-size-base: 16px;   /* body text, descriptions */
  --font-size-lg: 18px;     /* section titles, emphasis */
  --font-size-xl: 20px;     /* large headings */
  --font-size-2xl: 24px;    /* page titles */

  /* Font Families */
  --font-family-heading: "Montserrat", sans-serif;
  --font-family-body: "Roboto", sans-serif;

  /* Line Heights */
  --line-height-tight: 1.4;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Colors */
  --color-text-primary: #111827;
  --color-text-secondary: #475569;
  --color-text-muted: #6B7280;
  --color-heading: #4269BF;
  --color-success: #0C795A;
  --color-warning: #B15319;
  --color-error: #DC2626;
  --color-info: #1E71A1;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: var(--font-family-heading);
  color: var(--color-text-primary);
  /* WCAG AA: 16.1:1 on #ffffff */
}

h5,
.h5 {
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font-family-body);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: #ffffff;
}

/* Utility classes for consistent font sizing */
.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }
.text-2xl { font-size: var(--font-size-2xl) !important; }

/* Status/notification text styles */
.status-text {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
}

.status-text-sm {
  font-family: var(--font-family-body);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-tight);
}

/* AI-generated content styling */
.ai-content {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-primary);
}

/* Description/helper text */
.helper-text {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-secondary);
}

/* Empty state icons - responsive and dark mode compatible */
.empty-state-icon {
  font-size: 48px;
  color: #CBD5E1;
  margin-bottom: 1.25rem;
  display: block;
}

[data-theme="dark"] .empty-state-icon {
  color: #475569;
}

/* Fix inline icon colors for dark mode */
[data-theme="dark"] [style*="color: #CBD5E1"],
[data-theme="dark"] [style*="color:#CBD5E1"] {
  color: #475569 !important;
}

/* Secondary text - ensure contrast compliance */
.text-secondary {
  color: #475569;
}

[data-theme="dark"] .text-secondary {
  color: #94A3B8;
}

/* Alert/Status box styles for consistency */
.alert-success-custom {
  background-color: #D1FAE5;
  border: 1px solid #10B981;
  color: #0C795A;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 16px;
}

/* ============================================
   STANDARDIZED STATUS/ALERT BOX SYSTEM
   ============================================

   Use these classes for consistent styling:

   SIDEBAR (compact):
   - .status-sidebar-success
   - .status-sidebar-warning
   - .status-sidebar-info

   MAIN PANEL (standard):
   - .status-main-success
   - .status-main-warning
   - .status-main-info
   - .status-main-error

   OUTDATED RESULTS (flex with icon):
   - .status-outdated

   ICONS:
   - .status-icon (standard)
   - .status-icon-lg (larger for main panels)
   ============================================ */

/* --- SIDEBAR STATUS BOXES (compact) --- */
.status-sidebar-success {
  background-color: #D1FAE5;
  border: 1px solid #10B981;
  color: #0C795A;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 16px;
  border-radius: 4px;
}

.status-sidebar-warning {
  background-color: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #B15319;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 16px;
  border-radius: 4px;
}

.status-sidebar-info {
  background-color: #E0F2FE;
  border: 1px solid #337ab7;
  color: #1E71A1;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 16px;
  border-radius: 4px;
}

/* --- MAIN PANEL STATUS BOXES (standard) --- */
.status-main-success {
  background-color: #D1FAE5;
  border: 1px solid #10B981;
  color: #0C795A;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 4px;
}

.status-main-warning {
  background-color: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #B15319;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 4px;
}

.status-main-info {
  background-color: #E0F2FE;
  border: 1px solid #337ab7;
  color: #1E71A1;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 4px;
}

.status-main-error {
  background-color: #FEE2E2;
  border: 1px solid #DC2626;
  color: #7F1D1D;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 4px;
}

/* --- OUTDATED RESULTS WARNING (flex layout) --- */
.status-outdated {
  background-color: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #B15319;
  padding: 12px 16px;
  margin: 15px 0;
  font-size: 16px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

/* --- STATUS ICONS --- */
.status-icon {
  margin-right: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

.status-icon-lg {
  margin-right: 10px;
  font-size: 18px;
  flex-shrink: 0;
}

.status-icon-success { color: #10B981; }
.status-icon-warning { color: #F59E0B; }
.status-icon-info { color: #337ab7; }
.status-icon-error { color: #DC2626; }

/* --- DARK MODE SUPPORT --- */
[data-theme="dark"] .status-sidebar-success,
[data-theme="dark"] .status-main-success {
  background-color: #064E3B;
  border-color: #10B981;
  color: #A7F3D0;
}

[data-theme="dark"] .status-sidebar-warning,
[data-theme="dark"] .status-main-warning,
[data-theme="dark"] .status-outdated {
  background-color: #78350F;
  border-color: #F59E0B;
  color: #FDE68A;
}

[data-theme="dark"] .status-sidebar-info,
[data-theme="dark"] .status-main-info {
  background-color: #1E3A5F;
  border-color: #60A5FA;
  color: #BFDBFE;
}

[data-theme="dark"] .status-main-error {
  background-color: #7F1D1D;
  border-color: #DC2626;
  color: #FECACA;
}

[data-theme="dark"] .status-icon-success { color: #34D399; }
[data-theme="dark"] .status-icon-warning { color: #FBBF24; }
[data-theme="dark"] .status-icon-info { color: #60A5FA; }
[data-theme="dark"] .status-icon-error { color: #F87171; }

/* --- STEP INDICATOR BOXES (for multi-step instructions) --- */
.status-step-purple {
  background-color: #F3E8FF;
  border: 1px solid #6B46C1;
  color: #3B0764;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 16px;
  border-radius: 4px;
}

.status-step-blue {
  background-color: #E0F2FE;
  border: 1px solid #337ab7;
  color: #1E71A1;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 4px;
}

.status-step-green {
  background-color: #E8F5E9;
  border: 1px solid #4CAF50;
  color: #1B5E20;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 4px;
}

.status-icon-purple { color: #6B46C1; }
.status-icon-green-alt { color: #4CAF50; }

/* Dark mode for step boxes */
[data-theme="dark"] .status-step-purple {
  background-color: #4C1D95;
  border-color: #A78BFA;
  color: #EDE9FE;
}

[data-theme="dark"] .status-step-blue {
  background-color: #1E3A5F;
  border-color: #60A5FA;
  color: #BFDBFE;
}

[data-theme="dark"] .status-step-green {
  background-color: #14532D;
  border-color: #4ADE80;
  color: #BBF7D0;
}

[data-theme="dark"] .status-icon-purple { color: #A78BFA; }
[data-theme="dark"] .status-icon-green-alt { color: #4ADE80; }

/* --- LEGACY CLASSES (for backward compatibility) --- */
.alert-warning-custom {
  background-color: #FEF3C7;
  border: 1px solid #F59E0B;
  color: #B15319;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 16px;
}

.alert-info-custom {
  background-color: #E0F2FE;
  border: 1px solid #337ab7;
  color: #1E71A1;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 16px;
}

[data-theme="dark"] .alert-success-custom {
  background-color: #064E3B;
  border-color: #10B981;
  color: #A7F3D0;
}

[data-theme="dark"] .alert-warning-custom {
  background-color: #78350F;
  border-color: #F59E0B;
  color: #FDE68A;
}

[data-theme="dark"] .alert-info-custom {
  background-color: #1E3A5F;
  border-color: #60A5FA;
  color: #BFDBFE;
}

.navbar-inverse {
  background-color: #4269BF;
  border-color: #fff;
}


.container-fluid {
  background-color: #ffffff;
}

.sidebar,
.sidebar-panel {
  background-color: #ffffff;
}

.well {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
}

.tab-pane {
  background-color: #ffffff;
}

.panel,
.panel-default {
  background-color: #ffffff;
  border-color: #e5e7eb;
}

.panel-heading {
  background-color: #f9fafb;
  border-color: #e5e7eb;
}

.panel-body {
  background-color: #ffffff;
}

.col-sm-3,
.col-sm-9,
.col-sm-8,
.main-panel {
  background-color: #ffffff;
}


/* Ensure Font Awesome icons display correctly */
.fa,
.fas,
.far,
.fal,
.fab,
.fa-solid,
.fa-regular,
.fa-light,
.fa-brands,
[class^="fa-"],
[class*=" fa-"],
.action-link i,
.action-button i,
a.action-button i,
a.action-link i {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
  font-style: normal;
  font-weight: 900;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: inline-block;
}

/* Button styles - force white text on all button variants */
.btn,
.btn *:not(.fa):not(.fas):not(.far):not([class^="fa-"]) {
  color: #ffffff !important;
}

.btn {
  background-color: #4269BF !important;
  border-color: #4269BF !important;
}

/* Shiny action buttons - ensure white text with maximum specificity */
button.btn.action-button,
button.btn.btn-default.action-button,
button.btn.btn-primary.action-button,
button.btn.btn-secondary.action-button,
button.btn.btn-info.action-button,
.shiny-input-container button.btn,
.shiny-bound-input.action-button,
.btn-default,
.btn-primary,
.btn-secondary,
.btn-info,
.btn.action-button,
.btn.btn-primary,
.btn.btn-secondary,
.btn.btn-info,
.btn.btn-default,
.btn-primary.btn-block,
.btn-secondary.btn-block,
.btn-info.btn-block,
.btn-default.btn-block,
button.btn-primary,
button.btn-secondary,
button.btn-info,
button.btn-default {
  color: #ffffff !important;
  background-color: #4269BF !important;
  border-color: #4269BF !important;
}

/* Action links (not buttons) should keep their link color */
a.action-button,
a.shiny-bound-input.action-button {
  color: #337ab7 !important;
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  text-decoration: none;
}

a.action-button:hover,
a.shiny-bound-input.action-button:hover {
  color: #23527c !important;
  text-decoration: underline;
  background-color: transparent !important;
}

.btn:hover,
.btn:focus,
.btn:active {
  color: #ffffff !important;
  background-color: #337ab7;
  border-color: #337ab7;
}

.btn-default:focus,
.btn-default.focus,
.btn-default:hover,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary.focus,
.btn-primary:active,
.btn-primary.active,
.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary.focus,
.btn-secondary:active,
.btn-secondary.active,
.btn-info:hover,
.btn-info:focus,
.btn-info.focus,
.btn-info:active,
.btn-info.active,
.btn.action-button:hover,
.btn.action-button:focus,
.btn.action-button:active,
.btn-primary.btn-block:hover,
.btn-secondary.btn-block:hover,
.btn-info.btn-block:hover,
button.btn-primary:hover,
button.btn-secondary:hover,
button.btn-info:hover,
button.btn.action-button:hover,
button.btn.action-button:focus,
button.btn.action-button:active {
  color: #ffffff !important;
  background-color: #337ab7 !important;
  border-color: #337ab7 !important;
}

/* Shinybusy overlay */
.shinybusy-overlay {
  background-color: rgba(0, 0, 0, 0.15) !important;
}

.shiny-notification {
  color: #4269BF !important;
  font-size: 16px !important;
  pointer-events: auto !important;
}

.shiny-notification:hover {
  opacity: 1 !important;
}

.shiny-notification-message {
  color: #4269BF !important;
  font-size: 16px !important;
}

.checkbox-margin label {
  text-align: left !important;
  display: block;
}

.checkbox-margin .control-label {
  text-align: left !important;
}

.selectize-dropdown .selectize-dropdown-content .option {
  text-align: left !important;
}

.selectize-dropdown .selectize-dropdown-content {
  text-align: left !important;
}

.selectize-input {
  text-align: left !important;
}

.selectize-dropdown {
  text-align: left !important;
}

.plotly .hoverlayer .hovertext {
  text-align: left !important;
}

.plotly .hoverlayer .hovertext text {
  text-align: left !important;
}

.plotly .hoverlayer .hovertext tspan {
  text-align: left !important;
  text-anchor: start !important;
}

.plotly .hoverlayer g.hovertext {
  text-align: left !important;
}

.plotly .hoverlayer .hovertext path {
  text-align: left !important;
}

g.hoverlayer text {
  text-anchor: start !important;
}

g.hoverlayer tspan {
  text-anchor: start !important;
}

.plotly .hoverlayer .hovertext {
  max-width: 450px !important;
  min-width: 200px !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.plotly .hoverlayer .hovertext rect {
  width: auto !important;
}

.plotly .hoverlayer .hovertext text {
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

.plotly .hoverlayer .legend {
  max-width: 300px !important;
  word-wrap: break-word !important;
}

.plotly .hoverlayer path {
  stroke-width: 1px !important;
}

.plotly .hoverlayer .hovertext tspan {
  white-space: pre-wrap !important;
}

.shiny-notification-warning {
  color: #4269BF !important;
  font-size: 16px !important;
}

.shiny-notification-error {
  color: #4269BF !important;
  font-size: 16px !important;
}

.modal-dialog {
  max-width: 90%;
}

#tts_toggle,
#dark_mode_toggle,
#translate_icon,
.password-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 1200px) {
  .modal-dialog {
    max-width: 1100px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .modal-dialog {
    max-width: 90%;
    width: auto;
  }
}

@media (max-width: 768px) {
  .modal-dialog {
    max-width: 95%;
    width: auto;
  }
}

.modal-content {
  overflow-x: auto;
}

.modal-title {
  font-size: 18px;
}

.modal-body {
  font-size: 16px;
}

.modal-body pre,
.modal-body .shiny-text-output {
  font-size: 16px;
  line-height: 1.6;
}

.modal-footer {
  font-size: 16px;
}

pre {
  font-size: 16px;
  line-height: 1.6;
}

.shiny-text-output,
verbatim {
  font-size: 16px;
  line-height: 1.6;
}

code {
  font-size: 16px;
}

.form-control {
  font-size: 16px;
}

.btn,
.btn-default,
.btn-primary,
.btn-info {
  font-size: 16px;
}

.control-label,
.shiny-input-container label {
  font-size: 16px;
}

.selectize-input {
  font-size: 16px;
}

.selectize-dropdown .selectize-dropdown-content .option {
  font-size: 16px;
}

.checkbox label,
.radio label {
  font-size: 16px;
}

.btn-file {
  font-size: 16px;
  height: 34px;
  line-height: 1.42857143;
  padding: 6px 12px;
}

.form-group.shiny-input-container {
  margin-bottom: 15px;
}

.form-group.shiny-input-container input[type="text"] {
  font-size: 16px;
}

input[type="file"] {
  font-size: 16px;
}

.shiny-input-container .btn-file input[type="file"] {
  font-size: 16px;
}

/* Slider (ion-rangeslider) text sizing */
.irs-min,
.irs-max,
.irs-from,
.irs-to,
.irs-single {
  font-size: 14px !important;
}

.irs-grid-text {
  font-size: 14px !important;
}


/* ========================================================================
   ACCESSIBILITY & DARK MODE STYLES
   WCAG 2.1 Level AA Compliant
   ======================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 9999;
  padding: 1em 1.5em;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  left: 0 !important;
  top: 0 !important;
  outline: 3px solid #337ab7;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.btn:focus,
a:focus,
button:focus,
[tabindex]:focus {
  outline: 2px solid #337ab7 !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

.navbar .navbar-nav>li>a:focus,
.nav-pills>li>a:focus,
.nav-tabs>li>a:focus,
.nav-stacked>li>a:focus {
  outline-offset: -2px !important;
}

input:focus,
select:focus,
textarea:focus,
.selectize-input.focus {
  outline: 2px solid #337ab7 !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

main:focus,
div[role="main"]:focus,
[tabindex="-1"]:focus,
.container-fluid:focus,
.main-panel:focus,
.col-sm-9:focus,
.col-sm-8:focus,
.tab-pane:focus,
.well:focus {
  outline: none !important;
  box-shadow: none !important;
}

.plotly,
.html-widget,
.datatables {
  overflow: visible !important;
}

.plotly:focus,
.html-widget:focus,
.datatables:focus,
.plotly:focus-within,
.html-widget:focus-within,
.datatables:focus-within {
  outline: 2px solid #337ab7 !important;
  outline-offset: 2px !important;
  box-shadow: none !important;
}

@media (prefers-contrast: high) {

  .btn:focus,
  input:focus,
  select:focus,
  textarea:focus,
  a:focus,
  button:focus,
  *:focus,
  .plotly:focus,
  .html-widget:focus,
  .datatables:focus,
  .plotly:focus-within,
  .html-widget:focus-within,
  .datatables:focus-within {
    outline: 3px solid #000 !important;
    outline-offset: 3px !important;
  }
}

:root[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #2d333b;
  --bg-hover: #4a5462;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --border-color: #30363d;
  --link-color: #79c0ff;
  --link-hover: #d0ebff;
  --btn-primary-bg: #238636;
  --btn-primary-text: #ffffff;
  --input-bg: #0d1117;
  --input-border: #30363d;
  --accent-color: #79c0ff;
  --muted-color: #6e7681;
  --emphasis-color: #c9d1d9;
}

#tts_toggle {
  color: #5F7088;
  font-size: 26px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

#tts_toggle:hover {
  color: #337ab7;
  transform: scale(1.1);
}

#tts_toggle:focus {
  outline: 2px solid #337ab7;
  outline-offset: 3px;
  border-radius: 4px;
}

#tts_toggle.tts-active {
  color: #337ab7;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

#voice_toggle {
  color: #5F7088;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #e2e8f0;
  padding: 2px;
}

#voice_toggle:hover {
  background-color: #337ab7;
  color: #ffffff;
  transform: scale(1.1);
}

#voice_toggle:focus {
  outline: 2px solid #337ab7;
  outline-offset: 3px;
  border-radius: 50%;
}

#voice_toggle:active {
  transform: scale(0.95);
}

[data-theme="dark"] #voice_toggle {
  color: #e2e8f0;
  background-color: #5F7088;
}

[data-theme="dark"] #voice_toggle:hover {
  background-color: #60a5fa;
  color: #1e293b;
}

#dark_mode_toggle {
  color: #5F7088;
  font-size: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

#dark_mode_toggle:hover {
  color: #337ab7;
  transform: scale(1.1);
}

#dark_mode_toggle:focus {
  outline: 2px solid #337ab7;
  outline-offset: 3px;
  border-radius: 4px;
}

.navbar-default .navbar-nav>li {
  margin-right: 4px;
}

.navbar-default .navbar-nav>li>a {
  transition: all 0.1s ease;
  border-radius: 4px;
}

.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}

.navbar-default .navbar-nav>.active>a {
  background-color: #e5e7eb !important;
  color: #111827 !important;
  font-weight: 600 !important;
}

.nav-tabs>li>a:hover {
  background-color: #f3f4f6 !important;
  border-color: #e5e7eb !important;
  color: #111827 !important;
}

.nav-tabs>li.active>a,
.nav-tabs>li.active>a:hover,
.nav-tabs>li.active>a:focus {
  background-color: #e5e7eb !important;
  color: #111827 !important;
  border-color: #e5e7eb !important;
  font-weight: 600 !important;
}

.tabbable .nav-pills>li,
.col-sm-3 .nav-pills>li,
.nav-stacked>li {
  margin-bottom: 4px;
}

.tabbable .nav-pills>li>a,
.col-sm-3 .nav-pills>li>a,
.nav-stacked>li>a {
  transition: all 0.1s ease;
  border-radius: 4px;
}

.tabbable .nav-pills>li>a:hover,
.col-sm-3 .nav-pills>li>a:hover,
.nav-stacked>li>a:hover {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}

.tabbable .nav-pills>li.active>a,
.tabbable .nav-pills>li.active>a:hover,
.tabbable .nav-pills>li.active>a:focus,
.col-sm-3 .nav-pills>li.active>a,
.nav-stacked>li.active>a {
  background-color: #e5e7eb !important;
  color: #111827 !important;
  font-weight: 600 !important;
}

.selectize-dropdown-content .option:hover {
  background-color: #e5e7eb !important;
  color: #111827 !important;
}

.selectize-dropdown-content .option.active {
  background-color: #e5e7eb !important;
  color: #111827 !important;
  font-weight: 600 !important;
}

table.dataTable tbody tr:hover {
  background-color: #f3f4f6 !important;
}

label,
.control-label {
  color: #111827 !important;
}

p,
span,
div {
  color: #111827;
}


[data-theme="dark"] body {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .container-fluid {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .sidebar-panel {
  background-color: var(--bg-secondary) !important;
  border-right: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .sidebar label,
[data-theme="dark"] .sidebar .control-label,
[data-theme="dark"] .sidebar-panel label,
[data-theme="dark"] .sidebar-panel .control-label {
  color: var(--text-primary) !important;
}




[data-theme="dark"] h4[style*="color: #4269BF"],
[data-theme="dark"] h4[style*="color: #4269BF"],
[data-theme="dark"] h5[style*="color: #4269BF"],
[data-theme="dark"] h5[style*="color: #4269BF"],
[data-theme="dark"] strong[style*="color: #4269BF"],
[data-theme="dark"] strong[style*="color: #4269BF"],
[data-theme="dark"] span[style*="color: #4269BF"],
[data-theme="dark"] span[style*="color: #4269BF"],
[data-theme="dark"] p[style*="color: #4269BF"],
[data-theme="dark"] p[style*="color: #4269BF"],
[data-theme="dark"] h5[style*="color: #4269BF"] strong,
[data-theme="dark"] h5[style*="color: #4269BF"] strong {
  color: #ffffff !important;
}

/* Keep strong/descriptive text white in dark mode sidebar */
[data-theme="dark"] .sidebar-panel h5[style*="color: #4269BF"] strong,
[data-theme="dark"] .sidebar-panel h5[style*="color: #4269BF"] strong,
[data-theme="dark"] .sidebar h5[style*="color: #4269BF"] strong,
[data-theme="dark"] .sidebar h5[style*="color: #4269BF"] strong {
  color: #ffffff !important;
}

[data-theme="dark"] h4[style*="color: #4269BF"] a,
[data-theme="dark"] h4[style*="color: #4269BF"] a,
[data-theme="dark"] h5[style*="color: #4269BF"] a,
[data-theme="dark"] h5[style*="color: #4269BF"] a,
[data-theme="dark"] strong[style*="color: #4269BF"] a,
[data-theme="dark"] strong[style*="color: #4269BF"] a,
[data-theme="dark"] span[style*="color: #4269BF"] a,
[data-theme="dark"] span[style*="color: #4269BF"] a,
[data-theme="dark"] p[style*="color: #4269BF"] a,
[data-theme="dark"] p[style*="color: #4269BF"] a {
  color: #79c0ff !important;
}

[data-theme="dark"] .well {
  background-color: var(--bg-tertiary) !important;
  border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .tab-pane {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .panel,
[data-theme="dark"] .panel-default {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .panel-heading {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .panel-body {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--input-bg);
  color: var(--text-primary) !important;
  border-color: var(--input-border);
}

[data-theme="dark"] select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary) !important;
}

[data-theme="dark"] .selectize-input {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}

[data-theme="dark"] .selectize-input .item {
  color: #111827 !important;
  background-color: #e5e7eb !important;
}

[data-theme="dark"] .selectize-input[style*="background-color: #fff"],
[data-theme="dark"] .selectize-input[style*="background-color: #FFF"],
[data-theme="dark"] .selectize-input[style*="background-color: white"] {
  background-color: #f3f4f6 !important;
  color: #111827 !important;
}

[data-theme="dark"] .selectize-dropdown {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

[data-theme="dark"] .selectize-dropdown-content .option {
  color: #111827 !important;
}

[data-theme="dark"] .selectize-dropdown-content .option:hover {
  background-color: #e5e7eb;
  color: #111827 !important;
}

[data-theme="dark"] .selectize-dropdown-content .option.active {
  background-color: #e5e7eb;
  color: #111827 !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .btn,
[data-theme="dark"] button.btn,
[data-theme="dark"] button.btn.action-button {
  background-color: var(--bg-tertiary);
  color: var(--text-primary) !important;
  border-color: var(--border-color);
}

/* Dark mode action links (not buttons) should keep visible link color */
[data-theme="dark"] a.action-button,
[data-theme="dark"] a.shiny-bound-input.action-button {
  color: #38bdf8 !important;
  background-color: transparent !important;
  border: none !important;
}

[data-theme="dark"] a.action-button:hover,
[data-theme="dark"] a.shiny-bound-input.action-button:hover {
  color: #7dd3fc !important;
  text-decoration: underline;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] button.btn-primary,
[data-theme="dark"] button.btn.btn-primary.action-button {
  background-color: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  border-color: var(--btn-primary-bg) !important;
}

[data-theme="dark"] .btn-primary:hover {
  background-color: #2ea043 !important;
  border-color: #2ea043 !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] button.btn-secondary,
[data-theme="dark"] button.btn.btn-secondary.action-button {
  background-color: #238636 !important;
  color: #ffffff !important;
  border-color: #238636 !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: #2ea043 !important;
  border-color: #2ea043 !important;
}

[data-theme="dark"] .btn-info,
[data-theme="dark"] button.btn-info,
[data-theme="dark"] button.btn.btn-info.action-button {
  background-color: #238636 !important;
  color: #ffffff !important;
  border-color: #238636 !important;
}

[data-theme="dark"] .btn-info:hover {
  background-color: #2ea043 !important;
  border-color: #2ea043 !important;
}

[data-theme="dark"] .btn:hover {
  background-color: var(--bg-primary);
  color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-content {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-body a:not(.btn) {
  color: var(--link-color);
}

[data-theme="dark"] .modal-body a:not(.btn):hover {
  color: var(--link-hover);
  text-decoration: underline;
}

[data-theme="dark"] a:not(.btn):not(.action-button) {
  color: var(--link-color);
}

[data-theme="dark"] a:not(.btn):not(.action-button):hover {
  color: var(--link-hover);
  text-decoration: underline;
}

[data-theme="dark"] a[style*="color: #337ab7"],
[data-theme="dark"] a[style*="color: #337ab7"] {
  color: #38bdf8 !important;
}

[data-theme="dark"] a[style*="color: #337ab7"]:hover,
[data-theme="dark"] a[style*="color: #337ab7"]:hover {
  color: var(--link-hover) !important;
  text-decoration: none !important;
}

[data-theme="dark"] summary[style*="color: #337ab7"],
[data-theme="dark"] summary[style*="color: #337ab7"] {
  color: #38bdf8 !important;
}

[data-theme="dark"] summary[style*="color: #337ab7"]:hover,
[data-theme="dark"] summary[style*="color: #337ab7"]:hover {
  color: var(--link-hover) !important;
}

[data-theme="dark"] .dataTables_wrapper {
  color: var(--text-primary);
}

[data-theme="dark"] table.dataTable {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

[data-theme="dark"] table.dataTable thead th {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-bottom-color: var(--border-color);
}

[data-theme="dark"] table.dataTable tbody tr {
  background-color: var(--bg-secondary);
}

[data-theme="dark"] table.dataTable tbody tr:hover {
  background-color: var(--bg-hover) !important;
}

[data-theme="dark"] table.dataTable tbody tr:hover td {
  background-color: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] table.dataTable tbody td {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .shiny-notification {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] #tts_toggle {
  color: #e2e8f0 !important;
}

[data-theme="dark"] #tts_toggle:hover {
  color: #60a5fa !important;
  transform: scale(1.1);
}

[data-theme="dark"] #tts_toggle.tts-active {
  color: #60a5fa !important;
}

[data-theme="dark"] #dark_mode_toggle {
  color: #e2e8f0 !important;
}

[data-theme="dark"] #dark_mode_toggle:hover {
  color: #60a5fa !important;
  transform: scale(1.1);
}

#translate_icon {
  color: #5F7088;
  font-size: 26px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  pointer-events: auto;
  position: relative;
  z-index: 10;
}

#translate_icon:hover {
  color: #337ab7;
  transform: scale(1.1);
}

#translate_icon:focus {
  outline: 2px solid #337ab7;
  outline-offset: 3px;
  border-radius: 4px;
}

#translate_icon:active {
  transform: scale(0.95);
}

[data-theme="dark"] #translate_icon {
  color: #e2e8f0 !important;
}

[data-theme="dark"] #translate_icon:hover {
  color: #60a5fa !important;
  transform: scale(1.1);
}

.translate-dropdown-hidden {
  display: none !important;
}

#google_translate_element {
  display: none;
  visibility: hidden;
  position: relative;
  z-index: 1000;
}

#google_translate_element.show {
  display: inline-block !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 1000 !important;
  min-width: 150px !important;
  min-height: 40px !important;
}

#google_translate_element.show * {
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
}

#google_translate_element.show .goog-te-gadget,
#google_translate_element.show .goog-te-combo,
#google_translate_element.show select {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto !important;
  min-width: 150px !important;
  height: auto !important;
  min-height: 30px !important;
}

[data-theme="dark"] #google_translate_element.show select,
[data-theme="dark"] #google_translate_element.show .goog-te-combo {
  background-color: #5C6E88 !important;
  color: #e2e8f0 !important;
  border-color: #5F7088 !important;
}

[data-theme="dark"] #google_translate_element.show select:hover,
[data-theme="dark"] #google_translate_element.show .goog-te-combo:hover {
  background-color: #5F7088 !important;
  border-color: #60a5fa !important;
}

[data-theme="dark"] #google_translate_element.show option {
  background-color: #5C6E88 !important;
  color: #e2e8f0 !important;
}

/* Google Translate select styling */
#google_translate_element.show select,
#google_translate_element.show .goog-te-combo {
  font-size: 16px !important;
  padding: 8px 14px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px !important;
  background-color: #fff !important;
  min-width: 140px !important;
  max-width: 200px !important;
  height: auto !important;
  cursor: pointer !important;
}

#google_translate_element select:focus,
#google_translate_element select:active,
.goog-te-combo:focus,
.goog-te-combo:active {
  font-size: 16px !important;
}

#google_translate_element option,
.goog-te-combo option {
  font-size: 16px !important;
}

#google_translate_element.show .goog-te-gadget {
  font-size: 0 !important;
  line-height: 1 !important;
  display: inline-block !important;
}

#google_translate_element.show .goog-te-gadget .goog-te-combo {
  margin: 0 !important;
  vertical-align: middle !important;
  font-size: 16px !important;
  display: inline-block !important;
}

/* Hide Google Translate branding */
.goog-logo-link {
  display: none !important;
}

.goog-te-gadget span {
  display: none !important;
}

.goog-te-banner-frame,
body>.skiptranslate {
  display: none !important;
}

.goog-te-gadget img {
  display: none !important;
}

/* Mobile responsive for Google Translate */
@media (max-width: 768px) {

  #google_translate_element select,
  #google_translate_element select *,
  .goog-te-combo,
  .goog-te-combo * {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }
}

[data-theme="dark"] .navbar,
[data-theme="dark"] .navbar-default {
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .navbar-default .navbar-nav>li {
  margin-right: 4px;
}

[data-theme="dark"] .navbar-default .navbar-nav>li>a {
  color: var(--text-primary) !important;
  transition: all 0.1s ease;
  border-radius: 4px;
}

[data-theme="dark"] .navbar-default .navbar-nav>li>a:hover,
[data-theme="dark"] .navbar-default .navbar-nav>li>a:focus {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .navbar-default .navbar-nav>.active>a {
  background-color: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .nav-tabs {
  border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .nav-tabs>li>a {
  color: var(--text-primary) !important;
  background-color: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .nav-tabs>li>a:hover {
  background-color: var(--bg-hover) !important;
  border-color: var(--link-color) !important;
  color: var(--link-hover) !important;
}

[data-theme="dark"] .nav-tabs>li.active>a,
[data-theme="dark"] .nav-tabs>li.active>a:hover,
[data-theme="dark"] .nav-tabs>li.active>a:focus {
  background-color: var(--bg-primary) !important;
  color: var(--link-hover) !important;
  border-color: var(--link-color) !important;
  border-bottom-color: transparent !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .col-sm-3 {
  background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .tabbable .nav-pills>li,
[data-theme="dark"] .col-sm-3 .nav-pills>li,
[data-theme="dark"] .nav-stacked>li {
  margin-bottom: 4px;
}

[data-theme="dark"] .tabbable .nav-pills>li>a,
[data-theme="dark"] .col-sm-3 .nav-pills>li>a,
[data-theme="dark"] .nav-stacked>li>a {
  color: var(--text-primary) !important;
  background-color: transparent !important;
  transition: all 0.1s ease;
  border-radius: 4px;
}

[data-theme="dark"] .tabbable .nav-pills>li.active>a,
[data-theme="dark"] .tabbable .nav-pills>li.active>a:hover,
[data-theme="dark"] .tabbable .nav-pills>li.active>a:focus,
[data-theme="dark"] .col-sm-3 .nav-pills>li.active>a,
[data-theme="dark"] .nav-stacked>li.active>a {
  background-color: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

[data-theme="dark"] .tabbable .nav-pills>li>a:hover,
[data-theme="dark"] .col-sm-3 .nav-pills>li>a:hover,
[data-theme="dark"] .nav-stacked>li>a:hover {
  background-color: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .col-sm-9,
[data-theme="dark"] .col-sm-8,
[data-theme="dark"] .main-panel {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] span,
[data-theme="dark"] div {
  color: var(--text-primary);
}

[data-theme="dark"] code,
[data-theme="dark"] pre {
  background-color: var(--bg-tertiary) !important;
  color: #a3e635 !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] #vision_provider .radio label,
[data-theme="dark"] #vision_provider .radio span {
  color: #111827 !important;
}

[data-theme="dark"] #openai_vision_model {
  color: #111827 !important;
}

[data-theme="dark"] .selectize-dropdown .option {
  color: #111827 !important;
}




[data-theme="dark"] hr {
  border-top-color: var(--border-color) !important;
}

[data-theme="dark"] [style*="color: #CBD5E1"],
[data-theme="dark"] [style*="color: #cbd5e1"] {
  color: #8b949e !important;
}

[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color: #64748b"] {
  color: #c9d1d9 !important;
}

[data-theme="dark"] strong,
[data-theme="dark"] [style*="color: #4269BF"] {
  color: #58a6ff !important;
}

.top-right-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: transparent !important;
}

[data-theme="dark"] .top-right-controls {
  background-color: transparent !important;
}

[data-theme="dark"] #google_translate_element select,
[data-theme="dark"] .goog-te-combo {
  background-color: var(--input-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--input-border) !important;
  font-size: 16px !important;
}

[data-theme="dark"] #google_translate_element select:focus,
[data-theme="dark"] #google_translate_element select:active,
[data-theme="dark"] .goog-te-combo:focus,
[data-theme="dark"] .goog-te-combo:active {
  font-size: 16px !important;
}

[data-theme="dark"] #google_translate_element select option,
[data-theme="dark"] #google_translate_element option,
[data-theme="dark"] .goog-te-combo option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  font-size: 16px !important;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.text-muted {
  color: #4a5568 !important;
}

.alert-warning {
  background-color: #FEF3C7;
  color: #B15319;
  border-color: #F59E0B;
}

.alert-info {
  background-color: #DBEAFE;
  color: #3960E2;
  border-color: #3B82F6;
}

.alert-success {
  background-color: #D1FAE5;
  color: #0C795A;
  border-color: #10B981;
}

.alert-danger {
  background-color: #FEE2E2;
  color: #991B1B;
  border-color: #EF4444;
}

[data-theme="dark"] .alert-warning {
  background-color: #422006;
  color: #f59e0b;
  border-color: #78350f;
}

[data-theme="dark"] .alert-info {
  background-color: #1e3a8a;
  color: #93c5fd;
  border-color: #3960E2;
}

[data-theme="dark"] .alert-success {
  background-color: #14532d;
  color: #4ade80;
  border-color: #15803d;
}

[data-theme="dark"] .alert-danger {
  background-color: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

[data-theme="dark"] .text-muted {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] div[style*="background-color: #FEF3C7"],
[data-theme="dark"] div[style*="background-color: #fef3c7"] {
  background-color: #f3f4f6 !important;
  border-color: #d1d5db !important;
}

[data-theme="dark"] div[style*="color: #B15319"],
[data-theme="dark"] div[style*="color: #B15319"],
[data-theme="dark"] span[style*="color: #B15319"],
[data-theme="dark"] span[style*="color: #B15319"] {
  color: #111827 !important;
}

[data-theme="dark"] i[style*="color: #F59E0B"],
[data-theme="dark"] i[style*="color: #f59e0b"] {
  color: #111827 !important;
}

[data-theme="dark"] strong[style*="color: #F59E0B"],
[data-theme="dark"] strong[style*="color: #f59e0b"] {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #FEF3C7"] *,
[data-theme="dark"] div[style*="background-color: #fef3c7"] *,
[data-theme="dark"] div[style*="background-color: #FEF3C7"] label,
[data-theme="dark"] div[style*="background-color: #fef3c7"] label,
[data-theme="dark"] div[style*="background-color: #FEF3C7"] .checkbox,
[data-theme="dark"] div[style*="background-color: #fef3c7"] .checkbox,
[data-theme="dark"] div[style*="background-color: #FEF3C7"] input[type="checkbox"]+span,
[data-theme="dark"] div[style*="background-color: #fef3c7"] input[type="checkbox"]+span {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #F3E8FF"],
[data-theme="dark"] div[style*="background-color: #f3e8ff"] {
  background-color: #e0e7ff !important;
  border-color: #c7d2fe !important;
}

[data-theme="dark"] div[style*="color: #3B0764"],
[data-theme="dark"] div[style*="color: #3b0764"],
[data-theme="dark"] div[style*="background-color: #F3E8FF"] *,
[data-theme="dark"] div[style*="background-color: #f3e8ff"] * {
  color: #111827 !important;
}

[data-theme="dark"] i[style*="color: #6B46C1"],
[data-theme="dark"] i[style*="color: #6b46c1"],
[data-theme="dark"] strong[style*="color: #6B46C1"],
[data-theme="dark"] strong[style*="color: #6b46c1"] {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #F3E8FF"] label,
[data-theme="dark"] div[style*="background-color: #f3e8ff"] label,
[data-theme="dark"] div[style*="background-color: #F3E8FF"] .checkbox,
[data-theme="dark"] div[style*="background-color: #f3e8ff"] .checkbox,
[data-theme="dark"] div[style*="background-color: #F3E8FF"] input[type="checkbox"]+span,
[data-theme="dark"] div[style*="background-color: #f3e8ff"] input[type="checkbox"]+span {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #E0F2FE"],
[data-theme="dark"] div[style*="background-color: #e0f2fe"] {
  background-color: #e0f2fe !important;
  border-color: #bae6fd !important;
}

[data-theme="dark"] div[style*="color: #1E71A1"],
[data-theme="dark"] div[style*="color: #1E71A1"],
[data-theme="dark"] div[style*="background-color: #E0F2FE"] *,
[data-theme="dark"] div[style*="background-color: #e0f2fe"] * {
  color: #111827 !important;
}

[data-theme="dark"] i[style*="color: #337ab7"],
[data-theme="dark"] i[style*="color: #337ab7"],
[data-theme="dark"] strong[style*="color: #337ab7"],
[data-theme="dark"] strong[style*="color: #337ab7"] {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #E0F2FE"] label,
[data-theme="dark"] div[style*="background-color: #e0f2fe"] label,
[data-theme="dark"] div[style*="background-color: #E0F2FE"] .checkbox,
[data-theme="dark"] div[style*="background-color: #e0f2fe"] .checkbox,
[data-theme="dark"] div[style*="background-color: #E0F2FE"] input[type="checkbox"]+span,
[data-theme="dark"] div[style*="background-color: #e0f2fe"] input[type="checkbox"]+span {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #D1FAE5"],
[data-theme="dark"] div[style*="background-color: #d1fae5"] {
  background-color: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="dark"] div[style*="color: #0C795A"],
[data-theme="dark"] div[style*="color: #0C795A"],
[data-theme="dark"] div[style*="background-color: #D1FAE5"] *,
[data-theme="dark"] div[style*="background-color: #d1fae5"] * {
  color: #111827 !important;
}

[data-theme="dark"] i[style*="color: #10B981"],
[data-theme="dark"] i[style*="color: #10b981"],
[data-theme="dark"] strong[style*="color: #10B981"],
[data-theme="dark"] strong[style*="color: #10b981"] {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #D1FAE5"] label,
[data-theme="dark"] div[style*="background-color: #d1fae5"] label,
[data-theme="dark"] div[style*="background-color: #D1FAE5"] .checkbox,
[data-theme="dark"] div[style*="background-color: #d1fae5"] .checkbox,
[data-theme="dark"] div[style*="background-color: #D1FAE5"] input[type="checkbox"]+span,
[data-theme="dark"] div[style*="background-color: #d1fae5"] input[type="checkbox"]+span {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #E8F5E9"],
[data-theme="dark"] div[style*="background-color: #e8f5e9"] {
  background-color: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}

[data-theme="dark"] div[style*="color: #1B5E20"],
[data-theme="dark"] div[style*="color: #1b5e20"],
[data-theme="dark"] div[style*="background-color: #E8F5E9"] *,
[data-theme="dark"] div[style*="background-color: #e8f5e9"] * {
  color: #111827 !important;
}

[data-theme="dark"] i[style*="color: #4CAF50"],
[data-theme="dark"] i[style*="color: #4caf50"],
[data-theme="dark"] strong[style*="color: #4CAF50"],
[data-theme="dark"] strong[style*="color: #4caf50"] {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #E8F5E9"] label,
[data-theme="dark"] div[style*="background-color: #e8f5e9"] label,
[data-theme="dark"] div[style*="background-color: #E8F5E9"] .checkbox,
[data-theme="dark"] div[style*="background-color: #e8f5e9"] .checkbox,
[data-theme="dark"] div[style*="background-color: #E8F5E9"] input[type="checkbox"]+span,
[data-theme="dark"] div[style*="background-color: #e8f5e9"] input[type="checkbox"]+span {
  color: #111827 !important;
}

[data-theme="dark"] div[style*="background-color: #F3F4F6"],
[data-theme="dark"] div[style*="background-color: #f3f4f6"] {
  background-color: #1e293b !important;
  border: 1px solid #5C6E88 !important;
}

[data-theme="dark"] div[style*="background-color: #F3F4F6"] p,
[data-theme="dark"] div[style*="background-color: #f3f4f6"] p,
[data-theme="dark"] div[style*="background-color: #F3F4F6"] strong,
[data-theme="dark"] div[style*="background-color: #f3f4f6"] strong {
  color: #cbd5e1 !important;
}

[data-theme="dark"] div[style*="background-color: #F3F4F6"] a[style*="color: #337ab7"],
[data-theme="dark"] div[style*="background-color: #f3f4f6"] a[style*="color: #337ab7"],
[data-theme="dark"] div[style*="background-color: #F3F4F6"] a[style*="color: #337ab7"],
[data-theme="dark"] div[style*="background-color: #f3f4f6"] a[style*="color: #337ab7"] {
  color: #38bdf8 !important;
}

[data-theme="dark"] h4[style*="color: #337ab7"] {
  color: #34d399 !important;
}

[data-theme="dark"] h4[style*="color: #DC2626"],
[data-theme="dark"] h4[style*="color: #dc2626"] {
  color: #f87171 !important;
}

[data-theme="dark"] h4[style*="color: #337ab7"],
[data-theme="dark"] h4[style*="color: #337ab7"] {
  color: #38bdf8 !important;
}

[data-theme="dark"] ::placeholder {
  color: #9ca3af !important;
  opacity: 1 !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] :-ms-input-placeholder {
  color: #9ca3af !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}


[data-theme="dark"] input[type="password"]::placeholder {
  color: #9ca3af !important;
}

[data-theme="dark"] input[type="password"]:-ms-input-placeholder {
  color: #9ca3af !important;
}

[data-theme="dark"] input[type="password"]::-ms-input-placeholder {
  color: #9ca3af !important;
}

[data-theme="dark"] #openai_api_key::placeholder {
  color: #ffffff !important;
}

[data-theme="dark"] #openai_api_key:-ms-input-placeholder {
  color: #ffffff !important;
}

[data-theme="dark"] #openai_api_key::-ms-input-placeholder {
  color: #ffffff !important;
}

[data-theme="dark"] .selectize-input>input::placeholder {
  color: #9ca3af !important;
  opacity: 1 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] .selectize-input.has-items .item {
  color: #111827 !important;
  background-color: #e5e7eb !important;
  opacity: 1 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] .selectize-input.not-full::before {
  color: #9ca3af !important;
  opacity: 1 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] .selectize-control.single .selectize-input.input-active::after {
  color: #6b7280 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] .selectize-dropdown .option.selected {
  background-color: #d1d5db;
  color: #111827;
}

[data-theme="dark"] .selectize-input>input {
  color: #111827 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] .form-control-file {
  color: #6e7681 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] input[type="file"] {
  color: #6e7681 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] input[type="file"]::file-selector-button {
  background-color: #238636 !important;
  border: 1px solid #238636 !important;
  color: #e6edf3 !important;
  font-weight: 600;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] input[type="file"]::-webkit-file-upload-button {
  background-color: #238636 !important;
  border: 1px solid #238636 !important;
  color: #e6edf3 !important;
  font-weight: 600;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

[data-theme="dark"] .btn-file {
  background-color: #238636 !important;
  border: 1px solid #238636 !important;
  color: #e6edf3 !important;
  font-weight: 600 !important;
}

[data-theme="dark"] textarea::placeholder {
  color: #9ca3af !important;
  opacity: 1 !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.progress {
  height: 24px;
  font-size: 16px;
  line-height: 24px;
}

.progress-bar {
  transition: width 0.6s ease;
}

.progress-bar {
  color: #000;
  background-color: #337ab7;
}

::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
  font-weight: 500 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

:-ms-input-placeholder {
  color: #6b7280 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

::-ms-input-placeholder {
  color: #6b7280 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.selectize-input.has-items .item,
.selectize-input>input::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.selectize-input.not-full::before {
  color: #6b7280 !important;
  opacity: 1 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.selectize-input.has-placeholder .item,
.selectize-control.single .selectize-input.input-active::after {
  color: #6b7280 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.selectize-dropdown .option.selected {
  background-color: #e5e7eb;
  color: #111827;
}

.selectize-input>input {
  color: #111827 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.form-control-file {
  color: #1f2937 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

input[type="file"] {
  color: #1f2937 !important;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

input[type="file"]::file-selector-button {
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #1f2937;
  font-weight: 600;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

input[type="file"]::-webkit-file-upload-button {
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #1f2937;
  font-weight: 600;
  font-size: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

textarea::placeholder {
  color: #6b7280 !important;
  opacity: 1 !important;
  font-size: 16px !important;
  line-height: 1.5;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.lang-switcher {
  font-size: 16px !important;
  padding: 6px 12px;
}

.modal {
  display: none;
}

.modal[aria-hidden="false"] {
  display: block;
}

.modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.has-error input,
.has-error select,
.has-error textarea {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.error-message {
  color: #DC2626;
  font-size: 16px;
  margin-top: 4px;
  display: block;
}

[data-theme="dark"] main:focus,
[data-theme="dark"] div[role="main"]:focus,
[data-theme="dark"] [tabindex="-1"]:focus,
[data-theme="dark"] .container-fluid:focus,
[data-theme="dark"] .main-panel:focus,
[data-theme="dark"] .col-sm-9:focus,
[data-theme="dark"] .col-sm-8:focus,
[data-theme="dark"] .tab-pane:focus,
[data-theme="dark"] .well:focus {
  outline: none !important;
  box-shadow: none !important;
}

@media (max-width: 768px) {
  div[style*="display: flex"]>div[style*="flex: 1"] {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }

  div[style*="display: flex; gap: 10px"] {
    flex-wrap: wrap !important;
  }

  .btn-block {
    width: 100%;
    margin-bottom: 10px;
  }

  .navbar-nav>li {
    margin-right: 0 !important;
    margin-bottom: 2px;
  }

  .nav-pills>li,
  .nav-stacked>li {
    margin-bottom: 8px !important;
  }
}

/* White placeholder for text input when Copy and Paste Text is selected */
[data-theme="dark"] .text-input-white-placeholder #text_input::placeholder {
  color: #ffffff !important;
}

[data-theme="dark"] .text-input-white-placeholder #text_input:-ms-input-placeholder {
  color: #ffffff !important;
}

[data-theme="dark"] .text-input-white-placeholder #text_input::-ms-input-placeholder {
  color: #ffffff !important;
}

/* Prevent multiple hover states in selectize dropdown */
.selectize-dropdown .option {
  transition: none !important;
}

.selectize-dropdown .option:not(.active):not(.selected) {
  background-color: transparent !important;
}

.selectize-dropdown .option.active {
  background-color: #e5e7eb !important;
  color: #111827 !important;
}

[data-theme="dark"] .selectize-dropdown .option.active {
  background-color: #e5e7eb !important;
  color: #111827 !important;
}

/* Remove hover effect, only show active state */
.selectize-dropdown .option:hover:not(.active) {
  background-color: transparent !important;
}

/* Fix info icon action links - prevent them from inheriting button background styles */
#showDFMInfo,
#showPOSInfo,
#showNERInfo,
#showLexDivMetricsInfo,
#showReadabilityMetricsInfo,
#showClusteringInfo,
#showSTMInfo,
#showEmbeddingTopicsInfo,
#showSemanticMethodsInfo,
a.action-link[title*="guide"],
a.action-link[title*="info"],
a.action-link[title*="Guide"],
a.action-link[title*="Info"] {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: #337ab7 !important;
}

#showDFMInfo:hover,
#showPOSInfo:hover,
#showNERInfo:hover,
#showLexDivMetricsInfo:hover,
#showReadabilityMetricsInfo:hover,
#showClusteringInfo:hover,
#showSTMInfo:hover,
#showEmbeddingTopicsInfo:hover,
#showSemanticMethodsInfo:hover,
a.action-link[title*="guide"]:hover,
a.action-link[title*="info"]:hover,
a.action-link[title*="Guide"]:hover,
a.action-link[title*="Info"]:hover {
  background-color: transparent !important;
  color: #1d4ed8 !important;
}

[data-theme="dark"] #showDFMInfo,
[data-theme="dark"] #showPOSInfo,
[data-theme="dark"] #showNERInfo,
[data-theme="dark"] #showLexDivMetricsInfo,
[data-theme="dark"] #showReadabilityMetricsInfo,
[data-theme="dark"] #showClusteringInfo,
[data-theme="dark"] #showSTMInfo,
[data-theme="dark"] #showEmbeddingTopicsInfo,
[data-theme="dark"] [data-theme="dark"] #showSemanticMethodsInfo {
  background-color: transparent !important;
  color: #60a5fa !important;
}

[data-theme="dark"] #showDFMInfo:hover,
[data-theme="dark"] #showPOSInfo:hover,
[data-theme="dark"] #showNERInfo:hover,
[data-theme="dark"] #showLexDivMetricsInfo:hover,
[data-theme="dark"] #showReadabilityMetricsInfo:hover,
[data-theme="dark"] #showClusteringInfo:hover,
[data-theme="dark"] #showSTMInfo:hover,
[data-theme="dark"] #showEmbeddingTopicsInfo:hover,
[data-theme="dark"] [data-theme="dark"] #showSemanticMethodsInfo:hover {
  background-color: transparent !important;
  color: #93c5fd !important;
}


/* Main section labels white */
[data-theme="dark"] .sidebar-panel label[for="dataset_choice"],
[data-theme="dark"] .sidebar-panel .control-label[for="dataset_choice"],
[data-theme="dark"] .sidebar-panel label[for="file"],
[data-theme="dark"] .sidebar-panel label[for="text_input"],
[data-theme="dark"] div.sidebar-panel label[for="dataset_choice"],
[data-theme="dark"] div.sidebar-panel .control-label[for="dataset_choice"],
[data-theme="dark"] .sidebar-panel>div:first-child label:first-of-type {
  color: #f0f6fc !important;
}

/* Override: All tabs EXCEPT Upload - labels white */
[data-theme="dark"] [data-value="Preprocess"] .sidebar-panel label,
[data-theme="dark"] [data-value="Preprocess"] .sidebar-panel .control-label,
[data-theme="dark"] [data-value="Lexical Analysis"] .sidebar-panel label,
[data-theme="dark"] [data-value="Lexical Analysis"] .sidebar-panel .control-label,
[data-theme="dark"] [data-value="Semantic Analysis"] .sidebar-panel label,
[data-theme="dark"] [data-value="Semantic Analysis"] .sidebar-panel .control-label,
[data-theme="dark"] [data-value="Topic Modeling"] .sidebar-panel label,
[data-theme="dark"] [data-value="Topic Modeling"] .sidebar-panel .control-label {
  color: var(--text-primary) !important;
}

/* ============================================
   NER Table Styles - Improved Visibility
   ============================================ */

/* NER table container - better contrast and spacing */
.ner-table-container {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 10px;
}

/* NER badge styling - already handled inline but backup */
.ner-badge {
  font-weight: 500 !important;
  text-shadow: none !important;
  letter-spacing: 0.3px;
}

/* Reduce confusing selection highlighting */
.ner-table-container table.dataTable tbody tr.selected {
  background-color: #e3f2fd !important;
}

.ner-table-container table.dataTable tbody tr.selected td {
  background-color: #e3f2fd !important;
  color: #1a1a1a !important;
}

/* Improve hover state - subtle highlight */
.ner-table-container table.dataTable tbody tr:hover {
  background-color: #f5f5f5 !important;
}

.ner-table-container table.dataTable tbody tr:hover td {
  color: #1a1a1a !important;
}

/* Keep badges visible on selection/hover */
.ner-table-container table.dataTable tbody tr.selected .ner-badge,
.ner-table-container table.dataTable tbody tr:hover .ner-badge {
  color: white !important;
}

/* Filter inputs styling */
.ner-table-container .dataTables_filter input {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
}

/* Dark mode NER table */
[data-theme="dark"] .ner-table-container {
  background-color: #1e293b;
}

[data-theme="dark"] .ner-table-container table.dataTable tbody tr.selected {
  background-color: #5C6E88 !important;
}

[data-theme="dark"] .ner-table-container table.dataTable tbody tr.selected td {
  background-color: #5C6E88 !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .ner-table-container table.dataTable tbody tr:hover {
  background-color: #2d3748 !important;
}

[data-theme="dark"] .ner-table-container table.dataTable tbody tr:hover td {
  color: #e2e8f0 !important;
}

/* NER cell with dropdown */
.ner-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* NER type dropdown select - clean dropdown icon only */
.ner-type-select {
  width: 22px !important;
  height: 20px !important;
  min-width: 22px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  opacity: 0.6;
  transition: opacity 0.2s;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 14px !important;
  color: transparent !important;
}

.ner-type-select:hover {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232196f3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

.ner-type-select:focus {
  opacity: 1;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232196f3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Dropdown options with colors */
.ner-type-select option {
  padding: 4px 8px;
  color: white !important;
}

/* Dark mode NER dropdown */
[data-theme="dark"] .ner-type-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

[data-theme="dark"] .ner-type-select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Make editable cells more visible */
.ner-table-container table.dataTable tbody td.focus {
  outline: 2px solid #2196f3 !important;
  outline-offset: -2px;
}

/* Disable cell edit highlight interference with dropdown */
.ner-table-container table.dataTable tbody td:has(.ner-cell) {
  cursor: default !important;
}

/* ============================================
   Language Menu Dropdown
   ============================================ */
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 14px;
  margin: 0;
  background: none;
  border: none;
  font-size: var(--font-size-sm);  /* 16px - matches small buttons */
  font-family: var(--font-family-body);
  color: #5C6C84;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.lang-btn:hover {
  background: #f3f4f6;
}

.lang-btn i {
  font-size: 16px;
  color: transparent;
  width: 18px;
}

.lang-btn.active {
  background: #f3f4f6;
  color: #5C6C84;
}

.lang-btn.active i {
  color: #5C6C84;
}

/* Dark mode language menu */
[data-theme="dark"] #translate_dropdown {
  background: #1f1f1f;
  border-color: #333;
}

[data-theme="dark"] .lang-btn {
  color: #e5e7eb;
}

[data-theme="dark"] .lang-btn:hover {
  background: #2a2a2a;
}

[data-theme="dark"] .lang-btn.active {
  background: #2a2a2a;
  color: #e5e7eb;
}

[data-theme="dark"] .lang-btn.active i {
  color: #e5e7eb;
}

[data-theme="dark"] .translate-attribution {
  background: #1a1a1a;
  border-color: #333;
  color: #6b7280;
}

/* ============================================
   Domain Entity Selectize - Multi-line Display
   ============================================ */

/* Domain entity selectize inputs - standard height with scroll when needed */
/* Uses attribute selector to match any domain category input (dynamic) */
[id^="domain_"] + .selectize-control .selectize-input,
#uncategorized_tokens + .selectize-control .selectize-input {
  max-height: 100px !important;
  overflow-y: auto !important;
}

/* Dark mode domain selectize */
[data-theme="dark"] [id^="domain_"] + .selectize-control .selectize-input,
[data-theme="dark"] #uncategorized_tokens + .selectize-control .selectize-input {
  background-color: #1e293b !important;
  border-color: #5F7088 !important;
}

