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

/* /parcels orders tab: inline edit controls (cost input + save + delete) are
   hidden by default and only shown once the page's "編輯模式" checkbox is
   on. Driven by a plain CSS descendant selector — not JS toggling individual
   elements — so a parcel row that gets replaced by a Turbo Stream after a
   save renders correctly hidden/shown with no re-application step. See
   app/javascript/controllers/edit_mode_controller.js.

   Deliberately kept here (Propshaft-served as-is) rather than in
   app/assets/tailwind/application.css: that file only takes effect after
   `bin/rails tailwindcss:build` regenerates app/assets/builds/tailwind.css,
   a step that has to run before the rule exists at all. (CI's system-test job
   does run it — see .github/workflows/ci.yml — but a rule served as-is by
   Propshaft cannot be missing in the first place.) */
.parcels-edit-col {
  display: none;
}
.parcels-editing .parcels-edit-col {
  display: table-cell;
}

/* Rows a split/merge Turbo Stream just inserted or rewrote. The list changes
   underneath the operator with no page reload, so the affected rows have to
   announce themselves — but the colour decays rather than sticking, because it
   means "this just changed", not a durable state of the package.

   Here rather than in the Tailwind source for the same reason as the rule
   above: Propshaft serves this file as-is, with no build step to forget. */
@keyframes package-row-flash {
  from { background-color: rgb(254 249 195); }
  to   { background-color: transparent; }
}

.package-row-flash {
  animation: package-row-flash 2s ease-out;
}
