/*
 * 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.
 */

/* Centered modal dialog. A native <dialog> opened with showModal() is centered
   by the browser via `margin: auto`, but the Tailwind reset zeroes that margin,
   pinning it to the top-left. Restore it here (this beats the utility reset);
   the UA still supplies position:fixed + inset:0 for the modal. */
dialog.app-modal {
  margin: auto;
}

/* Tom Select custom styles */
.ts-wrapper .ts-control {
  font-size: 1rem; /* Match form font size */
  padding: 0.5rem 0.75rem; /* Match py-2 px-3 */
}

.ts-wrapper .ts-control input {
  font-size: 1rem;
}

.ts-dropdown .ts-dropdown-content {
  font-size: 1rem;
}

.ts-dropdown .option {
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
}

/* intl-tel-input: force wrapper to block/full-width so it sits below the label */
.iti {
  display: block !important;
  margin-top: 0.5rem;
}

/* Trix: trim toolbar to the buttons we want (bold, italic, bullet list). */
trix-toolbar .trix-button-group--file-tools,
trix-toolbar .trix-button-group--history-tools,
trix-toolbar [data-trix-attribute="strike"],
trix-toolbar [data-trix-attribute="href"],
trix-toolbar [data-trix-attribute="heading1"],
trix-toolbar [data-trix-attribute="quote"],
trix-toolbar [data-trix-attribute="code"],
trix-toolbar [data-trix-attribute="number"],
trix-toolbar [data-trix-action="decreaseNestingLevel"],
trix-toolbar [data-trix-action="increaseNestingLevel"] {
  display: none;
}

/* Trix editors are contenteditable divs, so they already grow with their
   content (actiontext.css gives them min-height: 5em and no ceiling). Add the
   ceiling: without it a pasted 50-line note pushes Save off the screen. Matches
   the max-h-96 on the plain textareas that use field-sizing-content. */
trix-editor {
  max-height: 24rem;
  overflow-y: auto;
}

/* Restore list markers — Tailwind preflight strips them. */
.trix-content ul,
trix-editor ul {
  list-style: disc;
  padding-left: 1.5rem;
}
.trix-content ol,
trix-editor ol {
  list-style: decimal;
  padding-left: 1.5rem;
}

/* Brief green ring that fades out, flagging a field the app just auto-updated
   (e.g. travel time re-synced after a billable-distance change, or the base fee).
   Green (not blue) so it doesn't clash with the blue focus outline. */
@keyframes field-flash {
  0% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.7); }
  100% { box-shadow: 0 0 0 2px rgba(34, 197, 94, 0); }
}
.field-flash {
  animation: field-flash 2.5s ease-out;
  border-radius: 0.375rem; /* match the inputs' rounded-md so the ring hugs the border */
}
