/**********/
/* HEADER */
/**********/
.header {
  display: grid;
  /* grid-template-columns: 12rem 1fr 22rem; */
  /* grid-template-columns: 6.7% 1fr 11%; */
  grid-template-columns: 6.7% 1fr auto;
  /* overflow: hidden; */
  border-bottom: 1px dotted #555;
  /* backdrop-filter moved to ::before - a backdrop-filter on the header itself
     would stop the user dropdown (a child) from blurring the page below */
  position: sticky;
  top: 0;
  z-index: 100;
}

.header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Logo link to index - no hover effect */
.logo-link {
  display: block;
}

/* Logo - transparent SVG, sits on the same blurred header background */
.logo-header {
  display: block;
  width: 100%;
  height: 12rem;
  padding: 0.8rem;
  object-fit: contain;
  border-right: 1px dotted #555;
  /* background-color: rgba(134, 142, 150, 0.5); */
}

.nft-carousel-wrapper {
  position: relative;
  overflow: hidden;
  height: 12rem;
  width: 100%;
  box-shadow: 0px -9px 8px #555;
}

.nft-movin-bar {
  width: max-content;
  /* Fill the whole carousel height (12rem) - before, the bar was only
     padding + image high (11.2rem) and left a gap under the bottom padding */
  height: 100%;
  padding: 1.6rem 0;
  display: flex;
  align-items: center;
  will-change: transform;
}

.nft-auction-el {
  padding: 0 1.6rem;
  flex: 0 0 auto;
  display: flex;
  gap: 1.2rem;
  border-right: 1px solid white;
}

/* @keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
} */

.nft-img {
  height: 8rem;
  cursor: pointer;
}

.nft-info-box {
  font-size: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  justify-content: center;
  cursor: pointer;
}

.nft-price {
  color: #40c057;
}

.nft-class-pai {
  color: #6a58dc;
}
.nft-class-sc {
  color: #be2edd;
}
.nft-class-fig {
  color: #22a6b3;
}

/* USER BOX + DROPDOWN MENU */
.user-box {
  position: relative;
}

.logged-user {
  position: relative;
  height: 100%;
  padding: 0 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu-toggle {
  background: none;
  border: none;
  padding: 0;
  display: flex;
  cursor: pointer;
  color: #b71597;
  transition: filter 0.2s ease;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus-visible,
.logged-user.open .user-menu-toggle {
  filter: drop-shadow(0 0 10px rgba(183, 21, 151, 0.7));
}

.user-menu-toggle:focus-visible {
  outline: none;
}

.user-avatar {
  height: 4.4rem;
  width: 4.4rem;
  color: #b71597;
}

/* Dropdown - attached to the bottom edge of the header */
.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 21rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.6rem;
  /* Same feel as the header bar: blur only (header has no tint) +
     a barely visible dark tint so lighter cards below don't brighten it */
  background-color: rgba(30, 30, 40, 0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  border-radius: 0 0 1.6rem 1.6rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  /* Cut the shadow off at the top edge so the menu sits flush with the header;
     sides and bottom keep their shadow */
  clip-path: inset(0 -4rem -4rem -4rem);
  z-index: 101;

  transform: translateY(-1rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
}

/* Open state: click/tap (JS adds .open) or hover on devices with a mouse */
.logged-user.open .user-menu {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .logged-user:hover .user-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Hex items - same look as Settings / Security in the side menu */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0.8rem 1.4rem;
  font-size: 1.4rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 107, 107, 0.9);
  clip-path: polygon(
    10% 0%,
    90% 0%,
    100% 50%,
    100% 50%,
    90% 100%,
    10% 100%,
    0% 50%,
    0% 50%
  );
  transition: background 0.2s ease;
}

a.user-menu-item:hover,
a.user-menu-item:focus-visible {
  outline: none;
  background: linear-gradient(
    to right,
    rgba(255, 107, 107, 0.9),
    rgba(255, 107, 107, 0.45)
  );
}

.user-menu-icon {
  height: 2.4rem;
  width: 2.4rem;
  flex-shrink: 0;
}

/* Username row - informational, not clickable.
   Outline-only hex (no fill). The outline is an SVG drawn with the same
   shape as the clip-path, so it scales with the item. Colour: --user-name-outline */
.user-menu-name {
  --user-name-outline: rgba(255, 255, 255, 0.35);
  cursor: default;
  color: #e0e0e0;
  background: none;
  clip-path: none;
  position: relative;
}

.user-menu-name::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-color: var(--user-name-outline);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='10,1.5 90,1.5 99.3,50 90,98.5 10,98.5 0.7,50' fill='none' stroke='black' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpolygon points='10,1.5 90,1.5 99.3,50 90,98.5 10,98.5 0.7,50' fill='none' stroke='black' stroke-width='1.2' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}

.user-menu-name .user-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Log out - separated, destructive action */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin-top: 0.4rem;
  padding: 1.2rem 1.4rem 0.4rem;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: none;
  color: #fa5252;
  cursor: pointer;
  font-size: 1.4rem;
  font-family: inherit;
  text-align: left;
  transition: filter 0.2s;
}

.btn-logout:hover,
.btn-logout:focus-visible {
  outline: none;
  filter: brightness(1.25);
}

.btn-logout:hover span,
.btn-logout:focus-visible span {
  text-decoration: underline;
}

/* LOGIN / REGISTER BUTTONS */
/* Column width = widest button (auto grid column), both buttons stretch
   to that width and keep the label centred */
.login-box {
  height: 100%;
  padding: 0 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
}

.btn-login,
.btn-register {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 0.8rem 2.4rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Sign In - Outline Style */
.btn-login {
  background-color: transparent;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-login:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Sign Up - Solid Accent Style */
.btn-register {
  background-color: #b71597;
  color: #fff;
  border: none;
  box-shadow: 0 0 15px rgba(183, 21, 151, 0.4);
}

.btn-register:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(183, 21, 151, 0.6);
}

/* LOGIN MODAL */
.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: all 0.3s ease;
}

.login-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.login-modal-box {
  background-color: #111;
  border: 1px solid rgba(183, 21, 151, 0.6);
  border-radius: 12px;
  padding: 4.8rem;
  width: 44rem;
  max-width: 90vw;
  box-shadow:
    0 0 35px rgba(183, 21, 151, 0.3),
    inset 0 0 15px rgba(183, 21, 151, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3.2rem;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-modal-overlay.hidden .login-modal-box {
  transform: translateY(50px) scale(0.95);
}

.close-modal-btn {
  position: absolute;
  top: 1.6rem;
  right: 2.4rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 3.2rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s;
}

.close-modal-btn:hover {
  color: #b71597;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
  z-index: 10;
}

.modal-heading {
  text-align: center;
  margin-bottom: 0.8rem;
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-size: 2.8rem;
  letter-spacing: 1px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.input-group label {
  color: #e0e0e0;
  font-size: 1.4rem;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 0.5px;
}

.input-group input {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 1.4rem;
  border-radius: 8px;
  font-size: 1.6rem;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
}

.input-group input:focus {
  border-color: #b71597;
  box-shadow: 0 0 10px rgba(183, 21, 151, 0.4);
  background-color: rgba(255, 255, 255, 0.1);
}

.password-wrapper {
  position: relative;
  display: flex;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 4.8rem;
}

.toggle-password {
  position: absolute;
  right: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10;
}

.toggle-password:hover {
  color: #fff;
}

.modal-submit-btn {
  margin-top: 1.6rem;
  width: 100%;
  padding: 1.4rem;
  font-size: 1.6rem;
  text-transform: uppercase;
  font-family: "Rajdhani", sans-serif;
  letter-spacing: 1px;
}

/* ACCESS DENIED MODAL */
.access-modal-icon {
  align-self: center;
  height: 4.8rem;
  width: 4.8rem;
  color: #b71597;
  margin-bottom: -1.6rem;
}

.access-modal-text {
  color: #e0e0e0;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.8rem;
  line-height: 1.4;
  text-align: center;
}

.access-modal-hint {
  color: #aaa;
  font-size: 1.6rem;
}

.auth-error-msg {
  color: #fa5252;
  font-size: 1.4rem;
  text-align: center;
  min-height: 2rem;
  margin-top: -0.8rem;
  margin-bottom: -0.8rem;
}

@media (max-width: 59em) {
  .header {
    grid-template-columns: 8.4rem 1fr auto;
  }

  .logo-header {
    height: 8.4rem;
    width: 8.4rem;
    padding: 0.8rem;
    object-fit: contain;
  }

  .nft-carousel-wrapper {
    height: 8.4rem;
  }

  .nft-movin-bar {
    padding: 1.12rem 0;
  }

  .nft-auction-el {
    padding: 0 1.12rem;
    gap: 0.84rem;
  }

  .nft-img {
    height: 5.6rem;
  }

  .nft-info-box {
    font-size: 0.98rem;
    gap: 0.56rem;
  }

  .logged-user {
    padding: 0 1.12rem;
    height: 100%;
  }

  .user-avatar {
    height: 3.6rem;
    width: 3.6rem;
  }


  .login-box {
    padding: 0 1.12rem;
    gap: 0.7rem;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }

  .btn-login,
  .btn-register {
    width: 100%;
    font-size: 0.84rem;
    padding: 0.56rem 1.68rem;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 44em) {
  .header {
    grid-template-columns: 7.2rem 1fr auto;
  }

  .logo-header {
    height: 7.2rem;
    width: 7.2rem;
    padding: 0.7rem;
    object-fit: contain;
  }

  .nft-carousel-wrapper {
    height: 7.2rem;
  }

  .nft-movin-bar {
    padding: 0.96rem 0;
  }

  .nft-auction-el {
    padding: 0 0.96rem;
    gap: 0.72rem;
  }

  .nft-img {
    height: 4.8rem;
  }

  .nft-info-box {
    font-size: 0.84rem;
    gap: 0.48rem;
  }

  .logged-user {
    padding: 0 0.96rem;
    height: 100%;
  }

  .user-avatar {
    height: 3.2rem;
    width: 3.2rem;
  }


  .login-box {
    padding: 0 0.96rem;
    gap: 0.6rem;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }

  .btn-login,
  .btn-register {
    width: 100%;
    font-size: 0.72rem;
    padding: 0.48rem 1.44rem;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

@media (max-width: 34em) {
  .header {
    grid-template-columns: 6rem 1fr auto;
  }

  .logo-header {
    height: 6rem;
    width: 6rem;
    padding: 0.6rem;
    object-fit: contain;
  }

  .nft-carousel-wrapper {
    height: 6rem;
  }

  .nft-movin-bar {
    padding: 0.8rem 0;
  }

  .nft-auction-el {
    padding: 0 0.8rem;
    gap: 0.6rem;
  }

  .nft-img {
    height: 4rem;
  }

  .nft-info-box {
    font-size: 0.7rem;
    gap: 0.4rem;
  }

  .nft-name {
    font-size: 1.2rem;
  }

  .logged-user {
    padding: 0 0.8rem;
    height: 100%;
  }

  .user-avatar {
    height: 2.8rem;
    width: 2.8rem;
  }


  .login-box {
    padding: 0 0.8rem;
    gap: 0.5rem;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
  }

  .btn-login,
  .btn-register {
    width: 100%;
    font-size: 0.6rem;
    padding: 0.4rem 1.2rem;
    white-space: nowrap;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

/* =========================================================
   MODAL SUBMIT BUTTONS (Login / Sign up / Create account)
   They also carry .btn-register, so the mobile rules above
   (made for the small header buttons) were shrinking them.
   Higher specificity keeps them full size on every screen.
   ========================================================= */
.login-modal-box .modal-submit-btn {
  min-height: 4.8rem;
  padding: 1.4rem 2.4rem;
  font-size: 1.6rem;
}

@media (max-width: 44em) {
  .login-modal-box .modal-submit-btn {
    min-height: 5.6rem;
    padding: 1.6rem 2.4rem;
    font-size: 1.8rem;
    letter-spacing: 1.5px;
  }
}
