/* ════════════════════════════════════════════════════════════
   BAK'TUN TECHNOLOGY — mensaje.css
   Sistema de Notificaciones — Paleta Dorada Maya / Blanco
   ════════════════════════════════════════════════════════════ */

/* ── Contenedor ── */
.notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;        /* El contenedor no bloquea clics */
  max-width: 360px;
  width: calc(100vw - 48px);
}

/* ══════════════════════════════════════════════════
   NOTIFICACIÓN BASE
══════════════════════════════════════════════════ */
.notification {
  display: grid;
  grid-template-columns: 40px 1fr 28px;
  grid-template-rows: 1fr auto;
  align-items: start;
  gap: 0 10px;

  background: var(--color-blanco, #ffffff);
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  padding: 14px 14px 0 14px;
  overflow: hidden;
  position: relative;
  pointer-events: all;

  /* Sombra elegante */
  box-shadow:
    0 4px 24px rgba(26, 18, 8, 0.10),
    0 1px 4px  rgba(26, 18, 8, 0.06),
    0 0 0 1px rgba(212, 175, 55, 0.06);

  /* Estado inicial — fuera de pantalla */
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition:
    transform 0.40s cubic-bezier(0.34, 1.3, 0.64, 1),
    opacity   0.30s ease;

  /* Línea de acento izquierda */
  border-left-width: 3px;
  border-left-color: rgba(212, 175, 55, 0.5);
}

/* ── Estado visible ── */
.notification.show {
  transform: translateX(0);
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   ÍCONO
══════════════════════════════════════════════════ */
.notification-icon {
  grid-column: 1;
  grid-row: 1;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  background: rgba(212, 175, 55, 0.10);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* ══════════════════════════════════════════════════
   CONTENIDO
══════════════════════════════════════════════════ */
.notification-content {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 14px;
}

.notification-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-texto-oscuro, #1a1208);
  line-height: 1.3;
}

.notification-message {
  font-family: 'Raleway', 'Segoe UI', sans-serif;
  font-size: 0.80rem;
  font-weight: 500;
  color: var(--color-texto-claro, #7a6540);
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════
   BOTÓN CERRAR
══════════════════════════════════════════════════ */
.notification-close {
  grid-column: 3;
  grid-row: 1;
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-texto-apagado, #a89060);
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.18s ease, color 0.18s ease;
  padding: 0;
  margin-top: 2px;
}
.notification-close:hover {
  background: rgba(212, 175, 55, 0.12);
  color: var(--color-dorado-medio, #b8962e);
}

/* ══════════════════════════════════════════════════
   BARRA DE PROGRESO
══════════════════════════════════════════════════ */
.notification-progress {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 3px;
  border-radius: 0 0 14px 14px;
  margin: 0 -14px;         /* sangrar al borde de la card */
  background: rgba(212, 175, 55, 0.18);
  position: relative;
  overflow: hidden;
}

.notification-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--color-dorado-principal, #d4af37),
    var(--color-dorado-claro, #e8c84a)
  );
  transform-origin: left;
  animation: progressShrink 3.5s linear forwards; /* mismo valor que duration del JS */
}
@keyframes progressShrink {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ══════════════════════════════════════════════════
   VARIANTES POR TIPO
══════════════════════════════════════════════════ */

/* ── SUCCESS ── */
.notification.success {
  border-left-color: var(--color-exito, #10b981);
}
.notification.success .notification-icon {
  background: var(--color-exito-fondo, #ecfdf5);
  border-color: rgba(16, 185, 129, 0.25);
}
.notification.success .notification-icon::before { content: '✓'; font-size: 1rem; color: var(--color-exito, #10b981); font-weight: 700; font-family: sans-serif; }
.notification.success .notification-progress::after {
  background: linear-gradient(90deg, #10b981, #34d399);
}

/* ── ERROR / DANGER ── */
.notification.error,
.notification.danger {
  border-left-color: var(--color-peligro, #ef4444);
}
.notification.error .notification-icon,
.notification.danger .notification-icon {
  background: var(--color-peligro-fondo, #fef2f2);
  border-color: rgba(239, 68, 68, 0.25);
}
.notification.error .notification-icon::before,
.notification.danger .notification-icon::before { content: '✕'; font-size: 0.95rem; color: var(--color-peligro, #ef4444); font-weight: 700; font-family: sans-serif; }
.notification.error .notification-progress::after,
.notification.danger .notification-progress::after {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

/* ── WARNING ── */
.notification.warning {
  border-left-color: var(--color-advertencia, #f59e0b);
}
.notification.warning .notification-icon {
  background: var(--color-advertencia-fondo, #fffbeb);
  border-color: rgba(245, 158, 11, 0.25);
}
.notification.warning .notification-icon::before { content: '!'; font-size: 1rem; color: var(--color-advertencia, #f59e0b); font-weight: 900; font-family: sans-serif; }
.notification.warning .notification-progress::after {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* ── INFO ── */
.notification.info {
  border-left-color: var(--color-info, #3b82f6);
}
.notification.info .notification-icon {
  background: var(--color-info-fondo, #eff6ff);
  border-color: rgba(59, 130, 246, 0.25);
}
.notification.info .notification-icon::before { content: 'i'; font-size: 1rem; color: var(--color-info, #3b82f6); font-weight: 900; font-style: italic; font-family: Georgia, serif; }
.notification.info .notification-progress::after {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* ── DEFAULT / sin tipo especificado ── */
.notification:not(.success):not(.error):not(.danger):not(.warning):not(.info) .notification-icon {
  font-size: 0.85rem;  /* El emoji 🔔 del JS */
}

/* ══════════════════════════════════════════════════
   RESPONSIVE — MÓVIL
══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .notification-container {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 100%;
  }

  .notification {
    /* En móvil entra desde abajo */
    transform: translateY(calc(100% + 16px));
  }
  .notification.show {
    transform: translateY(0);
  }
}

/* Motion reducido */
@media (prefers-reduced-motion: reduce) {
  .notification {
    transition: opacity 0.2s ease;
    transform: none !important;
  }
  .notification-progress::after {
    animation: none;
    transform: scaleX(0);
  }
}