/* Estilos para notificaciones */
.notifications-container {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  top: 20vh; /* Empieza a 20% de la altura de la pantalla */
  max-height: 70vh; /* Usa solo 70% de la altura de la pantalla */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  pointer-events: none; /* Permite interactuar con elementos debajo */
}

@media (min-width: 1024px) {
  body.with-sidebar:not(.sidebar-collapsed) .notifications-container {
    left: var(--sidebar-width-expanded);
    right: 0;
  }

  body.with-sidebar.sidebar-collapsed .notifications-container {
    left: var(--sidebar-width-collapsed);
    right: 0;
  }
}

.notifications-container::-webkit-scrollbar {
  display: none;
}

.notification-item {
  width: 100%;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  background-color: rgba(255,255,255,0.98);
  backdrop-filter: blur(4px);
  animation: notification-slide-in 0.3s ease-out;
  pointer-events: auto; /* Restaura interacción solo para las notificaciones */
}

.dark .notification-item {
  background-color: rgba(31,41,55,0.98);
  border-color: rgba(75,85,99,0.4);
}

.notification-icon {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
}

.notification-content {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
}

.notification-message {
  color: #374151;
}

.dark .notification-message {
  color: #D1D5DB;
}

.notification-close {
  flex-shrink: 0;
  margin-left: 0.75rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.notification-close:hover {
  opacity: 1;
}

/* Variantes */
.notification-success {
  background-color: rgba(240,253,244,0.98);
  border-color: rgba(167,243,208,0.4);
}

.dark .notification-success {
  background-color: rgba(6,78,59,0.98);
  border-color: rgba(110,231,183,0.4);
}

.notification-error {
  background-color: rgba(254,242,242,0.98);
  border-color: rgba(252,165,165,0.4);
}

.dark .notification-error {
  background-color: rgba(153,27,27,0.98);
  border-color: rgba(248,113,113,0.4);
}

@keyframes notification-slide-in {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* En tema oscuro, todos los íconos deben ser negros para mejor contraste */
html.theme-dark .notification-icon svg,
.dark .notification-icon svg {
  color: #000000 !important;
}

/* Media queries móvil */

@media (max-width: 768px) {
  .notifications-container {
    top: 15vh; /* Empieza un poco más arriba en móvil */
    max-height: 75vh; /* Más espacio vertical en móvil */
    padding: 0 0.5rem;
  }

  .notification-item {
    padding: 0.625rem;
    font-size: 0.875rem;
    max-width: calc(100% - 1rem);
    gap: 0.5rem;
  }

  .notification-icon {
    width: 1rem;
    height: 1rem;
  }

  .notification-close {
    padding: 0.25rem;
  }
}