/* Site header & navbar (frontend/includes/header.blade.php).
   Moved out of an inline <style> in <body>; loaded from header_links. */

/* The signed-in strip above the navbar. A darker step of the navbar's own
   gradient, so the two read as one header rather than a white band sitting
   on top of the site. */
.sc-userbar {
  background: linear-gradient(to right, #01011a, #05053f);
  color: #fff;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sc-userbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  padding: .4rem 0;
}

.sc-userbar__identity {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
}

.sc-userbar__avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .12);
  color: #cfd6ff;
  font-size: .75rem;
}

.sc-userbar__who {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.sc-userbar__name {
  font-weight: 600;
  color: #fff;
}

.sc-userbar__email {
  font-size: .74rem;
  color: rgba(255, 255, 255, .62);
  /* Long addresses would otherwise push the buttons off the row. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-userbar__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}

.sc-userbar__link {
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  padding: .28rem .55rem;
  border-radius: 5px;
  transition: background .2s ease, color .2s ease;
}

.sc-userbar__link:hover,
.sc-userbar__link:focus {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.sc-userbar__link--danger:hover,
.sc-userbar__link--danger:focus {
  background: rgba(220, 53, 69, .9);
}

.sc-userbar__btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.sc-userbar__btn:hover,
.sc-userbar__btn:focus {
  background: #fff;
  color: #090979;
  border-color: #fff;
}

.sc-userbar__btn--ghost {
  background: transparent;
}

.sc-userbar__btn--ghost:hover,
.sc-userbar__btn--ghost:focus {
  background: rgba(220, 53, 69, .92);
  color: #fff;
  border-color: transparent;
}

@media (max-width: 575.98px) {
  .sc-userbar__inner {
    justify-content: center;
  }

  .sc-userbar__email {
    display: none;
  }
}

/* Default transparent navbar */
.navbar-transparent {
  position: relative;
  top: 0;
  width: 100%;
  background: linear-gradient(to right, #020024, #090979);
  z-index: 1050;
}

.nav-auth {
  top: 0;
}

.nav-guest {
  top: 0;
}

/* Sticky on scroll */
.navbar-scrolled {
  position: fixed;
  top: 0;
  background: linear-gradient(to right, #020024, #090979);
}

/* Nav item hover styles */
.navbar-nav .nav-item .nav-link {
  position: relative;
  color: white !important;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  border-radius: 4px;
}

/* Hover effect for nav links */
.navbar-nav .nav-item .nav-link:hover {
  color: #070087 !important;
  transform: translateY(-2px);
}

/* Underline animation on hover */
.navbar-nav .nav-item .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;

  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-item .nav-link:hover::after {
  width: 70%;
}

/* Active link style */
.navbar-nav .nav-item .nav-link.active {
  font-weight: 600;
}

.navbar-transparent:not(.navbar-scrolled) .navbar-nav .nav-link.active {
  font-weight: 600;
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* Underline for active link (same as hover) */
.navbar-transparent:not(.navbar-scrolled) .navbar-nav .nav-link.active::after {
  width: 70%;
  height: 2px;
  background-color: #ffffff;
}


.navbar-scrolled .navbar-nav .nav-link.active {
  font-weight: 600;
  color: white !important;
  transform: none;
}

.navbar-scrolled .navbar-nav .nav-link.active::after {
  width: 70%;
  height: 2px;
  background-color: white;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  content: '';
  position: absolute;
}

.navbar-scrolled .navbar-nav .nav-link:hover {
  color: white !important;
  transform: translateY(-2px);
}

.navbar-scrolled .navbar-nav .nav-link:hover::after {
  width: 70%;
  background-color: white;
}


@media (max-width: 991px) {

  .navbar.navbar-transparent {
    background: linear-gradient(to right, #020024, #090979) !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
  }

  /* Ensure navbar is above other content */
  .navbar {
    z-index: 1050 !important;
    background: linear-gradient(to right, #020024, #090979) !important;
    position: fixed !important;
    top: 0;
    width: 100%;
  }

  /* Fix for the collapsible menu */
  .navbar-collapse {
    background: linear-gradient(to right, #020024, #090979) !important;
    padding: 15px;
    margin-top: 10px;
    border-radius: 8px;
    z-index: 1051;
  }

  /* Fix for showing the menu */
  .navbar-collapse.collapse.show {
    display: block !important;
  }

  /* Make sure toggler button works properly */
  .navbar-toggler:focus {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
  }

  /* Remove transparency on mobile */
  .navbar-transparent,
  .navbar-transparent.navbar-scrolled {
    background: linear-gradient(to right, #020024, #090979) !important;
  }

  .navbar-nav .nav-item {
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .navbar-nav {
    gap: 2px !important;
  }

  /* Full-width rows with a comfortable 48px touch target. */
  .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    line-height: 1.25;
    font-size: 15px;
    border-radius: 8px;
    position: relative;
    transition: background-color .2s ease, padding-left .2s ease;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link:focus-visible {
    background: rgba(255, 255, 255, .09);
    color: #fff !important;
    transform: none;
    padding-left: 18px;
  }

  /* On a stacked menu a left accent bar reads far better than an
     underline, and it can't drift out of alignment with the label. */
  .navbar-nav .nav-link::after,
  .navbar-scrolled .navbar-nav .nav-link::after,
  .navbar-transparent:not(.navbar-scrolled) .navbar-nav .nav-link.active::after {
    content: none !important;
  }

  .navbar-nav .nav-link.active,
  .navbar-scrolled .navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, .14);
    color: #fff !important;
    font-weight: 600;
    transform: none;
  }

  .navbar-nav .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    border-radius: 0 3px 3px 0;
    background: #ffffff;
  }

  .navbar-toggler {
    border-color: rgba(255, 255, 255, .35);
    padding: 8px 10px;
  }

  /* The menu can outgrow a short landscape viewport. */
  .navbar-collapse {
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
