/* Styles for navbar.html */

/* =============== Navbar Styles =============== */
.navbar {
    background-color: #02220f !important;
    /* Dark green */
}

.navbar-content {
    position: fixed;
    top: 0;
    width: 100%;
    /* Garante que a navbar se estenda por toda a largura */
    z-index: 100;
}

.navbar-brand,
.nav-link,
.navbar-text {
    color: #FFFFFF !important;
    /* White text on dark background */
}

.nav-link.active {
    border-bottom: 2px solid #FFFFFF;
    /* Purple underline for active link */
}

.navbar-toggler-icon {
    /* Keep default Bootstrap white icon on dark navbars */
    filter: none;
}

/* ═══════════════════════════════════════════════
NAVBAR LOGO
═══════════════════════════════════════════════ */
.navbar-logo {
    height: 35px;
    width: auto;
    display: block;
    transition: all 0.3s ease;
    filter: brightness(1);
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* ═══════════════════════════════════════════════
HELP ICON (NAVBAR)
═══════════════════════════════════════════════ */
.nav-help-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.85);
    padding: 0 0.55rem;
    margin-right: 0.25rem;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-help-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
}

.nav-help-link i {
    font-size: 1.1rem;
}

/* Bug report button + modal */
.nav-bug-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #ffffff;
    padding: 0.35rem 0.55rem;
    margin-right: 0.35rem;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-bug-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-bug-btn i {
    font-size: 1.1rem;
}

.bug-report-modal {
    z-index: 2005;
}

.modal-backdrop.show {
    z-index: 19;
}

/* =============== Nav Links — redesigned =============== */

/* Override Bootstrap nav-link defaults for left items */
.navbar-nav .nav-item .nav-link,
.navbar-nav .nav-item .nav-link.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.navbar-nav .nav-item .nav-link:hover,
.navbar-nav .nav-item .nav-link.dropdown-toggle:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
}

.navbar-nav .nav-item .nav-link.active {
  color: #ffffff;
  background: rgba(255,255,255,0.10);
}

.navbar-nav .nav-item .nav-link i,
.navbar-nav .nav-item .nav-link.dropdown-toggle i {
  font-size: 0.72rem;
  opacity: 0.8;
}

/* =============== Contas e Cartões — custom dropdown panel =============== */

/* Hide Bootstrap's default dropdown menu */
#creditCardDropdown + .dropdown-menu {
  display: none !important;
}

/* Custom panel */
.nav-contas-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1050;
  padding: 0.35rem 0;
}

.nav-contas-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.nav-contas-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: background 0.12s;
}

.nav-contas-item i {
  font-size: 0.72rem;
  color: #94a3b8;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.nav-contas-item:hover {
  background: #f8fafc;
  color: #1e293b;
  text-decoration: none;
}

.nav-contas-item:hover i { color: #0c7b47; }

.nav-contas-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.2rem 0;
}

/* =============== Mega Menu =============== */

/* User trigger button */
.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem 0.3rem 0.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 0.83rem;
  font-weight: 500;
  transition: all 0.2s;
  user-select: none;
  text-decoration: none;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus {
  background: rgba(255,255,255,0.14);
  color: #fff;
  text-decoration: none;
}

.user-menu-trigger.open {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}

.user-menu-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0c7b47, #00472d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-menu-chevron {
  font-size: 0.6rem;
  opacity: 0.6;
  transition: transform 0.2s;
}

.user-menu-trigger.open .user-menu-chevron {
  transform: rotate(180deg);
}

/* Panel */
.mega-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 440px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1050;
}

.mega-menu-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Green header strip */
.mega-menu-header {
  background: linear-gradient(135deg, #00472d 0%, #0c7b47 100%);
  padding: 1rem 1.25rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mega-menu-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.mega-menu-header-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.mega-menu-header-role {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.1rem;
}

/* Body */
.mega-menu-body {
  padding: 0.5rem;
}

/* Section label */
.mega-menu-section {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  padding: 0.6rem 0.75rem 0.3rem;
}

/* Item */
.mega-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.mega-menu-item:hover { background: #f8fafc; text-decoration: none; }

.mega-menu-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #64748b;
}

.mega-menu-item-text { flex: 1; min-width: 0; }

.mega-menu-item-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.2;
}

.mega-menu-item-desc {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.05rem;
  line-height: 1.3;
}

.mega-menu-item-arrow {
  font-size: 0.65rem;
  color: #cbd5e1;
  flex-shrink: 0;
}

/* Divider */
.mega-menu-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.35rem 0.75rem;
}

/* Contas e Cartões collapsible submenu */
.mega-menu-contas-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.mega-menu-contas-toggle:hover {
  background: rgba(0,0,0,0.04);
}
.mega-menu-contas-submenu {
  display: none;
  flex-direction: column;
  background: rgba(0,0,0,0.03);
  padding: 4px 0;
}
.mega-menu-contas-submenu.open {
  display: flex;
}
.mega-menu-subitem {
  padding: 9px 20px 9px 48px;
  font-size: 0.875rem;
  color: #333;
  text-decoration: none;
  transition: background 0.15s;
}
.mega-menu-subitem:hover {
  background: rgba(0,0,0,0.06);
  color: #02220f;
}
#megaContasChevron {
  transition: transform 0.2s;
  margin-left: auto;
}
#megaContasChevron.rotated {
  transform: rotate(180deg);
}

/* Guide item — green highlight */
.mega-menu-item.item-guide .mega-menu-item-icon {
  background: #e0f0e7;
  color: #00472d;
}
.mega-menu-item.item-guide .mega-menu-item-title { color: #00472d; }
.mega-menu-item.item-guide:hover { background: #f2f8f5; }
.mega-menu-item.item-guide .mega-menu-item-icon i {
  animation: compass-sway 3s ease-in-out infinite;
}

@keyframes compass-sway {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(15deg); }
  75%  { transform: rotate(-15deg); }
  100% { transform: rotate(0deg); }
}

/* AI item — purple accent */
.mega-menu-item.item-ai .mega-menu-item-icon {
  background: #ede9fe;
  color: #6d28d9;
}
.mega-menu-item.item-ai .mega-menu-item-title { color: #4c1d95; }
.mega-menu-item.item-ai:hover { background: #f5f3ff; }

/* Logout item — red accent */
.mega-menu-item.item-logout .mega-menu-item-icon {
  background: #fef2f2;
  color: #dc2626;
}
.mega-menu-item.item-logout .mega-menu-item-title { color: #dc2626; }
.mega-menu-item.item-logout:hover { background: #fff5f5; }

/* ══════════════════════════════════════════
   MOBILE BOTTOM NAV — simplified
══════════════════════════════════════════ */
@media (max-width: 767.98px), (max-height: 500px) and (pointer: coarse) {

  body { padding-bottom: 64px; }

  .navbar-toggler { display: none !important; }
  #navbarContent { display: none !important; }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #02220f;
    z-index: 1040;
    border-top: 1px solid rgba(255,255,255,0.1);
    align-items: stretch;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
  }

  .mobile-nav-item i {
    font-size: 1.1rem;
    line-height: 1;
  }

  .mobile-nav-item.active { color: #ffffff; }
  .mobile-nav-item.active i { color: #FFB74D; }
  .mobile-nav-item:hover { color: #ffffff; }
}

@media (min-width: 768px) and (min-height: 501px), (min-width: 768px) and (pointer: fine) {
  .mobile-bottom-nav { display: none !important; }
}
