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

button, [role="button"], label[for], summary {
  cursor: pointer;
}

/* ── Turbo progress bar ──────────────────────────────────────────────────── */
/* Default colour is blue — override to match the app's indigo-500 accent.   */
.turbo-progress-bar {
  height: 3px;
  background-color: #6366f1;
}

/* ── Tooltips ──────────────────────────────────────────────────────────────
   Usage: add data-tooltip="Your text" to any element.
   The tooltip appears above the element by default.
   Add data-tooltip-dir="down" to flip it below the element.          */

/* Only add relative positioning for elements not already positioned by Tailwind.
   Elements with .absolute, .fixed, or .sticky keep their own position value
   so their layout is not disrupted when data-tooltip is set via JavaScript. */
[data-tooltip]:not(.absolute):not(.fixed):not(.sticky) {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px;
  background: rgb(15 23 42);
  border: 1px solid rgba(255 255 255 / 0.12);
  color: rgb(203 213 225);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  z-index: 200;
}

[data-tooltip][data-tooltip-dir="down"]::after {
  bottom: auto;
  top: calc(100% + 6px);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* Hide tooltip immediately when the button is clicked/tapped (e.g. opens a modal) */
[data-tooltip]:active::after {
  opacity: 0;
  transition: none;
}

/* Never show tooltips on touch-primary devices — hover doesn't exist there */
@media (hover: none) {
  [data-tooltip]::after {
    display: none;
  }
}
