/*
 * 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.
 */
@import "https://cdn.jsdelivr.net/npm/bulma@1.0.4/css/bulma.min.css";

:root {
  --bulma-family-primary:
    var(--fg-font-primary), Inter, SF Pro, Segoe UI, Roboto, Oxygen, Ubuntu,
    Helvetica Neue, Helvetica, Arial, sans-serif;

  /* Adjust danger color to be less pink */
  --bulma-danger-h: 360deg;
  --bulma-danger-s: 87%;
  --bulma-danger-l: 71%;

  /* Adjust link color to match this blue (#0073b9) */
  --bulma-link-h: 203;
  --bulma-link-s: 100%;
  --bulma-link-l: 36%;
  --bulma-link-on-scheme-l: 36%;

  /* Bulma's default title weight (extrabold/800) isn't one of the weights the Barlow import above
     loads, so browsers fall back to a thin unstyled weight instead. Semibold is loaded and reads as
     properly bold, so titles stand out everywhere they're used. */
  --bulma-title-weight: var(--bulma-weight-semibold);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Keep tags a consistent regular weight everywhere. The second selector beats
   Bulma's `.title span`/`.subtitle span` (0,1,1) which otherwise forces tags in
   a title to inherit the heading weight. */
.tag,
.title .tag,
.subtitle .tag {
  font-weight: 400;
}
/* Toasts are fixed at 9998-9999, so the navbar has to outrank them or its dropdowns (the account
   switcher in particular) end up underneath. */
.navbar {
  z-index: 10000;
}
/* Flash toast popup */
.flash-toast {
  position: fixed;
  top: 4.5rem;
  right: 1.5rem;
  z-index: 9999;
  min-width: 18rem;
  max-width: 28rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: opacity 0.6s ease;

  /* Lay the dismiss button out beside the message instead of Bulma's default overlay. */
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;

  > span {
    flex-grow: 1;
  }

  /* Bulma absolutely positions this over the message; relative keeps the cross bars, which are
     positioned against the button itself, intact. */
  > .delete {
    position: relative;
    top: auto;
    inset-inline-end: auto;
    flex-shrink: 0;
  }
}
/* Pinned status toast (e.g. demand data refreshing); sits bottom-right to stay clear of the
   transient flash toasts. The transition is load-bearing: the success state fades itself out on
   transitionend, which never fires without it. */
.status-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9998;
  min-width: 18rem;
  max-width: 28rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: opacity 0.6s ease;
}
/* FG Admin navigation */
.is-fullheight.columns {
  min-height: calc(100vh - 3.5rem);
  margin-top: 0;
  margin-right: 0;
  > .column {
    padding: 1.75rem;
  }
}
/* Account switcher: the remove button sits on top of the full-width switch button */
.navbar-dropdown .account-switcher-item {
  position: relative;

  /* Bulma reserves this room only on a.navbar-item, and ours is a button. */
  button.navbar-item {
    padding-inline-end: 3rem;
  }

  .account-switcher-remove {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
  }
}
/* Account switcher: button_to with block puts class on the button, not the form */
.navbar-dropdown form.button_to {
  button.navbar-item {
    width: 100%;
    background: none;
    border: none;

    &:hover {
      background-color: hsl(
        var(--bulma-navbar-dropdown-item-h),
        var(--bulma-navbar-dropdown-item-s),
        calc(
          var(--bulma-navbar-dropdown-item-background-l) +
            var(--bulma-navbar-item-hover-background-l-delta)
        )
      );
    }

    &.is-active {
      background-color: hsl(
        var(--bulma-navbar-item-selected-h),
        var(--bulma-navbar-item-selected-s),
        var(--bulma-navbar-item-selected-background-l)
      );
      color: hsl(
        var(--bulma-navbar-item-selected-h),
        var(--bulma-navbar-item-selected-s),
        var(--bulma-navbar-item-selected-color-l)
      );
    }
  }
}
/* Breadcrumbs */
.breadcrumb {
  a {
    padding: 0;
  }
  li + li::before {
    padding: 0 0.75rem;
  }
}

/* Filtering Dropdowns */
.dropdown .dropdown-close { display: none; }
.dropdown.is-active .dropdown-chevron { display: none; }
.dropdown.is-active .dropdown-close { display: inline; }

/* Use for smaller font size in the tire prices table header */
.tire-prices-table tr th {
  font-size: 14px;
}

.no-break {
  white-space: nowrap;
}

/* One line of long text, cut with an ellipsis at the width of its container.
   A table cell grows to fit its content, so 100% caps nothing there; inside a
   table the cap comes from --ellipsis-width, which a table can set for itself. */
.text-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

td .text-ellipsis {
  max-width: var(--ellipsis-width, max(150px, 25vw));
}

/* Balanced columns at a set width each (`balanced_columns clip: true`). A dropdown menu sizes
   to its widest content, so without one a long item stretches the menu off the page. */
.clipped-columns {
  width: min(calc(var(--column-count) * 16rem), 90vw);
}

.clipped-columns > .column {
  min-width: 0;
  overflow: hidden;
}

/* Client tier badges, styled like videogame item rarities.
   Tier 1 (highest value) = Legendary, descending to Tier 4 = Uncommon. */
.tier-badge {
  color: #fff;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
/* Tier 4 — Uncommon (green) */
.tier-badge.tier-4 {
  background: linear-gradient(135deg, #56ab5b, #3d8b41);
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.45);
}
/* Tier 3 — Rare (blue) */
.tier-badge.tier-3 {
  background: linear-gradient(135deg, #4a9df5, #2f6fed);
  box-shadow: 0 0 7px rgba(47, 111, 237, 0.5);
}
/* Tier 2 — Epic (purple) */
.tier-badge.tier-2 {
  background: linear-gradient(135deg, #b06bf0, #8a3fe0);
  box-shadow: 0 0 8px rgba(155, 81, 224, 0.55);
}
/* Tier 1 — Legendary (gold, with a moving shine and a warm glow) */
.tier-badge.tier-1 {
  background: linear-gradient(110deg, #f7b733 0%, #ffd76f 35%, #f7b733 50%, #e69512 100%);
  background-size: 200% 100%;
  color: #4a2d00;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 230, 150, 0.8);
  box-shadow: 0 0 10px rgba(247, 183, 51, 0.7);
  animation: tier-legendary-shine 3s linear infinite;
}
@keyframes tier-legendary-shine {
  0% { background-position: 200% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .tier-badge.tier-1 { animation: none; }
}

/* Skeleton loading placeholder: a shimmering bar shown while remote content loads */
/* Usage: <span class="skeleton" style="width: 58px; height: 13px;"> */
.skeleton {
  display: inline-block;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.heading-tag {
  color: #1a73c7;
  background-color:#eef3f9;
  font-weight: 600 !important;
}

.heading-hr {
  height: 1px;
  margin: 8px 0;
}

/* FG Admin on phones */
.table-search > .control:first-child .input {
  width: 300px;
}

.contact-dropdown-content {
  width: min(22rem, calc(100vw - 3.5rem));
}

@media screen and (max-width: 768px) {
  .admin-menu-column {
    padding: 0;
  }

  .admin-menu-column .admin-menu {
    padding: 1rem;
  }

  .admin-menu:not(.is-active) {
    display: none;
  }

  .table-search {
    flex-wrap: wrap;
  }

  .table-search > .control:first-child {
    flex: 1 1 100%;
  }

  .table-search > .control:first-child .input {
    width: 100%;
  }

  .contact-dropdown.is-right .dropdown-menu {
    left: auto;
    right: 0;
  }
}
