/* nxworld /css/navbar.css */

/* Base styles */
body {
  padding-top: 70px;
}

/* Navbar core styles */
.navbar {
  border-bottom: 2px solid #06306e;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  padding-top: 0.5rem !important;
}

.navbar-nav {
  display: flex;
  align-items: center;
}

/* Profile styles */
.profile-container:hover .dropdown-menu,
.profile-container:focus .dropdown-menu {
  display: block;
}

.profile-pic-large {
  width: 100px;
  height: 100px;
  display: block;
  margin: 0 auto 10px;
  border-radius: 5px;
}

/* Dropdown core styling */
.dropdown-menu {
  background-color: #141414 !important;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.3);
  /* Rimuoviamo il margin-top per eliminare il gap */
  margin-top: 0;
  min-width: 280px;
  padding: 0.5rem;
  animation: dropdownFade 0.2s ease-in-out;
}

/* Aggiungiamo padding sopra il menu per estendere l'area hover */
.nav-item.dropdown {
  padding-top: 0.5rem;
}

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

.dropdown-item {
  color: #e1e1e1;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  margin-top: 1px;
}

.dropdown-item:hover {
  background-color: #154b95;
  color: white;
  transform: translateX(5px);
}

/* Search results dropdown */
#search-results-dropdown {
  margin-top: 40px;
  position: absolute;
  width: 100%;
  z-index: 1;
}

#search-results-dropdown .dropdown-menu {
  background-color: #1a1a1a;
  width: 420px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 8px;
  margin-bottom: 5px;
  margin-top: 3px;
  margin-left: -20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.lisearch {
  border-bottom: 1px solid #333;
  list-style-type: none;
  margin-bottom: 4px;
  margin-left: -20px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.lisearch:last-of-type {
  border-bottom: none;
}

.lisearch:hover {
  cursor: pointer;
  background: #154b95;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(21, 75, 149, 0.3);
}

.lisearch a {
  overflow-wrap: break-word;
  color: #e1e1e1;
  padding: 0;
  margin: 0;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.3;
  display: block;
  white-space: normal;
  overflow: visible;
  word-wrap: break-word;
  max-width: 340px;
  padding-right: 5px;
}

.lisearch:hover a {
  color: white;
}

/* Highlighted search terms */
.search-highlight {
  background-color: rgba(255, 215, 0, 0.3);
  color: #ffffff;
  padding: 0;
  border-radius: 1px;
  font-weight: 500;
}

/* Search section headers */
.history-header,
.results-header {
  padding: 4px 8px !important;
  color: #6a8dbb !important;
  font-size: 10px !important;
  font-weight: bold !important;
  border-bottom: 1px solid #333 !important;
  margin: 8px 0 4px 0 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search results message */
.more-results-message {
  font-size: 0.75rem;
  color: #a0a0a0;
  margin-top: 8px;
  padding: 4px 8px;
  text-align: center;
  font-style: italic;
}

.more-results-message a {
  color: #e1e1e1;
  text-decoration: underline;
}

/* Compact stock display */
.stock-display-compact {
  font-size: 0.8rem !important;
  margin-left: 4px !important;
  min-width: 55px !important;
  justify-content: flex-end !important;
  flex-shrink: 0 !important;
  align-self: flex-start !important;
  margin-top: 2px !important;
}

.stock-dot-compact {
  height: 8px !important;
  width: 8px !important;
  margin-right: 4px !important;
  flex-shrink: 0 !important;
}

/* Position text styling */
.position-text-compact {
  font-size: 0.7rem !important;
  color: #b0b0b0 !important;
  margin-top: 1px !important;
  margin-left: 0 !important;
}

/* Custom scrollbar for dropdown */
#search-results-dropdown .dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

#search-results-dropdown .dropdown-menu::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 3px;
}

#search-results-dropdown .dropdown-menu::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

#search-results-dropdown .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Buttons */
.btn-outline-light {
  background-color: #b51f23;
  color: #fff;
}

.btn-outline-light:hover {
  background-color: #d2787b;
  color: #fff;
}

#openModalButton {
  background-color: white !important;
  border-radius: 50% !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-right: 12px !important;
  border: 4px solid #6a8dbb !important;
  padding: 0 !important;
}

.navbar #search-form {
  width: 320px !important;
  transition: width 0.3s ease;
}

.navbar #search-form:focus-within {
  width: 380px !important;
}

.navbar #search-form .form-control {
  height: 36px !important;
  padding: 0.375rem 0.75rem !important;
  transition: all 0.3s ease;
}

.navbar #search-form .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(21, 75, 149, 0.25);
  border-color: #154b95;
}

.navbar #search-form .btn-outline-light {
  height: 36px !important;
  padding: 0.375rem 0.75rem !important;
  background-color: #b51f23 !important;
  color: #fff !important;
}

/* Stili dropdown ricerca */
.navbar #search-results-dropdown .dropdown-menu {
  width: 420px !important;
  margin-top: 3px !important;
  margin-left: -5px !important;
}

/* Keyboard navigation styles */
.lisearch.keyboard-selected {
  background: #2a5aa0 !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(42, 90, 160, 0.4) !important;
}

.lisearch.keyboard-selected a {
  color: white !important;
}
.fas.fa-search-plus {
  color: #164a95;
}

/* Dropdown icons and text */
.dropdown-icon {
  width: 20px;
  text-align: center;
  display: inline-block;
  vertical-align: middle;
  color: white; /* Icone bianche di default */
  margin-right: 8px;
}

.dropdown-text {
  margin-left: 10px;
  vertical-align: middle;
  display: inline-block;
}

/* Navbar dropdown hover effects */
.nav-item.dropdown .nav-link.dropdown-toggle {
  position: relative;
  transition: background-color 0.3s ease;
  border-radius: 0.5rem;
}

.nav-item.dropdown .nav-link.dropdown-toggle::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: rgba(162, 6, 8, 1);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-item.dropdown:hover .nav-link.dropdown-toggle::before {
  width: 80%;
}

/* Fix per il gap del dropdown */
.nav-item.dropdown {
  position: relative;
}

.nav-item.dropdown .dropdown-menu {
  /* Posizionamento corretto per eliminare il gap */
  top: 100%;
  margin-top: -1px; /* Sovrappone leggermente per evitare il gap */
}

.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown.show .dropdown-menu {
  display: block;
}

.nav-item.dropdown:hover .dropdown-toggle,
.nav-item.dropdown.show .dropdown-toggle {
  background-color: rgba(7, 48, 109, 1);
}

/* Grid dropdown */
.dropdown-menu.dropdown-grid {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  padding: 1rem;
  min-width: 460px;
}

.dropdown-column {
  display: flex;
  flex-direction: column;
}

.vr-divider {
  width: 1px;
  background-color: #333;
  margin: 0 auto;
}

.nav-item.dropdown:hover .dropdown-menu.dropdown-grid,
.nav-item.dropdown.show .dropdown-menu.dropdown-grid {
  display: grid;
}

/* Disabled items */
.dropdown-menu .dropdown-item.disabled-link {
  color: #666;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Dividers */
.dropdown-divider {
  border-top: 1px solid #333;
  margin: 0.5rem 0;
}

/* Utils */
.mx-md-5 {
  margin-right: 2.3rem !important;
  margin-left: 2.3rem !important;
}

/* Profile dropdown specific */

/* Menu profilo - regole base */
.dropdown-menu.profile-grid {
  display: none;
  grid-template-columns: auto 1px auto;
  gap: 0.5rem;
  padding: 1rem;
  width: 490px; /* Larghezza fissa più contenuta */
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.3);
  margin-top: 0.5rem;
  animation: dropdownFade 0.2s ease-in-out;
}

/* Mostra il menu in hover */
.nav-item.dropdown:hover .dropdown-menu.profile-grid {
  display: grid;
}

/* Struttura colonne */
.profile-column {
  width: 200px; /* Larghezza fissa */
}

.features-column {
  width: 220px; /* Larghezza fissa */
}

.profile-column,
.features-column {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Profilo immagine e info */
.profile-pic-large {
  width: 64px;
  height: 64px;
  border-radius: 5px;
  object-fit: cover;
  border: 2px solid #154b95;
}

/* Separatore verticale */
.vr-divider {
  width: 1px;
  background-color: #333;
  margin: 0;
  align-self: stretch;
}

/* Responsive */
@media (max-width: 768px) {
  .dropdown-menu.profile-grid {
    width: 280px;
    grid-template-columns: 1fr;
  }

  .vr-divider {
    display: none;
  }

  .profile-column,
  .features-column {
    width: 100%;
  }
}

/* Manteniamo gli stili degli elementi interni invariati */
.dropdown-item {
  color: #e1e1e1;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.dropdown-item:hover {
  background-color: #154b95;
  color: white;
  transform: translateX(5px);
}

.dropdown-icon {
  width: 20px;
  text-align: center;
  display: inline-block;
  color: white;
  margin-right: 8px;
}

.dropdown-text {
  margin-left: 10px;
}
