/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Lexxy Editor Dark Mode Overrides - Force Light Background */
lexxy-editor {
  background-color: white !important;
  color: #1f2937 !important;
}

lexxy-editor .lexxy-editor__content {
  background-color: white !important;
  color: #1f2937 !important;
}

lexxy-toolbar {
  background-color: #f9fafb !important;
  border-color: #d1d5db !important;
}

lexxy-toolbar .lexxy-editor__toolbar-button {
  color: #374151 !important;
  background-color: transparent !important;
}

lexxy-toolbar .lexxy-editor__toolbar-button:hover {
  background-color: #f3f4f6 !important;
}

lexxy-toolbar .lexxy-editor__toolbar-button.lexxy-editor__toolbar-button--active {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* Target any contenteditable areas within lexxy-editor */
lexxy-editor [contenteditable] {
  background-color: white !important;
  color: #1f2937 !important;
}

/* Ensure any nested elements also use light styling */
lexxy-editor * {
  color: inherit !important;
}

/* Folder Menu - Details/Summary Chevron Rotation */
details[open] > summary .chevron {
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

details:not([open]) > summary .chevron {
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
}

/* Search Highlights */
.search-highlight em {
  font-style: normal;
  font-weight: 400;
  background-color: #fef08a;
  padding: 0 2px;
}

.dark .search-highlight em {
  background-color: #854d0e;
  color: #fef08a;
}

/* Review Letter Form - Radio Button Labels */
input[type='radio'][name='new_state'] {
  display: none;
}

label[for^="new_state_"].active {
  background-color: currentColor !important;
  color: white !important;
}

label[for^="new_state_"].active.border-cyan-600 {
  background-color: rgb(8 145 178) !important;
}

label[for^="new_state_"].active.border-green-600 {
  background-color: rgb(22 163 74) !important;
}

label[for^="new_state_"].active.border-blue-600 {
  background-color: rgb(37 99 235) !important;
}

/* Tom Select - Remove double border by removing the wrapper border when it has form-control or form-select class */
.ts-wrapper.form-control,
.ts-wrapper.form-select {
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

/* Ensure the control maintains the Bootstrap form-control/form-select styling */
.ts-wrapper.form-control .ts-control,
.ts-wrapper.form-select .ts-control {
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  min-height: calc(1.5em + 0.75rem + 2px);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.25rem;
}

/* Multi-select specific styling */
.ts-wrapper.form-control.multi .ts-control,
.ts-wrapper.form-select.multi .ts-control {
  padding: 0.375rem 0.75rem;
  height: auto;
}

/* Focus state to match Bootstrap form controls */
.ts-wrapper.form-control.focus .ts-control,
.ts-wrapper.form-select.focus .ts-control {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
