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

.app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  padding: 0.625rem 0.875rem;
  background-color: #2563eb;
  color: #fff;
  font-weight: 500;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
  border: 0;
  appearance: none;
}

.app-btn:hover {
  background-color: #3b82f6;
  color: #fff;
  text-decoration: none;
}

.app-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.app-btn--small {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.app-btn--secondary {
  background-color: #f3f4f6;
  color: #111827;
  box-shadow: none;
}

.app-btn--secondary:hover {
  background-color: #e5e7eb;
  color: #111827;
}

.app-btn--secondary:focus {
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

.app-btn--block {
  display: flex;
  width: 100%;
}

.app-btn--danger {
  background-color: #dc2626;
}

.app-btn--danger:hover {
  background-color: #ef4444;
}

.app-btn--danger:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25);
}

/* Tailwind utility classes can't target the ::backdrop pseudo-element a native
   <dialog> renders behind itself when shown via showModal(), so this is plain CSS. */
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Browsers centre a modal <dialog> via a UA-stylesheet margin: auto, but Tailwind's
   preflight reset zeroes margins on every element, which cancels that out and leaves
   the dialog pinned to its inset: 0 anchor (top-left). Centre it explicitly instead. */
dialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}
