/* ====== Reset & Base Layout ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  display: flex;
  flex-direction: column;
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: url("../../images/background.png") no-repeat center center fixed;
  background-size: cover;
  background-color: #000; /* Fallback */
  color: #fff;
}
body::before {
  content: "";
  position: absolute; /* was fixed — mobile paint glitches */
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.page-wrapper {
  flex: 1 0 auto;
}

/* ====== Universal Overlay Base (ModalHub compatible) ====== */
#rg2Overlay,
#slOverlay,
#blOverlay,
#leadOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none; /* hidden by default */
  padding: 24px;
  background: rgba(0, 0, 0, 0.65);
}
#rg2Overlay.is-open,
#slOverlay.is-open,
#blOverlay.is-open,
#leadOverlay.is-open,
#rg2Overlay.open,
#slOverlay.open,
#blOverlay.open,
#leadOverlay.open {
  display: grid;
  place-items: center;
}
/* lock page scroll when any modal is open */
html.modal-open,
body.modal-open {
  overflow: hidden;
}

/* a generic inner shell used by all modals */
.modal-shell {
  width: min(640px, 96vw);
  background: #0b0f18;
  border: 1px solid #263043;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.modal-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #101522, #0b0f18);
  border-bottom: 1px solid #1f2a3d;
}
.modal-head h2 {
  margin: 0;
  font-size: 18px;
}
.modal-body {
  padding: 18px;
}
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid #1f2a3d;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal-close {
  appearance: none;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #121726;
  color: #e6e6e6;
  display: grid;
  place-items: center;
}
.modal-close:hover {
  background: #1a2136;
}

/* ====== Header ====== */
#custom-header {
  background-image: url("../../images/header-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  top: 0;
  width: 100%;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 10px 0;
}
.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 20px;
}

/* ====== Left: Coin + Logo + Title ====== */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-start;
}
.coin-wrapper {
  height: 60px;
  display: flex;
  align-items: center;
}
.coin-animate {
  width: 40px;
  height: 40px;
  animation: coinJumpFlip3 2.2s infinite cubic-bezier(0.445, 0.05, 0.55, 0.95);
  transform-origin: center;
}
@keyframes coinJumpFlip3 {
  0% {
    transform: translateY(0) rotateX(0deg);
  }
  20% {
    transform: translateY(-40px) rotateX(360deg);
  }
  50% {
    transform: translateY(0) rotateX(720deg);
  }
  70% {
    transform: translateY(-20px) rotateX(1080deg);
  }
  100% {
    transform: translateY(0) rotateX(1440deg);
  }
}
.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
}
.logo-title {
  font-size: 22px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow: 1px 1px 2px #000;
  white-space: nowrap;
}

/* ====== Center: Navigation ====== */
.main-nav {
  display: flex;
  justify-content: center;
}
.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 25px;
}
.main-nav ul li a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.main-nav ul li a:hover,
.main-nav ul li a:focus,
.main-nav ul li a:active {
  color: #00ffc8;
}

/* ====== Right: Header Area ====== */
#custom-header .header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ====== Header: Auth Buttons (Register / Buyer / Seller) ====== */
#custom-header .login-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, auto));
  grid-auto-rows: minmax(34px, auto);
  gap: 10px;
  align-items: center;
  justify-content: center;
  justify-items: stretch;
}

/* Base button */
#custom-header .login-buttons .btn,
#custom-header .login-buttons a.btn,
#custom-header .login-buttons button.btn {
  --h: 34px;
  --pad-x: 14px;
  --radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--h);
  padding: 0 var(--pad-x);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}
#custom-header .login-buttons .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
#custom-header .login-buttons .btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
#custom-header .login-buttons .btn:focus-visible {
  outline: 2px solid rgba(255, 235, 59, 0.65);
  outline-offset: 2px;
}

/* Placement */
#custom-header .login-buttons .btn:nth-child(1) {
  grid-column: 1 / span 2;
  justify-self: center;
  min-width: 180px;
}
#custom-header .login-buttons .btn:nth-child(2) {
  grid-column: 1;
}
#custom-header .login-buttons .btn:nth-child(3) {
  grid-column: 2;
}

/* Variants */
#custom-header .login-buttons .btn--register {
  background: linear-gradient(
    180deg,
    #ffe769 0%,
    #ffdf3c 60%,
    #ffc800 100%
  ) !important;
  color: #2b2100 !important;
  border-color: rgba(255, 200, 0, 0.6) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}
/* Buyer + Seller default = green gradient */
#custom-header .login-buttons .btn--buyer,
#custom-header .login-buttons .btn--seller {
  background: linear-gradient(
    180deg,
    #00c094 0%,
    #00ad84 60%,
    #009572 100%
  ) !important;
  border-color: rgba(0, 179, 134, 0.6) !important;
  color: #fff !important;
}
/* Keep hover same */
#custom-header .login-buttons .btn--buyer:hover,
#custom-header .login-buttons .btn--seller:hover {
  background: linear-gradient(
    180deg,
    #00c094 0%,
    #00ad84 60%,
    #009572 100%
  ) !important;
}

/* Small pill badges */
#custom-header .login-buttons .btn .icon {
  display: inline-block;
  margin-right: 6px;
  line-height: 0;
  transform: translateY(1px);
  pointer-events: none;
}
#custom-header .login-buttons .btn[aria-busy="true"],
#custom-header .login-buttons .btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ====== Footer ====== */
#footer {
  background-image: url("../../images/footer-bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ddd;
  padding: 50px 20px 20px;
  font-size: 15px;
  position: relative;
  margin-top: auto;
}
#footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}
#footer * {
  position: relative;
  z-index: 1;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}
.footer-columns {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 20px;
}
.footer-column {
  flex: 1 1 250px;
  padding: 10px 15px;
  box-sizing: border-box;
}
.footer-column h3 {
  color: #ffeb3b;
  margin-bottom: 15px;
}
.footer-column p,
.footer-column ul {
  margin-bottom: 10px;
  line-height: 1.6;
}
.footer-column ul {
  list-style: none;
  padding-left: 0;
}
.footer-column ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-column ul li a:hover {
  color: #00ffc8;
}
.social-icons a {
  margin-right: 10px;
  font-size: 18px;
  color: #ccc;
  transition: color 0.3s ease;
}
.social-icons a:hover {
  color: #00ffc8;
}
.footer-bottom {
  border-top: 1px solid #444;
  text-align: center;
  padding-top: 15px;
  font-size: 13px;
  color: #aaa;
}

/* ====== Language Switcher ====== */
.language-switcher {
  margin-top: 5px;
  text-align: center;
  width: 100%;
}
.language-switcher select {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 4px;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 15px;
    justify-items: center;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 10px;
  }
  .header-right {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .language-switcher {
    width: 100%;
    margin-top: 5px;
    text-align: center;
  }
  .footer-columns {
    flex-direction: column;
    align-items: center;
    gap: 25px;
  }
  .footer-column {
    width: 100%;
    max-width: 500px;
    padding: 10px 20px;
    text-align: center;
    display: block;
  }
  .footer-column h3 {
    color: #ffeb3b;
    margin-bottom: 10px;
    font-size: 18px;
  }
  .footer-column p {
    color: #ddd;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
    display: block;
  }
  .footer-column ul {
    padding-left: 0;
    list-style: none;
  }
  .footer-column ul li {
    margin-bottom: 6px;
  }
  .footer-column ul li a {
    color: #ccc;
    text-decoration: none;
  }
  .footer-column ul li a:hover {
    color: #00ffc8;
  }

  /* Mobile header centering */
  .header-left {
    --decor-w: 100px;
    position: relative;
    justify-content: center !important;
    padding-left: 0 !important;
    width: 100%;
  }
  .header-left::after {
    content: "";
    display: block;
    width: var(--decor-w);
    height: 1px;
  }
  .coin-wrapper {
    width: 40px;
    height: 60px;
  }
  .coin-animate {
    width: 40px;
    height: 40px;
  }
  .logo-img {
    width: 48px;
    height: 48px;
  }
  .logo-title {
    text-align: center;
    font-size: 22px;
    line-height: 1.1;
  }
  .header-inner {
    padding: 0 10px;
    overflow-x: hidden;
  }

  .main-nav {
    order: 2;
    width: 100%;
    text-align: center;
    transform: translateX(-20px);
  }
  .header-left {
    order: 1;
    justify-content: center;
  }
  .header-right {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .main-nav ul {
    flex-direction: column;
    gap: 10px;
  }
  .login-buttons {
    width: 100%;
    max-width: 260px;
  }
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  background-attachment: scroll;
}
img,
.logo-img {
  max-width: 100%;
  height: auto;
}

/* Prevent white gutters on tall sections (mobile GPU quirk) */
.carousel-section,
.coin-category-section,
.recent-activity-section {
  contain: paint;
  transform: translateZ(0);
}

/* Mobile: avoid background-attachment:fixed (causes gutters) */
@media (max-width: 1024px) {
  body {
    background-attachment: scroll !important;
  }
}
