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

/*
 * LiveCable panel visibility.
 *
 * Keyed on data-live-status-value, which is a Stimulus value on the live
 * controller and therefore survives hydration. Do NOT scope these on
 * [live-component]: that attribute is server-rendered only, and LiveCable
 * converts it into data-live-* Stimulus attributes in the browser, so any
 * rule depending on it silently stops matching once the page is live.
 *
 * data-panel and data-active are ours. Panels are hidden by default so
 * nothing half-formed shows before the socket subscribes, and start/stop
 * changes exactly one attribute, which lets LiveCable reuse static markup.
 *
 * Deliberately not using Tailwind's .hidden: its utilities live in a cascade
 * layer, and these unlayered rules would outrank them.
 */
[data-panel] { display: none; }

[data-live-status-value]:not([data-live-status-value="subscribed"]) [data-panel="connecting"] {
  display: flex;
}

[data-live-status-value="subscribed"] [data-panel][data-active="true"] { display: flex; }

/* Anything mid-flight dims until the server answers. */
[live-loading] { opacity: 0.6; cursor: wait; }
