/* ==========================================================
   NOTIFICACIONES MODERNAS - EPG UNAS
   Tarjeta blanca, icono con color, barra de progreso
   y animación de entrada. Usado por Notify() en toast.js
   ========================================================== */

#toast-container {
	position: fixed;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Posiciones ---------- */
.toast-top-right      { top: 18px; right: 18px; }
.toast-top-left       { top: 18px; left: 18px; }
.toast-bottom-right   { bottom: 18px; right: 18px; }
.toast-bottom-left    { bottom: 18px; left: 18px; }
.toast-top-center     { top: 18px; left: 50%; transform: translateX(-50%); }
.toast-bottom-center  { bottom: 18px; left: 50%; transform: translateX(-50%); }
.toast-top-full-width { top: 12px; left: 12px; right: 12px; }
.toast-bottom-full-width { bottom: 12px; left: 12px; right: 12px; }

/* ---------- Tarjeta ---------- */
#toast-container > .toast {
	--toast-accent: #0ea5e9;
	--toast-soft: #e0f2fe;
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: 360px;
	max-width: calc(100vw - 36px);
	margin: 0;
	padding: 14px 40px 16px 14px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .97) !important;
	background-image: none !important;
	color: #374151;
	border: 1px solid rgba(15, 23, 42, .06);
	box-shadow:
		0 20px 40px -12px rgba(15, 23, 42, .28),
		0 4px 10px -4px rgba(15, 23, 42, .10);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	overflow: hidden;
	cursor: pointer;
	pointer-events: auto;
	animation: toast-in-right .45s cubic-bezier(.21, 1.02, .73, 1) both;
	opacity: 1 !important;
	filter: none !important;
}

.toast-top-left > .toast,
.toast-bottom-left > .toast {
	animation-name: toast-in-left !important;
}

.toast-top-center > .toast,
.toast-top-full-width > .toast {
	animation-name: toast-in-top !important;
}

.toast-bottom-center > .toast,
.toast-bottom-full-width > .toast {
	animation-name: toast-in-bottom !important;
}

.toast-top-full-width > .toast,
.toast-bottom-full-width > .toast {
	width: auto;
	max-width: none;
}

/* Anula los iconos antiguos (Font Awesome en :before) */
#toast-container > .toast::before {
	content: none !important;
	display: none !important;
}

#toast-container > .toast:hover {
	box-shadow:
		0 24px 48px -12px rgba(15, 23, 42, .34),
		0 6px 12px -4px rgba(15, 23, 42, .12);
}

/* ---------- Icono ---------- */
.toast-icon {
	flex-shrink: 0;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	background: var(--toast-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	animation: toast-pop .5s .15s cubic-bezier(.34, 1.56, .64, 1) both;
}

.toast-icon::before {
	content: "";
	width: 20px;
	height: 20px;
	background: var(--toast-accent);
	-webkit-mask: var(--toast-svg) center / contain no-repeat;
	mask: var(--toast-svg) center / contain no-repeat;
}

/* ---------- Texto ---------- */
.toast-body {
	flex: 1;
	min-width: 0;
	padding-top: 1px;
}

.toast-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: #111827;
}

.toast-message {
	margin-top: 3px;
	font-size: 13px;
	line-height: 1.45;
	color: #4b5563;
	word-wrap: break-word;
	-ms-word-wrap: break-word;
}

.toast-message a,
.toast-message label {
	color: var(--toast-accent);
	font-weight: 600;
}

.toast-message a:hover {
	text-decoration: underline;
}

/* ---------- Botón cerrar ---------- */
button.toast-close-button,
.toast-close-button {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #9ca3af;
	font-family: Arial, sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 26px;
	text-align: center;
	text-shadow: none;
	opacity: 1;
	cursor: pointer;
	-webkit-appearance: none;
	transition: background .15s ease, color .15s ease;
}

.toast-close-button:hover,
.toast-close-button:focus {
	background: #f3f4f6;
	color: #111827;
	outline: none;
	opacity: 1;
}

/* ---------- Barra de progreso ---------- */
.toast-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--toast-soft);
}

.toast-progress span {
	display: block;
	height: 100%;
	width: 100%;
	background: var(--toast-accent);
	transform-origin: left center;
	animation: toast-progress linear forwards;
}

#toast-container > .toast:hover .toast-progress span {
	animation-play-state: paused;
}

/* ---------- Tipos ---------- */
.toast-type-success {
	--toast-accent: #059669 !important;
	--toast-soft: #d1fae5 !important;
	--toast-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.toast-type-warning {
	--toast-accent: #d97706 !important;
	--toast-soft: #fef3c7 !important;
	--toast-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.toast-type-error {
	--toast-accent: #dc2626 !important;
	--toast-soft: #fee2e2 !important;
	--toast-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
}

.toast-type-info {
	--toast-accent: #0284c7 !important;
	--toast-soft: #e0f2fe !important;
	--toast-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

/* ---------- Animaciones ---------- */
@keyframes toast-in-right {
	from { opacity: 0; transform: translateX(110%) scale(.96); }
	to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-in-left {
	from { opacity: 0; transform: translateX(-110%) scale(.96); }
	to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-in-top {
	from { opacity: 0; transform: translateY(-120%) scale(.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-in-bottom {
	from { opacity: 0; transform: translateY(120%) scale(.96); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-pop {
	from { transform: scale(.4); opacity: 0; }
	to   { transform: scale(1); opacity: 1; }
}

@keyframes toast-progress {
	from { transform: scaleX(1); }
	to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
	#toast-container > .toast,
	.toast-icon {
		animation: none !important;
	}
}

/* ---------- Celular ---------- */
@media (max-width: 575px) {
	.toast-top-right, .toast-top-left, .toast-top-center {
		top: 10px; left: 10px; right: 10px; transform: none;
	}
	.toast-bottom-right, .toast-bottom-left, .toast-bottom-center {
		bottom: 10px; left: 10px; right: 10px; transform: none;
	}
	#toast-container > .toast {
		width: auto;
		max-width: none;
	}
}
