/**
 * Toast Notification Styles
 * Stripe-level professional design
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Toast Base */
.toast {
    min-width: 320px;
    max-width: 420px;
    background: rgba(26, 32, 44, 0.98);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    padding: 16px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
}

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

.toast.hide {
    transform: translateX(450px);
    opacity: 0;
    transition: all 0.2s ease-in;
}

/* Toast Icon */
.toast-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #fff;
}

.toast-message {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
    transform-origin: left;
    animation: progress 3s linear forwards;
}

@keyframes progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Toast Types */
.toast-success {
    border-left: 3px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-success .toast-progress {
    background: #10b981;
}

.toast-error {
    border-left: 3px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-error .toast-progress {
    background: #ef4444;
}

.toast-warning {
    border-left: 3px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-warning .toast-progress {
    background: #f59e0b;
}

.toast-info {
    border-left: 3px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-info .toast-progress {
    background: #3b82f6;
}

/* Hover Effects */
.toast:hover {
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }

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

    .toast.hide {
        transform: translateY(-100px);
    }
}

/* Cart Badge Animations */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    transition: all 0.3s ease;
}

/* Badge Pop Animation */
@keyframes badgePop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

.cart-badge.pop {
    animation: badgePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Badge Pulse Animation */
@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4),
            0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    50% {
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4),
            0 0 0 8px rgba(239, 68, 68, 0);
    }
}

.cart-badge.pulse {
    animation: badgePulse 1.5s ease-in-out infinite;
}

/* Badge Shake Animation */
@keyframes badgeShake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

.cart-badge.shake {
    animation: badgeShake 0.5s ease;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
    color: #fff;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ripple Effect */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Success Checkmark */
.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    margin: 10% auto;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill 0.4s ease-in-out 0.4s forwards,
        scale 0.3s ease-in-out 0.9s both;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {

    0%,
    100% {
        transform: none;
    }

    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #10b981;
    }
}