/* ===== Footer Component ===== */
.site-footer.portal-footer {
  position: relative;
  margin-top: 2.5rem;
  padding-top: 2.2rem;
  border-top: 1px solid rgba(167, 139, 250, 0.28);
  background:
    radial-gradient(circle at 12% 15%, rgba(167, 139, 250, 0.08), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(8, 145, 178, 0.08), transparent 34%),
    rgba(4, 16, 25, 0.96);
}

/* Elegant Luminous Top Border Line */
.site-footer.portal-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(167, 139, 250, 0.15) 15%, rgba(216, 180, 254, 0.9) 50%, rgba(56, 189, 248, 0.6) 80%, transparent 100%);
  box-shadow: 0 0 10px 1px rgba(167, 139, 250, 0.45);
  pointer-events: none;
}

html[data-mode="light"] .site-footer.portal-footer {
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  background:
    radial-gradient(circle at 12% 15%, rgba(167, 139, 250, 0.12), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(8, 145, 178, 0.08), transparent 34%),
    #ffffff;
}

html[data-mode="light"] .site-footer.portal-footer::before {
  background: linear-gradient(90deg, transparent 0%, rgba(124, 58, 237, 0.2) 20%, rgba(147, 51, 234, 0.85) 50%, rgba(6, 182, 212, 0.6) 75%, transparent 100%);
  box-shadow: 0 0 10px 1px rgba(124, 58, 237, 0.35);
}

.portal-footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) minmax(130px, 0.7fr) minmax(190px, 0.95fr) minmax(210px, 1.05fr);
  gap: 1.5rem;
  align-items: start;
}

.footer-brand-block {
  max-width: 380px;
}

.footer-brand-text {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--text);
}

.footer-brand-text::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: .4rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.footer-tagline {
  margin: .65rem 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: .8rem;
}

.footer-mini-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .75rem;
}

.footer-mini-badges span {
  padding: .22rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border-dim);
  background: rgba(167, 139, 250, .06);
  color: var(--accent2);
  font-size: .67rem;
  font-weight: 800;
}

.portal-footer .footer-col-title {
  margin-bottom: .65rem;
  color: var(--text);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.portal-footer .footer-links {
  display: flex;
  flex-direction: column;
  gap: .42rem;
}

.portal-footer .footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: .78rem;
  transition: color .15s ease, transform .15s ease;
}

.portal-footer .footer-links a::before {
  content: "•";
  color: var(--accent);
  opacity: 0.7;
  font-size: .8rem;
  line-height: 1;
}

.portal-footer .footer-links a:hover {
  color: var(--accent2);
  transform: translateX(3px);
}

.portal-footer .footer-links a:hover::before {
  opacity: 1;
}

/* Clean Indented Chakra Guide */
.footer-type-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.footer-type-list > span {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
}

.footer-type-list > span > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer-type-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .4));
  flex-shrink: 0;
}

.footer-type-list small {
  color: var(--muted);
  font-size: .67rem;
  font-weight: 500;
  padding-left: 19px;
}

.footer-about {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: .76rem;
}

.portal-footer .footer-credits {
  margin-top: .65rem;
  color: var(--muted);
  font-size: .74rem;
}

.portal-footer .footer-credits a {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 800;
}

/* Discord Community Link */
.footer-community-link {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 220px;
  gap: .6rem;
  margin-top: .65rem;
  padding: .5rem .65rem;
  border: 1px solid rgba(88, 101, 242, .4);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(88, 101, 242, .22), rgba(15, 23, 42, .85));
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.footer-community-link:hover {
  transform: translateY(-2px);
  border-color: #5865f2;
  background: linear-gradient(135deg, rgba(88, 101, 242, .38), rgba(15, 23, 42, .95));
}

.footer-community-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: #5865f2;
  color: #fff;
}

.footer-community-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-community-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.footer-community-copy small {
  color: #a5b4fc;
  font-size: .48rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .08em;
}

.footer-community-copy strong {
  overflow: hidden;
  color: #ffffff;
  font-size: .70rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-community-arrow {
  flex: 0 0 auto;
  color: #a5b4fc;
  font-size: .8rem;
  transition: transform .16s ease;
}

.footer-community-link:hover .footer-community-arrow {
  transform: translateX(2px);
}

/* QRIS Support Button */
.footer-qris-button {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 220px;
  gap: .6rem;
  margin-top: .45rem;
  padding: .5rem .65rem;
  border: 1px solid rgba(167, 139, 250, .35);
  border-radius: 9px;
  background: rgba(167, 139, 250, .12);
  color: #ffffff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.footer-qris-button > span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  background: rgba(167, 139, 250, .24);
  color: #fde047;
}

.footer-qris-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.footer-qris-button > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.footer-qris-button small {
  color: #c4b5fd;
  font-size: .48rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .08em;
}

.footer-qris-button strong {
  color: #ffffff;
  font-size: .70rem;
  line-height: 1.2;
}

.footer-qris-button:hover {
  transform: translateY(-1px);
  border-color: #a78bfa;
  background: rgba(167, 139, 250, .22);
}

/* Light Mode Overrides for Community & QRIS Buttons */
html[data-mode="light"] .footer-community-link {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.12), rgba(88, 101, 242, 0.04));
  border-color: rgba(88, 101, 242, 0.28);
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.08);
}

html[data-mode="light"] .footer-community-link:hover {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.08));
  border-color: #5865f2;
}

html[data-mode="light"] .footer-community-copy small {
  color: #4f46e5;
}

html[data-mode="light"] .footer-community-copy strong {
  color: #0f172a;
}

html[data-mode="light"] .footer-community-arrow {
  color: #4f46e5;
}

html[data-mode="light"] .footer-qris-button {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.14), rgba(167, 139, 250, 0.05));
  border-color: rgba(167, 139, 250, 0.32);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.06);
}

html[data-mode="light"] .footer-qris-button:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.22), rgba(167, 139, 250, 0.1));
  border-color: #7c3aed;
}

html[data-mode="light"] .footer-qris-button > span:first-child {
  background: rgba(167, 139, 250, 0.22);
  color: #d97706;
}

html[data-mode="light"] .footer-qris-button small {
  color: #6d28d9;
}

html[data-mode="light"] .footer-qris-button strong {
  color: #0f172a;
}

/* Footer Bottom Bar */
.footer-bottom.portal-footer-bottom {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding: 1rem var(--page-gutter);
  border-top: 1px solid var(--border-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--muted);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 76px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border-dim);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 0;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.16s var(--ease);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  transform: translateY(-3px);
}

.back-to-top:hover svg {
  transform: translateY(-2px);
}

.back-to-top.launching {
  transform: translateY(-8px) scale(0.92);
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.back-to-top.launching svg {
  transform: translateY(-4px);
}

html[data-mode="light"] .back-to-top {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Pirate Heroes Floating Action Link */
.pirate-heroes-link {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 890;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 48px;
  height: 48px;
  padding: 2.5px;
  overflow: hidden;
  border: 1.5px solid var(--border-dim);
  border-radius: 50%;
  background: var(--card-solid, #0b0e18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 16px rgba(251, 146, 60, 0.2);
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.pirate-heroes-link img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.pirate-heroes-link:hover {
  border-color: #fb923c;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 24px rgba(251, 146, 60, 0.38);
  transform: translateY(-2px) scale(1.06);
}

.pirate-heroes-link:active {
  transform: translateY(0) scale(0.96);
}

.pirate-heroes-link:focus-visible {
  outline: 2px solid #fb923c;
  outline-offset: 3px;
}

html[data-mode="light"] .pirate-heroes-link {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 16px rgba(251, 146, 60, 0.18);
}

html[data-mode="light"] .pirate-heroes-link:hover {
  border-color: #ea580c;
}

@media (max-width: 900px) {
  .portal-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }
}

@media (max-width: 600px) {
  .portal-footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom.portal-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

  .pirate-heroes-link {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .back-to-top {
    right: 18px;
    bottom: 68px;
    width: 38px;
    height: 38px;
  }
}
