/*
 * 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;
}

a.workspace-button,
a.workspace-button:visited {
  text-decoration: none;
}

a.workspace-button.workspace-button--primary,
a.workspace-button.workspace-button--primary:visited,
a.workspace-button.workspace-button--primary:hover,
a.workspace-button.workspace-button--primary:focus,
a.workspace-button.workspace-button--success,
a.workspace-button.workspace-button--success:visited,
a.workspace-button.workspace-button--success:hover,
a.workspace-button.workspace-button--success:focus,
a.workspace-button.workspace-button--danger,
a.workspace-button.workspace-button--danger:visited,
a.workspace-button.workspace-button--danger:hover,
a.workspace-button.workspace-button--danger:focus,
a.workspace-button.workspace-button--info,
a.workspace-button.workspace-button--info:visited,
a.workspace-button.workspace-button--info:hover,
a.workspace-button.workspace-button--info:focus,
a.workspace-button.btn-primary,
a.workspace-button.btn-primary:visited,
a.workspace-button.btn-primary:hover,
a.workspace-button.btn-primary:focus,
a.workspace-button.btn-success,
a.workspace-button.btn-success:visited,
a.workspace-button.btn-success:hover,
a.workspace-button.btn-success:focus {
  color: #ffffff;
}

a.workspace-button.workspace-button--secondary,
a.workspace-button.workspace-button--secondary:visited,
a.workspace-button.workspace-button--secondary:hover,
a.workspace-button.workspace-button--secondary:focus,
a.workspace-button.btn-secondary,
a.workspace-button.btn-secondary:visited,
a.workspace-button.btn-secondary:hover,
a.workspace-button.btn-secondary:focus,
a.workspace-button.btn-outline,
a.workspace-button.btn-outline:visited,
a.workspace-button.btn-outline:hover,
a.workspace-button.btn-outline:focus,
a.workspace-button.btn-outline-secondary,
a.workspace-button.btn-outline-secondary:visited,
a.workspace-button.btn-outline-secondary:hover,
a.workspace-button.btn-outline-secondary:focus {
  color: #334155;
}

a.workspace-button.workspace-button--ghost,
a.workspace-button.workspace-button--ghost:visited,
a.workspace-button.workspace-button--ghost:hover,
a.workspace-button.workspace-button--ghost:focus {
  color: #0f172a;
}

a.workspace-button.workspace-button--warning,
a.workspace-button.workspace-button--warning:visited,
a.workspace-button.workspace-button--warning:hover,
a.workspace-button.workspace-button--warning:focus {
  color: #0f172a;
}

/* Unlayered workspace pills so they override Bootstrap's author styles */
.workspace-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  background: #ffffff;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

a.workspace-chip,
a.workspace-chip:visited {
  color: #475569;
  text-decoration: none;
}

a.workspace-chip:hover,
a.workspace-chip:focus {
  border-color: #cbd5e1;
  color: #0f172a;
  text-decoration: none;
}

.workspace-chip.is-active {
  border-color: #bae6fd;
  background: #f0f9ff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

a.workspace-chip.is-active,
a.workspace-chip.is-active:visited,
a.workspace-chip.is-active:hover,
a.workspace-chip.is-active:focus {
  color: #0f172a;
  text-decoration: none;
}

/* Legacy badge helper output collided with Bootstrap's .bg-* utilities. Keep these app-owned. */
.badge,
.letter-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25rem;
  letter-spacing: 0.08em;
  color: #334155;
}

.badge-sm {
  padding: 0.125rem 0.5rem;
  font-size: 10px;
}

.badge.bg-primary,
.badge--primary,
.letter-badge.primary {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.badge.bg-success,
.badge--success,
.letter-badge.success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.badge.bg-warning,
.badge--warning,
.letter-badge.warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.badge.bg-danger,
.badge--danger,
.letter-badge.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.badge.bg-info,
.badge--info,
.letter-badge.info {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}

.badge.bg-secondary,
.badge--secondary,
.letter-badge.secondary,
.badge.bg-dark,
.badge--dark,
.letter-badge.dark {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

/* 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);
}
