/* ================================
   SISTEMA DE NOTIFICACIONES GLOBAL
   ============================== */

#notificationContainer {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}

.header-notification-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 18px;
}

.header-notification-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.header-notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  display: none;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e50914;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.header-notification-badge.show {
  display: flex;
}

.header-notification-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  z-index: 1200;
  width: min(360px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #111827;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.header-notification-header,
.header-notification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.header-notification-header {
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
}

.header-notification-list {
  display: flex;
  max-height: 320px;
  flex-direction: column;
  overflow: auto;
}

.header-notification-item {
  align-items: flex-start;
  justify-content: flex-start;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
  text-decoration: none;
}

.header-notification-item:hover,
.header-notification-item.unread {
  background: #f3f4f6;
}

.header-notification-icon {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e5e7eb;
}

.header-notification-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-notification-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.header-notification-body strong {
  font-size: 13px;
}

.header-notification-body span,
.header-notification-empty {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.header-notification-empty {
  padding: 18px 14px;
}

/* Notificación individual */
.notification {
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideInBottom 0.3s ease-out forwards;
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  max-height: 112px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.notification:hover {
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
  transform: translateY(-2px) scale(1.01);
}

/* Avatar del usuario */
.notification-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #e0e0e0;
}

/* Contenido de la notificación */
.notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notification-title {
  font-weight: 700;
  color: #111827;
  font-size: 14px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-message {
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  min-height: 36px;
}

/* Botón cerrar */
.notification-close {
  background: none;
  border: none;
  color: #65676b;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.2s;
}

.notification-close:hover {
  color: #050505;
}

/* Icono de nuevo mensaje */
.notification-icon {
  color: #228ae6;
  font-size: 16px;
  flex-shrink: 0;
}

/* Animaciones */
@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateX(400px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

.notification.removing {
  animation: slideOutRight 0.3s ease-out forwards;
}

/* Variantes de tipo */
.notification.message {
  border-left: 4px solid #228ae6;
}

.notification.success {
  border-left: 4px solid #31a24c;
}

.notification.error {
  border-left: 4px solid #e74c3c;
}

.notification.warning {
  border-left: 4px solid #f39c12;
}

/* Responsive */
@media (max-width: 600px) {
  #notificationContainer {
    top: 65px;
    right: 10px;
    left: 10px;
    max-width: 100%;
  }

  .notification {
    padding: 10px 12px;
  }

  .notification-avatar {
    width: 36px;
    height: 36px;
  }

  .notification-title {
    font-size: 12px;
  }

  .notification-message {
    font-size: 11px;
  }
}

/* Tema oscuro */
body.light #notificationContainer {
}

body.light .notification {
  background: #f0f2f5;
  color: #050505;
}

body.light .notification-title {
  color: #050505;
}

body.light .notification-message {
  color: #65676b;
}

body.light .notification-close {
  color: #65676b;
}

body.light .notification-close:hover {
  color: #050505;
}

/* Tema oscuro (sistema original) */
body:not(.light) .notification {
  background: #2a2a2a;
  color: #f8fafc;
  border-color: #228ae6;
}

body:not(.light) .notification-title {
  color: #f8fafc;
}

body:not(.light) .notification-message {
  color: #94a3b8;
}

body:not(.light) .notification-close {
  color: #94a3b8;
}

body:not(.light) .notification-close:hover {
  color: #f8fafc;
}
