/* Estilos para modales de perfil y lista de deseos */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content {
  background: var(--gradient-surface);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 450px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color);
  position: relative;
  backdrop-filter: blur(20px);
}

.modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(20px);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.01em;
}

.modal-header h3 i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.modal-close {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.2);
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--danger-color);
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-weight: 600;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger-color);
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

.modal-body {
  padding: 2rem;
}

/* Perfil específico mejorado */
.profile-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.profile-avatar {
  flex-shrink: 0;
}

.avatar-circle {
  width: 80px;
  height: 80px;
  background: var(--gradient-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  border: 3px solid white;
}

.profile-details h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.profile-details p {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.role-badge {
  background: var(--gradient-primary);
  color: white;
  padding: 0.375rem 1rem;
  border-radius: var(--border-radius-xl);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow);
}

.profile-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-actions .btn {
  flex: 1;
  min-width: 140px;
  padding: 1rem 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

.profile-actions .btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
  color: white;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
}

.profile-actions .btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Lista de deseos específico mejorado */
.wishlist-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.wishlist-empty i {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  opacity: 0.7;
  animation: pulse 2s infinite;
}

.wishlist-empty p {
  margin: 1rem 0 0.75rem 0;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-color);
}

.wishlist-empty small {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Estilos para usuarios no autenticados mejorados */
.guest-profile-content {
  text-align: center;
}

.guest-welcome {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(16, 185, 129, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(16, 185, 129, 0.1);
}

.guest-welcome i {
  font-size: 3rem;
  color: var(--success-color);
  margin-bottom: 1rem;
}

.guest-welcome h4 {
  margin: 0.75rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.01em;
}

.guest-welcome p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
}

.guest-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.guest-actions .btn {
  flex: 1;
  min-width: 140px;
  padding: 1rem 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

.guest-benefits {
  text-align: left;
  background: var(--light-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.guest-benefits h5 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guest-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guest-benefits li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-color);
  font-weight: 500;
  padding: 0.5rem;
  background: rgba(16, 185, 129, 0.05);
  border-radius: var(--border-radius-sm);
}

.guest-benefits li:last-child {
  margin-bottom: 0;
}

.guest-benefits li i {
  color: var(--success-color);
  font-size: 1rem;
  font-weight: 600;
}

/* Animaciones mejoradas */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Responsive mejorado */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 1rem;
    max-height: 90vh;
  }

  .modal-header,
  .modal-body {
    padding: 1.5rem;
  }

  .profile-info {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .avatar-circle {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-actions .btn {
    min-width: auto;
  }

  .guest-actions {
    flex-direction: column;
  }

  .guest-actions .btn {
    min-width: auto;
  }

  .modal-header h3 {
    font-size: 1.25rem;
  }
}

/* Efectos adicionales */
.modal-content:hover {
  box-shadow: var(--shadow-xl);
}

.profile-info:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
}

.guest-welcome:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
}

/* Estados de carga */
.modal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.modal-loading::after {
  content: "";
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
