/**
 * Top bar / navbar — publisher (alinhado a home e /news)
 */

:root {
  --joyple-nav-height: 64px;
  --joyple-accent: #c44a00;
  --joyple-accent-bright: #ff5200;
  --joyple-nav-bg: rgba(8, 12, 22, 0.92);
  --joyple-nav-border: rgba(255, 255, 255, 0.08);
}

body {
  padding-top: var(--joyple-nav-height);
}

.joyple-topbar {
  position: relative;
  z-index: 1030;
}

.joyple-navbar {
  min-height: var(--joyple-nav-height);
  padding: 0;
  background: var(--joyple-nav-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--joyple-nav-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.joyple-navbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--joyple-accent) 35%, var(--joyple-accent-bright) 65%, transparent 100%);
  opacity: 0.85;
  pointer-events: none;
}

.joyple-navbar__inner {
  min-height: var(--joyple-nav-height);
  align-items: center;
}

.joyple-navbar__brand {
  padding: 0.35rem 0;
  margin-right: 1rem;
  width: auto;
  max-width: none;
  line-height: 0;
}

.joyple-navbar__brand .logo-shine {
  display: inline-block;
  line-height: 0;
  vertical-align: middle;
  max-width: 100%;
  position: relative;
  overflow: hidden;
}

.joyple-navbar__brand .logo-shine img {
  display: block;
  width: auto;
  max-height: 36px;
  height: auto;
}

.joyple-navbar__toggler {
  border-color: rgba(255, 255, 255, 0.25);
  padding: 0.35rem 0.55rem;
}

.joyple-navbar__toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(196, 74, 0, 0.35);
}

.joyple-navbar__links {
  gap: 0.15rem;
}

.joyple-navbar__actions {
  gap: 0.35rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

@media (min-width: 992px) {
  .joyple-navbar__actions {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Links principais */
.joyple-navbar .joyple-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.82) !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.joyple-navbar .joyple-nav-link:hover,
.joyple-navbar .joyple-nav-link:focus {
  color: #fff !important;
  border-bottom-color: var(--joyple-accent-bright) !important;
  background: rgba(255, 255, 255, 0.04);
}

.joyple-navbar .joyple-nav-link.active-menu {
  color: #fff !important;
  border-bottom-color: var(--joyple-accent) !important;
  background: rgba(196, 74, 0, 0.15);
}

.joyple-navbar .joyple-nav-link--icon {
  padding-left: 0.55rem !important;
  padding-right: 0.55rem !important;
}

.joyple-navbar .joyple-nav-link--user {
  max-width: 200px;
}

.joyple-navbar__avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.joyple-navbar__username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

/* CTA Sign in */
.joyple-navbar__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--joyple-accent);
  border: 1px solid var(--joyple-accent);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.joyple-navbar__cta:hover,
.joyple-navbar__cta:focus {
  color: #fff !important;
  background: var(--joyple-accent-bright);
  border-color: var(--joyple-accent-bright);
}

.joyple-navbar__cta.active-menu {
  background: var(--joyple-accent-bright);
  border-color: var(--joyple-accent-bright);
}

.joyple-navbar .joyple-nav-link--redeem .bi-gift {
  color: #ff8a4c;
}

/* Dropdowns */
.joyple-navbar__dropdown {
  --bs-dropdown-bg: #12151f;
  --bs-dropdown-border-color: rgba(255, 255, 255, 0.12);
  --bs-dropdown-link-color: rgba(255, 255, 255, 0.88);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: rgba(255, 255, 255, 0.1);
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: rgba(196, 74, 0, 0.35);
  border-radius: 0;
  padding: 0.35rem 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: min(70vh, 420px);
  max-width: min(100vw - 1.5rem, 20rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.joyple-navbar__dropdown .dropdown-item {
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.joyple-navbar__dropdown--lang .dropdown-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.joyple-navbar__dropdown--lang .dropdown-item img {
  flex-shrink: 0;
}

.joyple-navbar__dropdown .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.1);
}

.joyple-navbar .joyple-nav-logout-btn {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
}

.joyple-navbar .joyple-nav-logout-btn:hover,
.joyple-navbar .joyple-nav-logout-btn:focus {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

body.joyple-page-inner .joyple-navbar .dropdown-menu .joyple-nav-logout-btn:hover,
body.joyple-page-inner .joyple-navbar .dropdown-menu .joyple-nav-logout-btn:focus {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Mega menu jogos */
.joyple-mega-menu {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100%;
  margin-top: 0 !important;
  padding: 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  background: rgba(6, 9, 18, 0.97) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  position: absolute;
  transform: none !important;
  top: 100%;
  z-index: 1050;
}

.joyple-mega-menu__genre {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--joyple-accent-bright);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.joyple-mega-menu__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.65rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.joyple-mega-menu__card:hover {
  color: #fff;
  border-color: rgba(196, 74, 0, 0.55);
  background: rgba(196, 74, 0, 0.08);
  transform: translateY(-2px);
}

.joyple-mega-menu__card--empty {
  justify-content: center;
  align-items: center;
  min-height: 100px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: default;
}

.joyple-mega-menu__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  margin-bottom: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.joyple-mega-menu__thumb img {
  width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.joyple-mega-menu__card:hover .joyple-mega-menu__thumb img {
  opacity: 0.92;
}

.joyple-mega-menu__name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  min-height: 2.4em;
}

/* Logo shine — apenas sobre a imagem (wrapper ajusta ao tamanho do logo) */
.joyple-navbar__brand .logo-shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  animation: nav-logo-shine 2.8s infinite;
  pointer-events: none;
}

@keyframes nav-logo-shine {
  0% { left: -75%; }
  80% { left: 120%; }
  100% { left: 120%; }
}

/* Mobile collapse */
@media (max-width: 991.98px) {
  .joyple-navbar .navbar-collapse {
    padding: 0.75rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.35rem;
    overflow-x: hidden;
    max-width: 100%;
  }

  .joyple-navbar__actions .dropdown-menu {
    max-width: 100%;
  }

  .joyple-navbar__links .nav-item {
    width: 100%;
  }

  .joyple-navbar .joyple-nav-link {
    width: 100%;
  }

  .joyple-mega-menu {
    position: static !important;
    box-shadow: none;
    border-top: none;
    background: rgba(0, 0, 0, 0.25) !important;
  }

  .joyple-navbar__cta {
    width: 100%;
    justify-content: center;
    margin-top: 0.35rem;
  }
}

/* Inner pages: evita conflito com .navig global */
body.joyple-page-inner .joyple-navbar .navig {
  border-bottom-width: 2px;
}

body.joyple-page-inner .joyple-navbar a.navig:not(.joyple-nav-link):hover {
  color: inherit;
}

.joyple-notif-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.05rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #e85d04;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

.joyple-notif-menu {
  width: min(22rem, 92vw);
  max-height: 24rem;
  overflow: hidden;
  padding-bottom: 0.25rem;
}

.joyple-notif-list {
  max-height: 18rem;
  overflow-y: auto;
}

.joyple-notif-mark-all {
  color: var(--joyple-accent-bright);
  text-decoration: none;
  font-size: 0.75rem;
}

.joyple-notif-item {
  white-space: normal;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.9rem;
}

.joyple-notif-item--unread {
  background: rgba(232, 93, 4, 0.08);
}

.joyple-notif-item__head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

.joyple-notif-item__head .bi {
  color: var(--joyple-accent-bright);
}

.joyple-notif-item__title {
  font-size: 0.85rem;
}

.joyple-notif-item__message {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 0.2rem;
}

.joyple-notif-item__date {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55);
}
