/* ===== ESTILOS MODERNOS PARA USUARIO LOGUEADO ===== */

/* Área principal del usuario */
#user-area {
  position: relative;
  display: none; /* Oculto por defecto hasta que el usuario se autentique */
  align-items: center;
}

/* Cuando el usuario está autenticado, se muestra con flex */
#user-area.authenticated {
  display: flex;
}

.user-button {
  display: flex;
  align-items: center;
  background-color: transparent;
  border: none;
  padding: 8px;
  border-radius: 20px;
  /* Para hacerlo más redondeado */
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  /* Hereda color de texto del padre */
}

/* Efecto hover del botón */
.user-button:hover {
  background: linear-gradient(135deg, #34495e 0%, #3d566e 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}



.user-button:hover::before {
  animation: shimmer 0.6s ease-out;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

/* Foto del usuario circular */
.user-photo-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 12px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-button:hover .user-photo-circle {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Nombre del usuario */
#user-name-display {
  font-weight: 600;
  margin-right: 8px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Flecha del dropdown */
.dropdown-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
}

.user-button:hover .dropdown-arrow {
  opacity: 1;
}

/* ===== MENÚ DESPLEGABLE ===== */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 1000;
  min-width: 280px;
  padding: 0;
  color: #ffffff;
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mostrar el menú */
.dropdown-menu[style*="block"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header del dropdown */
.dropdown-header {
  padding: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

/* Foto grande del usuario */
.dropdown-user-photo-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.dropdown-user-photo-large:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Nombre en el dropdown */
#dropdown-user-name {
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Email en el dropdown */
#dropdown-user-email {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-word;
  opacity: 0.9;
}

/* Lista del menú */
.dropdown-list {
  list-style: none;
  padding: 12px 0;
  margin: 0;
}

/* Items del menú */
.dropdown-list li a,
.dropdown-list li button {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9) !important;
  background: none !important;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  font-family: inherit;
}

/* Efecto hover en items */
.dropdown-list li a:hover,
.dropdown-list li button:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
  color: #ffffff !important;
  transform: translateX(4px);
  padding-left: 28px;
}

/* Efecto de línea en hover */
.dropdown-list li a::before,
.dropdown-list li button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(180deg, #3498db, #2980b9);
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: height 0.3s ease;
}

.dropdown-list li a:hover::before,
.dropdown-list li button:hover::before {
  height: 60%;
}

/* Separador */
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  margin: 8px 16px;
}

/* Botón de cerrar sesión especial */
#logout-button {
  color: rgba(255, 107, 107, 0.9) !important;
  font-weight: 600;
}

#logout-button:hover {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 107, 107, 0.05) 100%) !important;
  color: #ff6b6b !important;
}

#logout-button::before {
  background: linear-gradient(180deg, #ff6b6b, #e74c3c) !important;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .user-button {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .user-photo-circle {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }
  
  .dropdown-menu {
    min-width: 260px;
    right: -8px;
  }
  
  .dropdown-header {
    padding: 20px;
  }
  
  .dropdown-user-photo-large {
    width: 60px;
    height: 60px;
  }
  
  #dropdown-user-name {
    font-size: 16px;
  }
  
  .dropdown-list li a,
  .dropdown-list li button {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-list li {
  animation: fadeInUp 0.3s ease forwards;
}

.dropdown-list li:nth-child(1) { animation-delay: 0.05s; }
.dropdown-list li:nth-child(2) { animation-delay: 0.1s; }
.dropdown-list li:nth-child(3) { animation-delay: 0.15s; }
.dropdown-list li:nth-child(4) { animation-delay: 0.2s; }
.dropdown-list li:nth-child(5) { animation-delay: 0.25s; }
.dropdown-list li:nth-child(6) { animation-delay: 0.3s; }

/* ===== MODO OSCURO MEJORADO ===== */
@media (prefers-color-scheme: dark) {
  .user-button {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-color: rgba(255, 255, 255, 0.15);
  }
  
  .user-button:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
  }
  
  .dropdown-menu {
    background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
  }
}