/* =============================================
   NAVBAR PÚBLICO - LOGIN/REGISTRO
   ============================================= */

/* --------- PREVENIR SCROLL HORIZONTAL --------- */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* --------- NAVBAR BASE --------- */
.navbar-public {
  background: white;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  padding: 0.75rem 0;
  position: fixed; /* o sticky */
  top: 0;
  left: 0;
  z-index: 1050;
  transition: all 0.3s ease;
  width: 100%;
  margin: 0 !important; /* ← Bootstrap a veces agrega margin */
  padding-top: 0;
}

.navbar-public.scrolled {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
  padding: 0.5rem 0;
}

.navbar-container-public {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* --------- LOGO Y MARCA --------- */
.navbar-brand-public {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.navbar-brand-public:hover {
  transform: translateY(-2px);
}

.logo-public {
  height: 60px;
  width: auto;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 8px rgba(147, 193, 33, 0.2));
}

.navbar-public.scrolled .logo-public {
  height: 50px;
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-name-public {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1f2937;
  letter-spacing: -0.5px;
  line-height: 1;
}

.brand-tagline {
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c121;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* --------- DROPDOWN WRAPPER --------- */
.user-dropdown-wrapper {
  position: relative;
}

.user-dropdown-wrapper .dropdown {
  position: relative;
}

/* --------- BOTÓN DE USUARIO (SOLO ICONO) --------- */
.user-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: white;
  border: 2px solid #e5e7eb;
  color: #374151;
  font-size: 1.8rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
}

.user-menu-btn:hover,
.user-menu-btn.show,
.user-menu-btn[aria-expanded="true"] {
  background: rgba(147, 193, 33, 0.08);
  border-color: #93c121;
  color: #93c121;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(147, 193, 33, 0.2);
}

.user-menu-btn i {
  transition: transform 0.3s ease;
}

.user-menu-btn:hover i {
  transform: scale(1.1);
}

/* --------- DROPDOWN MODERNO --------- */
.dropdown-menu-modern {
  min-width: 320px;
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  padding: 0.75rem;
  margin-top: 0.75rem;
  background: white;
  animation: dropdownSlide 0.3s ease;
  position: absolute;
  right: 0;
  left: auto;
  transform-origin: top right;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-header i {
  font-size: 1.1rem;
  color: #93c121;
}

.dropdown-divider {
  margin: 0.5rem 0;
  border-color: rgba(148, 163, 184, 0.2);
}

/* Items del dropdown */
.dropdown-item-modern {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 2px solid transparent;
  margin-bottom: 0.5rem;
}

.dropdown-item-modern:last-child {
  margin-bottom: 0;
}

.dropdown-item-modern:hover {
  background: rgba(147, 193, 33, 0.1);
  border-color: rgba(147, 193, 33, 0.3);
  transform: translateX(4px);
}

.dropdown-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #374151;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.dropdown-item-modern:hover .dropdown-icon {
  background: linear-gradient(135deg, #93c121, #6c8f1a);
  color: white;
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 12px rgba(147, 193, 33, 0.3);
}

.dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.dropdown-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

.dropdown-desc {
  font-size: 0.8rem;
  font-weight: 500;
  color: #6b7280;
  line-height: 1.2;
}

.dropdown-item-modern:hover .dropdown-title {
  color: #93c121;
}

/* --------- RESPONSIVE --------- */

@media (max-width: 991.98px) {
  .navbar-container-public {
    padding: 0 1.5rem;
  }

  .brand-info {
    display: none;
  }

  .logo-public {
    height: 50px;
  }

  .user-menu-btn {
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
  }

  .dropdown-menu-modern {
    min-width: 300px;
  }
}

@media (max-width: 576px) {
  .navbar-container-public {
    padding: 0 1rem;
  }

  .logo-public {
    height: 45px;
  }

  .brand-name-public {
    font-size: 1.2rem;
  }

  .user-menu-btn {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
  }

  .dropdown-menu-modern {
    min-width: 280px;
    max-width: calc(100vw - 2rem);
  }

  .dropdown-item-modern {
    padding: 0.875rem;
  }

  .dropdown-icon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .dropdown-title {
    font-size: 0.9rem;
  }

  .dropdown-desc {
    font-size: 0.75rem;
  }
}

/* Pantallas muy pequeñas */
@media (max-width: 380px) {
  .dropdown-menu-modern {
    min-width: 260px;
    right: -1rem !important;
  }

  .dropdown-header {
    padding: 0.75rem 0.75rem 0.5rem;
    font-size: 0.8rem;
  }

  .dropdown-item-modern {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .dropdown-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}

/* --------- ANIMACIONES ADICIONALES --------- */

/* Efecto de entrada para items del dropdown */
.dropdown-item-modern {
  animation: slideIn 0.3s ease;
  animation-fill-mode: both;
}

.dropdown-item-modern:nth-child(2) {
  animation-delay: 0.05s;
}

.dropdown-item-modern:nth-child(3) {
  animation-delay: 0.1s;
}

.dropdown-item-modern:nth-child(4) {
  animation-delay: 0.15s;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --------- ESTADOS ESPECIALES --------- */

/* Efecto glassmorphism al dropdown */
.dropdown-menu-modern {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.98);
}

/* --------- PRINT --------- */
@media print {
  .navbar-public {
    display: none;
  }
}

/* --------- FIX PARA BOOTSTRAP DROPDOWN --------- */
.dropdown-menu.show {
  display: block;
}

.dropdown-toggle::after {
  display: none;
}

/* Asegurar que el dropdown no cause overflow */
.user-dropdown-wrapper {
  position: relative;
  z-index: 1001;
}

.dropdown-menu-modern.dropdown-menu-end {
  right: 0 !important;
  left: auto !important;
}

/* Prevenir scroll en el body cuando el dropdown está abierto */
body:has(.dropdown-menu.show) {
  overflow-x: hidden;
}
