﻿/* Toast Notification Styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 100%;
}

.toast {
    background: var(--whatsapp-card-bg, #1e1e1e);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--whatsapp-border, #2a2a2a);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

    .toast.show {
        transform: translateX(0);
        opacity: 1;
    }

    .toast.hide {
        transform: translateX(400px);
        opacity: 0;
    }

.toast-success {
    border-left: 4px solid var(--whatsapp-primary, #25D366);
}

    .toast-success .toast-icon {
        color: var(--whatsapp-primary, #25D366);
    }

.toast-error {
    border-left: 4px solid #dc3545;
}

    .toast-error .toast-icon {
        color: #dc3545;
    }

.toast-icon {
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--whatsapp-text-primary, #ffffff);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--whatsapp-text-secondary, #b3b3b3);
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: var(--whatsapp-text-secondary, #b3b3b3);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-size: 12px;
    margin-top: 1px;
}

    .toast-close:hover {
        background: var(--whatsapp-hover, #333333);
        color: var(--whatsapp-text-primary, #ffffff);
    }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transition: width 4s linear;
    border-radius: 0 0 12px 12px;
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, var(--whatsapp-primary, #25D366), var(--whatsapp-secondary, #128C7E));
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

/* Hover effect to pause auto-close */
.toast:hover .toast-progress {
    animation-play-state: paused;
}

/* Multiple toast stacking */
.toast:nth-child(2) {
    margin-top: 10px;
}

.toast:nth-child(3) {
    margin-top: 20px;
}

.toast:nth-child(4) {
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        padding: 14px;
        margin: 0;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 5px;
        right: 5px;
        left: 5px;
    }

    .toast {
        padding: 12px;
        border-radius: 8px;
    }

    .toast-icon {
        font-size: 18px;
    }

    .toast-close {
        font-size: 11px;
    }
}

/* Animation keyframes for enhanced effects */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Success and Error specific styling */
.toast-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--whatsapp-primary, #25D366), transparent);
    opacity: 0.3;
}

.toast-error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #dc3545, transparent);
    opacity: 0.3;
}

/* Pulse effect for icons */
.toast-success .toast-icon i {
    animation: successPulse 2s ease-in-out infinite;
}

.toast-error .toast-icon i {
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes errorPulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}
