/* ===== SISTEMA MODERNO DE NOTIFICACIONES SSR ===== */

/* Contenedor principal de notificaciones */
#ssr-notification-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  pointer-events: none;
}

/* Notificación individual */
.ssr-notification {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: flex-start;
  padding: 16px;
  min-height: 72px;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top right;
  animation: ssr-slide-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

/* Borde izquierdo según tipo */
.ssr-notification::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--notification-color);
}

/* Animación de entrada */
@keyframes ssr-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* Animación de salida */
@keyframes ssr-slide-out {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 200px;
    margin-bottom: 12px;
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.ssr-notification.hiding {
  animation: ssr-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Hover effect */
.ssr-notification:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Contenedor del icono */
.ssr-notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}

.ssr-notification-icon i.material-icons {
  font-size: 24px;
  color: white;
}

/* Contenedor del contenido */
.ssr-notification-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Título de la notificación */
.ssr-notification-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0;
}

/* Mensaje de la notificación */
.ssr-notification-message {
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  margin: 0;
  word-wrap: break-word;
}

/* Botón de cerrar */
.ssr-notification-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 8px;
  cursor: pointer;
  background: transparent;
  border: none;
  transition: all 0.2s;
  color: #999;
}

.ssr-notification-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

.ssr-notification-close i.material-icons {
  font-size: 20px;
}

/* Barra de progreso de auto-cierre */
.ssr-notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.ssr-notification-progress-bar {
  height: 100%;
  background: var(--notification-color);
  animation: ssr-progress linear forwards;
  animation-duration: 6s; /* Valor por defecto, se sobrescribe dinámicamente en JS */
  transform-origin: left;
}

@keyframes ssr-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Pausar animación al hacer hover */
.ssr-notification:hover .ssr-notification-progress-bar {
  animation-play-state: paused;
}

/* ===== TIPOS DE NOTIFICACIONES ===== */

/* Error */
.ssr-notification.error {
  --notification-color: #ef4444;
}

.ssr-notification.error .ssr-notification-icon {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Success */
.ssr-notification.success {
  --notification-color: #10b981;
}

.ssr-notification.success .ssr-notification-icon {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Warning */
.ssr-notification.warning {
  --notification-color: #f59e0b;
}

.ssr-notification.warning .ssr-notification-icon {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Info */
.ssr-notification.info {
  --notification-color: #3b82f6;
}

.ssr-notification.info .ssr-notification-icon {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #ssr-notification-container {
    right: 10px;
    left: 10px;
    top: 70px;
    max-width: none;
  }

  .ssr-notification {
    padding: 14px;
  }

  .ssr-notification-icon {
    width: 36px;
    height: 36px;
  }

  .ssr-notification-icon i.material-icons {
    font-size: 20px;
  }

  .ssr-notification-title {
    font-size: 14px;
  }

  .ssr-notification-message {
    font-size: 13px;
  }
}

/* ===== COMPATIBILIDAD CON SISTEMA ANTIGUO ===== */
/* Ocultar notificaciones antiguas */
#f-session-error-container,
#f-session-success-container {
  display: none !important;
}

