/* ===== CSS ENCAPSULADO PARA MENU DO TOPO ===== */

/* Container principal para encapsular o menu do topo */
.menu-topo-container {
  font-family: "Poppins", sans-serif;
}

/* ===== TOP BAR PRINCIPAL ===== */
.menu-topo-container #top-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  background-color: #113647;
  padding: 15px 3px;
  color: white;
  font-family: Arial, sans-serif;
  height: 60px;
  width: 100%;
  position: relative;
  z-index: 1000020; /* ensure top-bar sits above other elements */
}

.menu-topo-container .menu-container {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

/* ===== BOTÃO DO MENU ===== */
.menu-topo-container .menu-button {
  background: none;
  color: #eff1f1;
  border: none;
  outline: none;
  font-size: 25px;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  margin-right: 15px;
  transition: color 0.3s ease;
}

.menu-topo-container .menu-button:hover {
  color: #ffffff;
}

.menu-topo-container .menu-button:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* ===== MENU DROPDOWN ===== */
.menu-topo-container #menu {
  display: none;
  position: absolute;
  top: 60px;
  left: 0px;
  background-color: #eff1f1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000021; /* high z-index so dropdown is above other layered elements */
  padding-left: 0px;
  width: 180px;
  border-radius: 8px;
  overflow: hidden;
}

.menu-topo-container .menu-content {
  text-align: left;
}

.menu-topo-container .menu-content a {
  display: flex;
  align-items: center;
  padding: 12px 0px 12px 10px;
  text-decoration: none;
  color: #004080;
  transition: background-color 0.3s ease;
  font-weight: 500;
  font-size: 14px;
}

.menu-topo-container .menu-content a:hover {
  background-color: #daf3f5;
}

.menu-topo-container .menu-icon {
  margin-right: 7px;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
  font-size: 16px;
  color: #004080;
}

/* ===== LISTA MENTORES (SALDO) ===== */
.menu-topo-container #lista-mentores {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.menu-topo-container .valor-item-menu {
  background-color: #113647;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-family: "Segoe UI", "Roboto", sans-serif;
  margin-top: -8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 8px;
  gap: 5px;
  border-radius: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-topo-container .valor-item-menu:hover {
  transform: translateY(-2px);
}

.menu-topo-container .valor-icone-menu {
  font-size: 18px;
  color: rgb(184, 153, 238);
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  white-space: nowrap;
}

.menu-topo-container .valor-info-wrapper {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.menu-topo-container .valor-label-linha {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  border-bottom: 1px solid #1f4d5f;
}

.menu-topo-container .valor-label {
  font-weight: 500;
  font-size: 11px;
  color: #cfd8dc;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.menu-topo-container .valor-bold-menu {
  font-size: 13px;
  font-weight: bold;
  color: #a9b5bbff;
}

.menu-topo-container .valor-icone-tema {
  font-size: 12px;
  color: #90a4ae;
  transition: transform 0.3s ease, color 0.3s ease;
}

.menu-topo-container .valor-label-linha:hover .valor-icone-tema {
  transform: scale(1.1);
  color: #ffffff;
}

/* ===== CLASSES DE ESTADO ===== */
.menu-topo-container .saldo-positivo {
  color: #4ade80 !important;
  font-weight: bold;
  transition: color 0.3s ease;
}

.menu-topo-container .saldo-negativo {
  color: #e57373 !important;
  font-weight: bold;
  transition: color 0.3s ease;
}

.menu-topo-container .saldo-neutro {
  color: #cfd8dc !important;
  font-weight: bold;
  transition: color 0.3s ease;
}

/* Classes de estado globais (fora do container também) */
.saldo-positivo {
  color: #4ade80 !important;
  font-weight: bold;
  transition: color 0.3s ease;
}

.saldo-negativo {
  color: #e57373 !important;
  font-weight: bold;
  transition: color 0.3s ease;
}

.saldo-neutro {
  color: #cfd8dc !important;
  font-weight: bold;
  transition: color 0.3s ease;
}

/* ===== POSICIONAMENTO RESPONSIVO ===== */
.menu-topo-container .saldo-topo-ajustado {
  position: absolute;
  z-index: 1001;
}

/* Para telas grandes (computadores) */
@media (min-width: 768px) {
  .menu-topo-container .saldo-topo-ajustado {
    top: 5px;
    right: 15px;
  }
}

/* Para telas pequenas (celulares) */
@media (max-width: 767px) {
  .menu-topo-container .saldo-topo-ajustado {
    top: 5px;
    right: 5px;
    left: auto;
  }
}

/* ===== RESPONSIVIDADE GERAL ===== */

/* Tablets */
@media (max-width: 768px) {
  .menu-topo-container #top-bar {
    padding: 12px 8px;
    height: 55px;
  }

  .menu-topo-container .menu-button {
    font-size: 22px;
    margin-right: 10px;
  }

  .menu-topo-container #menu {
    top: 55px;
    left: 15px;
    width: 170px;
  }

  .menu-topo-container .valor-item-menu {
    padding: 8px;
    border-radius: 6px;
    margin-top: 0px;
  }

  .menu-topo-container .valor-label-linha {
    gap: 4px;
    padding: 0;
  }

  .menu-topo-container .valor-label {
    font-size: 10px;
    letter-spacing: 0.2px;
  }

  .menu-topo-container .valor-bold-menu {
    font-size: 12px;
    line-height: 1.1;
  }

  .menu-topo-container .valor-icone-tema {
    font-size: 11px;
  }
}

/* Celulares */
@media (max-width: 480px) {
  .menu-topo-container #top-bar {
    padding: 10px 5px;
    height: 50px;
  }

  .menu-topo-container .menu-button {
    font-size: 20px;
    margin-right: 8px;
    padding: 3px;
  }

  .menu-topo-container #menu {
    top: 50px;
    left: 10px;
    width: 160px;
  }

  .menu-topo-container .menu-content a {
    padding: 10px 8px;
    font-size: 13px;
  }

  .menu-topo-container .menu-icon {
    margin-right: 5px;
    min-width: 18px;
    font-size: 14px;
  }

  .menu-topo-container .valor-item-menu {
    padding: 6px;
    margin-top: 2px;
  }

  .menu-topo-container .valor-info-wrapper {
    gap: 3px;
  }

  .menu-topo-container .valor-label-linha {
    gap: 3px;
  }

  .menu-topo-container .valor-label {
    font-size: 9px;
  }

  .menu-topo-container .valor-bold-menu {
    font-size: 11px;
  }

  .menu-topo-container .valor-icone-tema {
    font-size: 10px;
  }
}

/* Telas muito pequenas */
@media (max-width: 360px) {
  .menu-topo-container #top-bar {
    height: 45px;
    padding: 8px 3px;
  }

  .menu-topo-container .menu-button {
    font-size: 18px;
    margin-right: 5px;
  }

  .menu-topo-container #menu {
    top: 45px;
    left: 8px;
    width: 150px;
  }

  .menu-topo-container .menu-content a {
    padding: 8px 6px;
    font-size: 12px;
  }

  .menu-topo-container .valor-item-menu {
    padding: 4px;
  }

  .menu-topo-container .valor-label {
    font-size: 8px;
  }

  .menu-topo-container .valor-bold-menu {
    font-size: 10px;
  }
}

/* ===== ESTADOS ESPECIAIS ===== */

/* Menu aberto */
.menu-topo-container #menu.show {
  display: block !important;
}

/* Hover nos itens do menu */
.menu-topo-container .menu-content a:focus {
  background-color: #c5e3e6;
  outline: none;
}

/* Estados ativos */
.menu-topo-container .menu-content a.active {
  background-color: #b8d4d7;
  font-weight: bold;
}

/* ===== ACESSIBILIDADE ===== */
.menu-topo-container .menu-button:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

/* ===== ÍCONE DE LUCRO DINÂMICO ===== */
#icone-lucro-dinamico {
  transition: transform 0.3s ease, color 0.3s ease;
  display: inline-block;
}

/* Quando lucro é positivo - seta para cima (verde claro) */
#icone-lucro-dinamico.fa-arrow-trend-up {
  color: #4ade80 !important; /* Mesma cor do texto "Lucro" positivo */
  transform: rotate(0deg);
}

/* Quando lucro é negativo - seta para baixo (vermelho) */
#icone-lucro-dinamico.fa-arrow-trend-down {
  color: #e57373; /* Mesma cor do texto "Negativo" */
  transform: rotate(0deg);
}

/* Quando lucro é neutro - linha (cinza) */
#icone-lucro-dinamico.fa-minus {
  color: #cfd8dc; /* Mesma cor do texto "Neutro" */
  transform: rotate(0deg);
}

.menu-topo-container .menu-content a:focus {
  outline: 2px solid #004080;
  outline-offset: -2px;
}

/* ===== BOTÃO AVIATOR ===== */
.menu-topo-container .btn-aviator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #1a1a1a 0%, #8b0000 100%);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.3s ease;
  margin-left: 10px;
  box-shadow: 0 4px 8px rgba(139, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-topo-container .btn-aviator:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(139, 0, 0, 0.4);
  background: linear-gradient(135deg, #2d2d2d 0%, #a00000 100%);
}

.menu-topo-container .btn-aviator:active {
  transform: translateY(0);
}

.menu-topo-container .aviator-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.menu-topo-container .aviator-label {
  display: inline-block;
  white-space: nowrap;
}

/* Responsividade para telas pequenas */
@media (max-width: 768px) {
  .menu-topo-container .aviator-label {
    display: none;
  }

  .menu-topo-container .btn-aviator {
    padding: 8px 10px;
    margin-left: 5px;
  }
}

/* ===== BOTÃO DE NOTIFICAÇÕES ===== */
.menu-topo-container .notificacao-btn {
  background: none;
  border: none;
  color: #eff1f1;
  font-size: 22px;
  cursor: pointer;
  padding: 5px 12px;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-left: 10px;
}

.menu-topo-container .notificacao-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.menu-topo-container .notificacao-btn:focus {
  outline: none;
  box-shadow: none;
}

/* Badge para indicador de permissão */
.menu-topo-container .notificacao-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #4caf50;
  animation: pulso 2s infinite;
}

.menu-topo-container .notificacao-badge.desativada {
  background-color: #f44336;
  animation: none;
}

@keyframes pulso {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ===== MENU DE NOTIFICAÇÕES ===== */
.menu-topo-container .notificacao-menu {
  display: none;
  position: absolute;
  top: 60px;
  right: 15px;
  background-color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  z-index: 1000022;
  border-radius: 12px;
  overflow: hidden;
  min-width: 280px;
  animation: slideDown 0.3s ease;
}

.menu-topo-container .notificacao-menu.ativo {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header do menu de notificações */
.menu-topo-container .notificacao-menu-header {
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Corpo do menu de notificações */
.menu-topo-container .notificacao-menu-body {
  padding: 16px;
}

/* Opções de notificação */
.menu-topo-container .notificacao-opcao {
  padding: 14px;
  background-color: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid transparent;
}

.menu-topo-container .notificacao-opcao:hover {
  background-color: #e8e8e8;
  border-color: #667eea;
}

.menu-topo-container .notificacao-opcao i {
  font-size: 18px;
  color: #667eea;
  flex-shrink: 0;
}

.menu-topo-container .notificacao-opcao .opcao-texto {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-topo-container .notificacao-opcao .opcao-titulo {
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.menu-topo-container .notificacao-opcao .opcao-descricao {
  font-size: 11px;
  color: #666;
}

/* Status da permissão */
.menu-topo-container .permissao-status {
  padding: 12px 16px;
  background-color: #f0f0f0;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.menu-topo-container .permissao-status.permitida {
  background-color: #d4edda;
  color: #155724;
  border-top-color: #c3e6cb;
}

.menu-topo-container .permissao-status.negada {
  background-color: #f8d7da;
  color: #721c24;
  border-top-color: #f5c6cb;
}
