/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

/* ---------------------------------------------------------------------
   OPT-60917 — Design tokens sourced from the Brady Sticky design system
   (https://zeroheight.com/2a5eb2fa1/p/59bbb8-sticky — Foundations/Color
   and Foundations/Text). Values below are taken directly from Sticky's
   published palette and type scale, not approximated.
   --------------------------------------------------------------------- */
:root {
  /* Sticky Primary — BradyBlue-70, "the foundational color of the
     system... should be the dominant color of the site." */
  --color-brand-primary: #05408e;
  --color-brand-primary-contrast: #ffffff;
  /* Sticky Text/Color: "In general, type should be either black or white." */
  --color-text: #000000;
  --color-text-muted: #676767; /* Sticky Neutral Gray-60 */
  --color-surface: #ffffff;
  --color-surface-alt: #f2f2f2; /* Sticky Neutral Gray-10 */
  /* Sticky Neutral Gray-60 — Gray-40 is also "commonly used" per Sticky but
     only reaches 2.27:1 against white, short of the WCAG 2.1 AA 3:1 minimum
     for UI-component boundaries; Gray-60 clears it at 5.66:1. */
  --color-border: #676767;
  --color-focus-ring: #05408e;
  /* Sticky Semantic Error-70 as a solid background with white text: Error-70
     text on the paired Error-10 background is only 4.28:1, short of the
     4.5:1 AA minimum for normal text, so this uses two Sticky-named tokens
     in a combination that actually passes (5.03:1). */
  --color-error: #ffffff;
  --color-error-bg: #d82222;

  --font-family-base: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  --radius-base: 4px;
}

/* Sticky Text/Font Styles: root em is 16px up to 1023px, 18px from 1024px+,
   so all rem-based sizing below scales responsively without extra rules. */
html {
  font-size: 16px;
}

@media (min-width: 1024px) {
  html {
    font-size: 18px;
  }
}

body {
  font-family: var(--font-family-base);
  color: var(--color-text);
  margin-bottom: 60px;
}

/* Sticky Text/Font Styles — Headings table (size/line-height/weight per
   breakpoint; margin is "1em 0 .5em" unless immediately preceded by
   another heading). */
h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  color: var(--color-text);
  margin: 1em 0 0.5em;
}

h1 + h2, h1 + h3, h1 + h4, h1 + h5, h1 + h6,
h2 + h3, h2 + h4, h2 + h5, h2 + h6,
h3 + h4, h3 + h5, h3 + h6,
h4 + h5, h4 + h6,
h5 + h6 {
  margin-top: 0;
}

h1 {
  font-size: 1.875rem;
  line-height: 1.25;
}

h2 {
  font-size: 1.625rem;
  line-height: 1.4;
}

h3 {
  font-size: 1.375rem;
  line-height: 1.4;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.4;
}

h5 {
  font-size: 1.125rem;
  line-height: 1.4;
}

h6 {
  font-size: 1rem;
  line-height: 1.4;
}

@media (min-width: 1024px) {
  h1 {
    font-size: 2.25rem;
  }
}

@media (min-width: 1400px) {
  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 1.875rem;
  }

  h3 {
    font-size: 1.5rem;
  }
}

p {
  font-size: 1rem;
  line-height: 1.625;
  font-weight: 400;
  margin: 0 0 1em;
}

li {
  font-size: 1rem;
  line-height: 1.5;
}

ul, ol {
  margin: 0 0 1.5em;
}

/* WCAG 2.1 AA — 2.3.3-adjacent good practice: respect the User's reduced-motion
   preference for any transition/animation introduced by this or future work. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a {
  color: var(--color-brand-primary);
}

/* WCAG 2.1 AA, 2.4.7 Focus Visible — every interactive element gets a visible
   focus indicator, not just the Bootstrap .btn/.form-control subset below. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 2px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--color-focus-ring);
}

html {
  position: relative;
  min-height: 100%;
}

.footer {
  position: relative !important;
  bottom: auto !important;
  white-space: normal !important;
  line-height: normal !important;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.footer__content {
  text-align: center;
}

.footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
}

.footer__legal-links a,
.footer__legal-links p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.footer__legal-links a:hover,
.footer__legal-links a:focus-visible {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

.footer__legal-links span {
  color: var(--color-border);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 0.5rem;
  z-index: 1050;
  background: var(--color-brand-primary);
  color: var(--color-brand-primary-contrast);
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius-base) var(--radius-base);
}

.skip-link:focus {
  top: 0;
}

.site-header .navbar {
  min-height: 4rem;
}

.navbar-brand-logo {
  height: 1.75rem;
  width: auto;
  display: block;
}

.navbar-brand-text {
  color: var(--color-brand-primary);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

@media (min-width: 576px) {
  .site-header .navbar .container {
    position: relative;
  }

  .navbar-brand-centered {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin-right: 0;
  }
}

.header__user-section {
  gap: var(--space-2);
}

.header__user-section .username {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
}

.header__signout-btn {
  white-space: nowrap;
}

.page-content {
  container-type: inline-size;
  container-name: page-content;
}

/* ---------------------------------------------------------------------
   Container listing (Home Page) + Browse drill-down — Brady Sticky
   alignment, responsive layout (container queries, no horizontal
   overflow), and WCAG 2.1 AA fixes.
   --------------------------------------------------------------------- */

.container-list-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-base);
  margin-bottom: var(--space-4);
  container-type: inline-size;
  container-name: banner;
}

.container-list-banner__image {
  display: block;
  width: 100%;
  height: auto;
}

.container-list-title {
  /* Overlaid on the banner image, matching the original design's white
     title-on-image treatment; Sticky primary as the legibility backdrop
     rather than a plain dark scrim. */
  position: absolute;
  inset: auto 0 0 0;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-brand-primary);
  color: var(--color-brand-primary-contrast);
}

/* Container query (not a fixed viewport breakpoint) — the banner shrinks its
   heading whenever ITS OWN box is narrow, regardless of where it's placed. */
@container banner (max-width: 420px) {
  .container-list-title {
    font-size: 1.35rem;
  }
}

.container-list-intro {
  font-size: 1rem;
  margin-bottom: var(--space-5);
}

/* Browse drill-down trail — the current location is what matters most on
   this page (there's no other page title), so it gets a distinct surface
   and a bold current crumb rather than Bootstrap's plain-text default. */
.container-breadcrumb-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  background-color: var(--color-surface-alt);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-base);
  /* Matches .list-group-item's own border so the breadcrumb reads as the
     same kind of surface as the joined browse-list items below it. */
  border: var(--bs-list-group-border-width, 1px) solid
    var(--bs-list-group-border-color, var(--bs-border-color));
  margin-bottom: 0;
}

.container-breadcrumb {
  margin: 0;
}

.container-breadcrumb .breadcrumb-item a {
  color: var(--color-brand-primary);
  font-weight: 500;
}

.container-breadcrumb .breadcrumb-item a[aria-current="page"] {
  font-weight: 700;
  color: var(--color-text);
}

/* Legal/security-risk advisory — reuses the same error color pairing as
   .alert-danger (already vetted at 5.03:1 contrast) so the callout reads
   as strongly as the original design's red text, but stays WCAG AA safe. */
.container-list-notice {
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-error-bg);
  color: var(--color-error);
  border-radius: var(--radius-base);
}

.notification-message {
  text-align: center;
  margin-top: var(--space-6);
  font-size: 1.1rem;
}

/* Prevents whole-page horizontal overflow on narrow viewports: the table
   itself may scroll internally instead of blowing out the layout. */
.table-scroll {
  overflow-x: auto;
}

.container-list-table {
  width: 100%;
  min-width: 20rem;
  border-collapse: collapse;
}

.container-list-table th,
.container-list-table td {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  overflow-wrap: anywhere;
}

.container-list-table tbody tr:nth-child(even) {
/*
    Remove background-color from even rows as requested by UX team. If you want to keep the alternate row coloring, uncomment the line below.
    https://bradyagile.atlassian.net/browse/OPT-61621
background-color: var(--color-surface-alt);
*/
}

/* Browse drill-down directory/asset listing. */
.browse-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-wrap: anywhere;
}

/* Zebra striping removed per UX request (OPT-61621) to keep the drill-down
   listing visually uniform, matching .container-list-table's treatment.
   https://bradyagile.atlassian.net/browse/OPT-61621 */
.browse-list > li:nth-child(even) {
/*
background-color: var(--color-surface-alt);
*/
}

/* Browse.cshtml-only modifier: visually joins the directory/asset list to the
   .container-breadcrumb-nav immediately above it (matching horizontal inset,
   no gap between the two) so they read as one related block. Additive only —
   the base .browse-list rule above (shared with Pages/Index.cshtml, which has
   no breadcrumb to join to) is left unchanged. */
.browse-list--joined {
  margin-top: 0;
  padding: 0 var(--space-4);
}

/* Asset name/size + Download button row — button pinned to the right edge,
   wrapping onto its own line if the row gets too narrow for both. */
.asset-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.asset-row__name {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.asset-row .BR-Btn1 {
  margin-left: auto;
}

/* Firmware Asset metadata (File Name/Size/Format/Release Date/Replacing/Description) —
   replaces the previous Bootstrap grid ".row" misuse on a <dl> with a real
   CSS Grid layout that also collapses to one column via a container query
   once its own box is too narrow for a label/value pair. */
.browse-metadata {
  container-type: inline-size;
  container-name: metadata;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
  margin: var(--space-2) 0 0;
}

.browse-metadata dt {
  font-weight: 600;
}

.browse-metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

@container metadata (max-width: 22rem) {
  .browse-metadata {
    grid-template-columns: 1fr;
  }
}

.BR-Btn1,.BR-Btn2,.BR-Btn3,.BR-Btn5,.BR-CheckoutForm__Button {
    background: #043f8d;
    border: 3px solid #fff;
    border-radius: .75rem;
    box-shadow: 0 0 10px hsla(0,0%,60%,.5);
    display: inline-block;
    font-weight: 500;
    padding: .65rem 1rem .6rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: all .2s;
    text-align: center;
    color: #fff
}

.BR-Btn1:focus,.BR-Btn1:hover,.BR-Btn2:focus,.BR-Btn2:hover,.BR-Btn3:focus,.BR-Btn3:hover,.BR-Btn5:focus,.BR-Btn5:hover,.BR-CheckoutForm__Button:focus,.BR-CheckoutForm__Button:hover {
    border-color: #00abd3;
    color: #fff
}

.BR-Btn1--Disabled:hover {
    border-color: #fff
}

.BR-Btn2,.BR-Btn3 {
    background: none;
    border: none;
    box-shadow: none;
    color: #043f8d;
    font-size: 1rem;
    padding: 0
}

.BR-Btn2__ArrowGraphic:after {
    opacity: 0;
    position: relative;
    right: 2rem;
    top: .05em;
    display: block;
    width: 0;
    height: 0;
    border: .4em inset;
    content: "";
    border-right-width: 0;
    border-left-style: solid;
    border-color: transparent transparent transparent #333;
    transition: all .2s;
    display: inline-block
}

.BR-Btn2:hover,.BR-Btn3:hover {
    color: #043f8d
}

.BR-Btn2:hover:after,.BR-Btn3:hover:after {
    opacity: 1;
    right: 0
}

.BR-Btn3 {
    color: #000
}

.BR-Btn3:hover {
    color: #043f8d
}

.BR-Btn4 {
    text-decoration: none;
    display: inline-flex;
    align-items: center
}

.BR-Btn4__Icon {
    fill: currentColor;
    height: 1rem;
    margin-left: .4375rem;
    min-width: 1rem;
    width: 1rem
}

.BR-Btn5 {
    background: #fff;
    border: 3px solid #043f8d;
    border-radius: .75rem;
    box-shadow: 0 0 10px hsla(0,0%,60%,.5);
    color: #043f8d;
    display: inline-block;
    font-weight: 500;
    padding: .65rem 1rem .6rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: all .2s;
    border: 2px solid #043f8d
}

.BR-Btn5:focus,.BR-Btn5:hover {
    border-color: #00abd3;
    color: #043f8d
}

.BR-Btn5:hover {
    background: #fff;
    color: #0660d7
}

.BR-Btn5--Disabled:hover {
    border-color: #043f8d;
    color: #043f8d
}

.BR-BtnReset {
    box-shadow: none;
    width: 100%;
    height: 100%;
    text-transform: none;
    text-align: left;
    font-weight: 400;
    padding: 0
}

.BR-BtnReset,.BR-BtnReset:focus,.BR-BtnReset:hover {
    background: none;
    border: none;
    color: #03387e
}

.BR-LinkBtn {
    background: none;
    border: none;
    box-shadow: none;
    color: #043f8d;
    font-weight: 400;
    padding: 0 .125rem;
    text-transform: none;
    font: 16px/26px Roboto,sans-serif
}

.BR-LinkBtn:focus,.BR-LinkBtn:hover {
    background: none;
    color: #0660d7
}

.BR-LinkBtn:focus {
    border-radius: initial
}

.BR-ImgBtn {
    border-radius: 13px;
    box-shadow: 0 0 10px rgba(0,0,10,.5);
    display: inline-block;
    overflow: hidden;
    position: relative;
    width: 213px;
    transform: translate(0);
    transition: all .2s
}

.BR-ImgBtn:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,.4)
}

.BR-ImgBtnText {
    bottom: 0;
    color: #000;
    font-size: .8rem;
    font-weight: 500;
    margin-bottom: .5em;
    left: 50%;
    max-width: 95%;
    position: absolute;
    right: 0;
    text-transform: uppercase;
    width: 100%;
    transform: Translate(-50%,0)
}

.alert {
  overflow-wrap: anywhere;
}

/* Sticky Semantic Error-70, replacing Bootstrap's default danger palette
   so error messaging matches the design system's tokens. */
.alert-danger {
  color: var(--color-error);
  background-color: var(--color-error-bg);
  border-color: var(--color-error-bg);
}

/* ---------------------------------------------------------------------
   OPT-63399 — Static Welcome message page (/Welcome)
   --------------------------------------------------------------------- */
.welcome-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-base);
  padding: var(--space-5);
  max-width: 42rem;
  width: 100%;
  margin: var(--space-5) auto;
  background-color: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.welcome-card__title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--color-brand-primary);
  overflow-wrap: break-word;
  word-break: break-word;
}

.welcome-card__body {
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}

.welcome-card__body p {
  margin-bottom: var(--space-3);
}

.welcome-card__body p:last-child {
  margin-bottom: 0;
}

.welcome-card__actions {
  display: flex;
  justify-content: flex-start;
  margin-top: var(--space-2);
}

.welcome-card__actions .BR-Btn1 {
  white-space: normal;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 360px) {
  .welcome-card {
    padding: var(--space-3);
    margin: var(--space-3) auto;
  }

  .welcome-card__title {
    font-size: 1.2rem;
  }
}
