* {
  margin: 0;
  padding: 0;
}

/* Botón Hamburguesa Fix: Transform to X smooth */
#nav-icon3 {
  width: 48px;
  height: 48px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

#nav-icon3 span {
  display: block;
  height: 3px;
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  transition: all 0.25s ease-in-out;
}

#nav-icon3 span:nth-child(1) {
  transform-origin: center;
}

#nav-icon3 span:nth-child(2) {
  margin: 7px 0;
}

#nav-icon3 span:nth-child(3) {
  transform-origin: center;
}

#nav-icon3.open span:nth-child(1) {
  transform: rotate(45deg) translateY(10px);
  background: #ef4444;
}

#nav-icon3.open span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

#nav-icon3.open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-10px);
  background: #ef4444;
}

/* Resto igual... */

/* Icon 1 */

#nav-icon1,
#nav-icon2,
#nav-icon3,
#nav-icon4 {
  width: 50px;
  height: 45px;
  position: relative;
  margin: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: 0.5s ease-in-out;
  -moz-transition: 0.5s ease-in-out;
  -o-transition: 0.5s ease-in-out;
  transition: 0.5s ease-in-out;
  cursor: pointer;
}

#nav-icon1 span,
#nav-icon3 span,
#nav-icon4 span {
  display: block;
  position: absolute;
  height: 6px;
  width: 80%;
  background: #56007c;
  border-radius: 9px;
  opacity: 1;
  left: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: 0.25s ease-in-out;
  -moz-transition: 0.25s ease-in-out;
  -o-transition: 0.25s ease-in-out;
  transition: 0.25s ease-in-out;
}

#nav-icon1 span:nth-child(1) {
  top: 0px;
}

#nav-icon1 span:nth-child(2) {
  top: 18px;
}

#nav-icon1 span:nth-child(3) {
  top: 36px;
}

#nav-icon1.open span:nth-child(1) {
  top: 18px;
  -webkit-transform: rotate(135deg);
  -moz-transform: rotate(135deg);
  -o-transform: rotate(135deg);
  transform: rotate(135deg);
}

#nav-icon1.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

#nav-icon1.open span:nth-child(3) {
  top: 18px;
  -webkit-transform: rotate(-135deg);
  -moz-transform: rotate(-135deg);
  -o-transform: rotate(-135deg);
  transform: rotate(-135deg);
}

/* Icon 2 */

#nav-icon2 {
}

#nav-icon2 span {
  display: block;
  position: absolute;
  height: 9px;
  width: 50%;
  background: #d3531a;
  opacity: 1;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: 0.25s ease-in-out;
  -moz-transition: 0.25s ease-in-out;
  -o-transition: 0.25s ease-in-out;
  transition: 0.25s ease-in-out;
}

#nav-icon2 span:nth-child(even) {
  left: 50%;
  border-radius: 0 9px 9px 0;
}

#nav-icon2 span:nth-child(odd) {
  left: 0px;
  border-radius: 9px 0 0 9px;
}

#nav-icon2 span:nth-child(1),
#nav-icon2 span:nth-child(2) {
  top: 0px;
}

#nav-icon2 span:nth-child(3),
#nav-icon2 span:nth-child(4) {
  top: 18px;
}

#nav-icon2 span:nth-child(5),
#nav-icon2 span:nth-child(6) {
  top: 36px;
}

#nav-icon2.open span:nth-child(1),
#nav-icon2.open span:nth-child(6) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

#nav-icon2.open span:nth-child(2),
#nav-icon2.open span:nth-child(5) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

#nav-icon2.open span:nth-child(1) {
  left: 5px;
  top: 7px;
}

#nav-icon2.open span:nth-child(2) {
  left: calc(50% - 5px);
  top: 7px;
}

#nav-icon2.open span:nth-child(3) {
  left: -50%;
  opacity: 0;
}

#nav-icon2.open span:nth-child(4) {
  left: 100%;
  opacity: 0;
}

#nav-icon2.open span:nth-child(5) {
  left: 5px;
  top: 29px;
}

#nav-icon2.open span:nth-child(6) {
  left: calc(50% - 5px);
  top: 29px;
}

/* Icon 3 */

#nav-icon3 span:nth-child(1) {
  top: 0px;
}

#nav-icon3 span:nth-child(2),
#nav-icon3 span:nth-child(3) {
  top: 12px;
}

#nav-icon3 span:nth-child(4) {
  top: 25px;
}

#nav-icon3.open span:nth-child(1) {
  top: 18px;
  width: 0%;
  left: 50%;
}

#nav-icon3.open span:nth-child(2) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

#nav-icon3.open span:nth-child(3) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

#nav-icon3.open span:nth-child(4) {
  top: 18px;
  width: 0%;
  left: 50%;
}

/* Icon 4 */

#nav-icon4 {
}

#nav-icon4 span:nth-child(1) {
  top: 0px;
  -webkit-transform-origin: left center;
  -moz-transform-origin: left center;
  -o-transform-origin: left center;
  transform-origin: left center;
}

#nav-icon4 span:nth-child(2) {
  top: 18px;
  -webkit-transform-origin: left center;
  -moz-transform-origin: left center;
  -o-transform-origin: left center;
  transform-origin: left center;
}

#nav-icon4 span:nth-child(3) {
  top: 36px;
  -webkit-transform-origin: left center;
  -moz-transform-origin: left center;
  -o-transform-origin: left center;
  transform-origin: left center;
}

#nav-icon4.open span:nth-child(1) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
  top: -3px;
  left: 8px;
}

#nav-icon4.open span:nth-child(2) {
  width: 0%;
  opacity: 0;
}

#nav-icon4.open span:nth-child(3) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
  top: 39px;
  left: 8px;
}

/* aqui lo nuevo csss json */

/* ===== MINI MODAL MODERNO CON NUESTROS COLORES ===== */

/* Botón Hamburguesa Mejorado */
#nav-icon3 {
  width: 35px;
  height: 25px;
  position: relative;
  margin: 0;
  transform: rotate(0deg);
  transition: 0.5s ease-in-out;
  cursor: pointer;
  background: transparent;
  border: none;
}

#nav-icon3 span {
  display: block;
  position: absolute;
  height: 3px;
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

#nav-icon3 span:nth-child(1) {
  top: 0px;
}

#nav-icon3 span:nth-child(2) {
  top: 3px;
}

#nav-icon3 span:nth-child(3) {
  top: 20px;
}

#nav-icon3.open span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
  background: #ef4444;
}

#nav-icon3.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

#nav-icon3.open span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
  background: #ef4444;
}

/* Mini Modal Moderno */
#myNav.overlay {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  z-index: 9998;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
  border-left: 1px solid rgba(102, 126, 234, 0.1);
}

#myNav.menu-open {
  right: 0;
}

#myNav.menu-closing {
  right: -400px;
}

/* Header del Modal */
.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.modal-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
}

.modal-header-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.user-welcome h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.user-welcome p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.menu-close-btn {
  top: 12%;
  right: 0;
  position: absolute;
  background: transparent;
  border: none;
  color: white;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  font-weight: bold;
  font-family: fantasy;
}

.menu-close-btn:hover {
  background: transparent;
  transform: rotate(90deg);
}

/* Información del Usuario */
.user-info-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar-large img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.user-details h4 {
  margin: 0 0 0.3rem 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.user-details p {
  margin: 0;
  opacity: 0.8;
  font-size: 0.85rem;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Navegación Principal */
.modal-navigation {
  padding: 2rem;
  height: auto;
  max-height: calc(100vh - 200px); /* Ajusta según header */
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 1rem 0;
  padding-left: 0.5rem;
}

.menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 1rem 1.2rem;
  color: #333;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.menu-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.1),
    transparent
  );
  transition: left 0.6s ease;
}

.menu-link:hover::before {
  left: 100%;
}

.menu-link:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: translateX(8px);
  border-color: rgba(102, 126, 234, 0.2);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.menu-icon {
  font-size: 1.2rem;
  margin-right: 1rem;
  width: 24px;
  text-align: center;
  transition: transform 0.3s ease;
}

.menu-link:hover .menu-icon {
  transform: scale(1.2);
}

/* Items Especiales */
.logout-link {
  background: rgba(239, 68, 68, 0.05) !important;
  border-left: 3px solid #ef4444 !important;
}

.logout-link:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

.admin-link {
  background: rgba(16, 185, 129, 0.05) !important;
  border-left: 3px solid #10b981 !important;
}

.admin-link:hover {
  background: rgba(16, 185, 129, 0.1) !important;
  color: #10b981 !important;
}

/* Información del Sorteo */
.sorteo-card {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 15px;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
  position: relative;
  overflow: hidden;
}

.sorteo-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  background-size: cover;
}

.sorteo-icon {
  font-size: 2rem;
  position: relative;
  z-index: 2;
}

.sorteo-content {
  position: relative;
  z-index: 2;
  flex: 1;
}

.sorteo-content h5 {
  margin: 0 0 0.3rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.sorteo-content p {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.sorteo-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

/* Scrollbar Elegante */
.modal-navigation::-webkit-scrollbar {
  width: 6px;
}

.modal-navigation::-webkit-scrollbar-track {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 3px;
}

.modal-navigation::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.3);
  border-radius: 3px;
}

.modal-navigation::-webkit-scrollbar-thumb:hover {
  background: rgba(102, 126, 234, 0.5);
}

/* Overlay de fondo */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
  #myNav.overlay {
    width: 320px;
    right: -320px;
  }

  #myNav.menu-closing {
    right: -320px;
  }

  .modal-header {
    padding: 1.5rem;
  }

  .modal-navigation {
    padding: 1.5rem;
  }

  .user-welcome h3 {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  #myNav.overlay {
    width: 280px;
    right: -280px;
  }

  #myNav.menu-closing {
    right: -280px;
  }

  .modal-header {
    padding: 1.2rem;
  }

  .modal-navigation {
    padding: 1.2rem;
  }

  .menu-link {
    padding: 0.8rem 1rem;
  }

  .user-avatar-large img {
    width: 50px;
    height: 50px;
  }
}

/* Mejoras de rendimiento */
#myNav.overlay {
  will-change: transform;
  backface-visibility: hidden;
}

.menu-link {
  will-change: transform;
}

/* Botón Hamburguesa Mejorado (touch target 48px min para 2025) */
#nav-icon3 {
  width: 48px;
  height: 48px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Mejora pulse animation para status-dot (más subtle) */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Asegura high contrast en links */
.menu-link {
  color: #333; /* Contrast 7:1 con bg white */
}

.menu-link:hover {
  color: #667eea; /* Contrast ok */
}

/* Mini Modal como Dropdown Near Icon */
#myNav.dropdown-modal {
  position: absolute;
  top: 2vw; /* Justo debajo del botón */
  right: 0;
  width: 380px;
  height: 50vh; /* Auto para compacto */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  z-index: 9998;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease,
    transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  opacity: 0;
  transform: scale(0.95) translateY(-20px); /* Scale-in animation */
  pointer-events: none; /* Hidden initially */
}

#myNav.menu-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

#myNav.menu-closing {
  opacity: 0;
  transform: scale(0.95) translateY(-20px);
}

/* Quitar overlay full (no necesario para small modal) */
.menu-overlay {
  display: none; /* Opcional: si quieres backdrop light, activa con opacity low */
}

/* Timeline Unique para Links (línea vertical con dots animados) */
.timeline-links {
  position: relative;
  padding-left: 1.5rem; /* Espacio para timeline */
  margin: 0;
}

.timeline-links::before {
  content: "";
  position: absolute;
  left: 0.8rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #667eea, #764ba2); /* Gradient trendy */
  z-index: 1;
}

.menu-link {
  position: relative; /* Para dot */
}

.menu-link::before {
  content: "";
  position: absolute;
  left: -1.8rem;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #667eea;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease, background 0.3s ease;
  z-index: 2;
}

.menu-link:hover::before {
  transform: translateY(-50%) scale(1.5); /* Micro-animación glow */
  background: #764ba2;
}

/* Ajustes para compacto */
.modal-header {
  padding: 1.5rem;
}

.modal-navigation {
  padding: 1.5rem;
  overflow-y: auto;
}

@media (max-width: 768px) {
  #myNav.dropdown-modal {
    width: 320px;
    right: -10px; /* Ajuste mobile */
  }
}
