
:root {
  --success-bg: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  --success-color: #155724;
  --success-border: #28a745;
  --error-bg: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  --error-color: #721c24;
  --error-border: #dc3545;
  --warning-bg: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  --warning-color: #856404;
  --warning-border: #ffc107;
  --info-bg: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  --info-color: #0c5460;
  --info-border: #17a2b8;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 12px;
  --transition: all 0.3s ease;
}

.mensaje {
  padding: 20px 25px;
  margin: 20px 0 30px 0;
  border-radius: var(--border-radius);
  font-family: "Poppins", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  display: none;
  animation: slideDown 0.4s ease-out;
  box-shadow: var(--shadow);
  white-space: pre-line;
  position: relative;
  border-left: 6px solid transparent;
  border-right: 1px solid transparent;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.mensaje.exito {
  background: var(--success-bg);
  color: var(--success-color);
  border-left-color: var(--success-border);
  border-right-color: #c3e6cb;
  border-top-color: #c3e6cb;
  border-bottom-color: #c3e6cb;
}

.mensaje.exito::before {
  content: "✅";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  animation: pulse 2s infinite;
}

.mensaje.error {
  background: var(--error-bg);
  color: var(--error-color);
  border-left-color: var(--error-border);
  border-right-color: #f5c6cb;
  border-top-color: #f5c6cb;
  border-bottom-color: #f5c6cb;
}

.mensaje.error::before {
  content: "❌";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.mensaje.warning {
  background: var(--warning-bg);
  color: var(--warning-color);
  border-left-color: var(--warning-border);
  border-right-color: #ffeeba;
  border-top-color: #ffeeba;
  border-bottom-color: #ffeeba;
}

.mensaje.warning::before {
  content: "⚠️";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.mensaje.info {
  background: var(--info-bg);
  color: var(--info-color);
  border-left-color: var(--info-border);
  border-right-color: #bee5eb;
  border-top-color: #bee5eb;
  border-bottom-color: #bee5eb;
}

.mensaje.info::before {
  content: "ℹ️";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.mensaje strong {
  font-weight: 700;
  font-size: 16px;
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mensaje em {
  font-style: italic;
  color: inherit;
}

.mensaje ul,
.mensaje ol {
  margin: 10px 0 10px 20px;
  padding-left: 10px;
}

.mensaje li {
  margin-bottom: 5px;
}

.mensaje hr {
  margin: 15px 0;
  border: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.mensaje p {
  margin-bottom: 10px;
}

.mensaje p:last-child {
  margin-bottom: 0;
}

.mensaje .folio-destacado {
  font-size: 24px;
  font-weight: 700;
  color: var(--success-color);
  background: rgba(255, 255, 255, 0.5);
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-block;
  margin: 10px 0;
  border: 2px dashed var(--success-border);
}

.mensaje .cerrar-notificacion {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  padding: 0 5px;
  font-weight: bold;
}

.mensaje .cerrar-notificacion:hover {
  opacity: 1;
  transform: scale(1.1);
}

.mensaje .icono {
  font-size: 24px;
  margin-right: 10px;
  vertical-align: middle;
}

.mensaje .icono-success {
  color: var(--success-border);
}

.mensaje .icono-error {
  color: var(--error-border);
}

.mensaje .icono-warning {
  color: var(--warning-border);
}

.mensaje .progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  animation: progress 5s linear;
}

@keyframes progress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

@media (max-width: 768px) {
  .mensaje {
    padding: 15px 20px;
    font-size: 14px;
    margin: 15px 0 25px 0;
  }

  .mensaje strong {
    font-size: 15px;
  }

  .mensaje::before {
    width: 35px;
    height: 35px;
    font-size: 18px;
    left: -8px;
  }

  .mensaje .folio-destacado {
    font-size: 20px;
    padding: 8px 16px;
  }
}

@media (max-width: 480px) {
  .mensaje {
    padding: 12px 15px;
    font-size: 13px;
  }

  .mensaje::before {
    display: none;
  }

  .mensaje .cerrar-notificacion {
    font-size: 20px;
    top: 5px;
    right: 10px;
  }

  .mensaje .folio-destacado {
    font-size: 18px;
    padding: 6px 12px;
  }
}

@media print {
  .mensaje {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
    background: #f9f9f9 !important;
    color: #000 !important;
  }

  .mensaje .cerrar-notificacion,
  .mensaje::before {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  .mensaje {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  .mensaje.exito {
    background: linear-gradient(135deg, #1e3a2a 0%, #2d6a4f 100%);
    color: #d4edda;
  }

  .mensaje.error {
    background: linear-gradient(135deg, #3a1e1e 0%, #6a2d2d 100%);
    color: #f8d7da;
  }
}

