/* ============================================================
   NOTIFICACIONES TOAST (SISTEMA DE AVISOS)
   Estilos Glassmorphism Premium - Anexit Identity
   ============================================================ */

.toast-container {
    position: fixed !important;
    top: 1rem !important;
    right: 1.5rem !important;
    z-index: 10002 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 12px !important;
    pointer-events: none !important;
    width: auto !important;
    max-width: 420px !important;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 44px 20px 16px;
    border-radius: 14px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    pointer-events: auto;
    cursor: default;
    width: 100%;
    opacity: 0;
    transform: translateX(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    /* Mantenemos hidden para el borde radius */
}

.toast.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    /* Aumentado ligeramente para visibilidad */
    background: rgba(255, 255, 255, 0.6);
    /* Más opaco */
    width: 100%;
    transform-origin: left;
    z-index: 10;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2));
}

/* --- Estados Estándar --- */

.toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.9) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35) !important;
}

.toast-sync {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.9) 0%, rgba(5, 150, 105, 0.95) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.35) !important;
}

.toast-error {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.9) 0%, rgba(153, 27, 27, 0.9) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.35) !important;
}

.toast-ai {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9) 0%, rgba(49, 46, 129, 0.95) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.35) !important;
}

.toast-save {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.9) 0%, rgba(17, 94, 89, 0.95) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.35) !important;
}

.toast-delete {
    background: linear-gradient(135deg, #374151 0%, #111827 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(17, 24, 39, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-delete .toast-message {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toast-info {
    background: linear-gradient(135deg, rgba(66, 99, 235, 0.9) 0%, rgba(13, 0, 158, 0.95) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(66, 99, 235, 0.35) !important;
}

.toast-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(146, 64, 14, 1) 100%) !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4) !important;
}

.toast-warning .toast-message {
    text-shadow: 0 1px 3px rgba(139, 64, 0, 0.4);
}

/* --- Estados Premium & Brand --- */

/* Toast Premium - Golden Glass Elite */
.toast-premium {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95) 0%, rgba(255, 140, 0, 1) 100%);
    color: white;
    box-shadow: 0 15px 35px rgba(212, 140, 0, 0.4), 0 0 20px rgba(255, 255, 255, 0.3) inset;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    padding-top: 18px;
}

.toast-premium .toast-message {
    font-weight: 600 !important;
    text-shadow: 0 1px 3px rgba(139, 64, 0, 0.3);
    /* Sombra bronce para legibilidad */
}

.toast-premium .toast-action-btn {
    background: transparent !important;
    border: 1.5px solid rgba(255, 255, 255, 0.6) !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 700;
    transition: all 0.3s ease;
}

.toast-premium .toast-action-btn:hover {
    background: white !important;
    color: #df8c00 !important;
    /* Color oro oscuro */
    text-shadow: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Toast Brand - Deep Blue Anexit Official */
.toast-brand {
    background: linear-gradient(135deg, rgba(13, 0, 158, 0.95) 0%, rgba(7, 0, 79, 1) 100%);
    color: white;
    box-shadow: 0 15px 40px rgba(7, 0, 79, 0.5), 0 0 25px rgba(255, 255, 255, 0.15) inset;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    padding-top: 18px;
}

/* Animaciones Shimmer para Premium y Brand */
.toast-premium::after,
.toast-brand::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: toastShimmer 3s infinite linear;
    pointer-events: none;
}

@keyframes toastShimmer {
    0% {
        transform: translate(-100%, -100%) rotate(45deg);
    }

    100% {
        transform: translate(100%, 100%) rotate(45deg);
    }
}

@keyframes giftSway {
    0% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }

    100% {
        transform: rotate(-10deg);
    }
}

.gift-anim {
    animation: giftSway 2s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes scanPulse {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1) rotate(15deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.8;
    }
}

.sync-anim {
    animation: scanPulse 2.5s ease-in-out infinite;
}

@keyframes sparklesPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6));
    }
}

.ai-anim {
    animation: sparklesPulse 2s ease-in-out infinite;
}


/* Animación para reloj de arena */
@keyframes spinSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(180deg);
    }
}

.spin-slow {
    animation: spinSlow 3s ease-in-out infinite alternate;
}

@keyframes intenseShake {

    0%,
    20% {
        transform: translateX(0) scale(1);
    }

    2%,
    6%,
    10%,
    14%,
    18% {
        transform: translateX(-4px) scale(1.05);
    }

    4%,
    8%,
    12%,
    16% {
        transform: translateX(4px) scale(1.05);
    }

    25%,
    100% {
        transform: translateX(0) scale(1);
    }
}

.error-anim {
    animation: intenseShake 2.3s ease-in-out 3;
}

@keyframes deleteShake {

    0%,
    100% {
        transform: translateY(0);
    }

    20%,
    60% {
        transform: translateY(-3px);
    }

    40%,
    80% {
        transform: translateY(3px);
    }
}

.delete-anim {
    animation: deleteShake 0.5s ease-in-out 2;
}

@keyframes warningPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
        filter: drop-shadow(0 0 0px rgba(255, 255, 255, 0));
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    }
}

.warning-anim {
    animation: warningPulse 2s infinite ease-in-out;
}

/* --- Elementos Internos --- */

.toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-message {
    line-height: 1.5;
}

.toast-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toast-brand .toast-action-btn {
    background: var(--premium-gradient-primary, linear-gradient(135deg, #0D009E, #07004F));
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.toast-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.toast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px;
}

.toast-close:hover {
    color: white;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .toast-container {
        top: auto !important;
        bottom: 30px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none !important;
        align-items: center !important;
        width: auto !important;
        height: auto !important;
    }

    .toast {
        min-width: unset;
        width: 100%;
        transform: translateY(20px) scale(0.95);
    }

    .toast.show {
        transform: translateY(0) scale(1);
    }
}