/* Sistema de notificaciones VOCCI - Estilo moderno con paleta personalizada */

:root {
  --primary-color: #000000;
  --secondary-color: #000000;
  --accent-color: #3b82f6;
  --text-color: #abaeb5;
  --text-secondary: #cccccc;
  --border-color: #333333;
}

.icon-notification-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
  background: transparent;
  z-index: 9999998; /* Aseguramos que el icono esté por encima de la navbar pero por debajo del dropdown */
  /* Eliminamos la transición para evitar movimientos */
}

.icon-notification-wrapper:hover {
  background: rgba(255, 255, 255, 0.1);
  /* Eliminamos la transformación para evitar movimientos */
}

.icon-notification {
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#notification-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: linear-gradient(135deg, #ff4757, #ff3742);
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1a1a2e;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

#notification-dropdown {
  position: absolute;
  top: 95px;
  right: 50%;
  transform: translateX(50%);
  z-index: 99999999 !important;
  opacity: 0;
  visibility: hidden;
  filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.2));
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Flecha indicadora */
.vocci-notification-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #1a1a1a;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-right: none;
  z-index: 99999998;
  pointer-events: none;
}

#notification-dropdown.show {
  opacity: 1;
  visibility: visible;
}

.vocci-notification-dropdown {
  background: #1a1a1a;
  border-radius: 12px;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: 380px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  z-index: 99999999 !important;
  position: relative;
}

.vocci-notification-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-color);
  background: #2d2d2d;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vocci-notification-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
}

.notification-count-text {
  font-size: 12px;
  opacity: 0.9;
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-color);
  padding: 4px 8px;
  border-radius: 12px;
}

.vocci-notification-list {
  max-height: 260px; /* Altura más pequeña y controlada */
  overflow: hidden; /* Completamente sin scroll */
  padding: 0;
  margin: 0;
}

/* Asegurar que no aparezcan scrollbars en ningún navegador */
.vocci-notification-list::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
}

.vocci-notification-list {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.vocci-notification-item {
  display: flex;
  align-items: center;
  padding: 10px 14px; /* Padding más compacto */
  cursor: pointer;
  /* Eliminamos la transición para evitar movimientos */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  min-height: auto;
  max-width: 100%; /* Evitar desbordamiento */
  box-sizing: border-box;
}

.vocci-notification-item:last-child {
  border-bottom: none;
}

.vocci-notification-item:hover {
  background: #333333;
  /* Eliminamos la transformación para evitar movimientos */
}

.vocci-notification-item.unread {
  background: linear-gradient(90deg, transparent 0%, rgba(59, 130, 246, 0.1) 100%);
  border-right: 3px solid var(--accent-color);
}

.notification-avatar {
  position: relative;
  margin-right: 12px;
  flex-shrink: 0;
}

.notification-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

.unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--accent-color);
  border-radius: 50%;
  border: 2px solid #1a1a1a;
  animation: pulse 2s infinite;
}

.notification-content {
  flex: 1;
  min-width: 0;
  overflow: hidden; /* Evitar desbordamiento */
}

.notification-header-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.notification-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px; /* ✅ CAMBIADO: Aumentado de 160px a 220px para mostrar más texto */
}

.notification-time {
  font-size: 12px;
  color: var(--text-color);
  flex-shrink: 0;
}

.notification-message {
  font-size: 12px;
  color: var(--text-color);
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* ✅ CAMBIADO: De 1 línea a 2 líneas para mostrar más contenido */
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  max-width: 100%;
}

.notification-count-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-color), #60a5fa);
  color: white;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

.notification-action {
  margin-left: 8px;
  color: var(--text-color);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vocci-notification-item:hover .notification-action {
  opacity: 1;
}

.vocci-notification-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #2d2d2d;
}

.view-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.view-all-link:hover {
  background: rgba(59, 130, 246, 0.1);
  text-decoration: none;
  color: #60a5fa;
}

.view-all-link i {
  margin-right: 8px;
}

.vocci-notification-empty,
.vocci-notification-error {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-color);
}

.empty-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
  color: var(--text-color);
}

.vocci-notification-empty p,
.vocci-notification-error p {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

.vocci-notification-empty span {
  font-size: 14px;
  color: var(--text-color);
}

.retry-btn {
  background: linear-gradient(135deg, var(--accent-color), #60a5fa);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  margin-top: 16px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.retry-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .vocci-notification-dropdown {
    width: 320px;
    max-width: calc(100vw - 20px);
    max-height: 350px;
  }
  
  #notification-dropdown {
    top: 60px;
    right: 50%;
    transform: translateX(50%);
  }
  
  .vocci-notification-dropdown::before {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }
}

@media (max-width: 480px) {
  .vocci-notification-dropdown {
    width: 280px;
    max-width: calc(100vw - 20px);
    max-height: 300px;
  }

  #notification-dropdown {
    top: 60px;
    right: 50%;
    transform: translateX(50%);
  }
  
  .vocci-notification-dropdown::before {
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
  }
  
  .vocci-notification-item {
    padding: 8px 12px;
  }
  
  .notification-avatar img {
    width: 36px;
    height: 36px;
  }
  
  .vocci-notification-header {
    padding: 16px 20px 12px;
  }
  
  .vocci-notification-header h3 {
    font-size: 16px;
  }
}

/* Animaciones adicionales - solo para los elementos internos, no para el dropdown completo */
.vocci-notification-item {
  animation: fadeIn 0.3s ease-out; /* Cambiado a fadeIn para evitar movimientos laterales */
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Estilos para el mensaje de login requerido */
.vocci-notification-login-required {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-color);
}

.login-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.7;
  color: var(--accent-color);
}

.vocci-notification-login-required p {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
}

.login-btn {
  background: linear-gradient(135deg, var(--accent-color), #60a5fa);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
