/**
 * Toast Notification System
 * Custom toast notifications with animations and progress bar
 */

/* Toast Container - Fixed to top-right */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
}

/* Individual Toast */
.toast {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    pointer-events: auto;
    overflow: hidden;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Toast Types */
.toast.success {
    border-left-color: #0D7377;
    background: #ffffff;
}

.toast.error {
    border-left-color: #dc2626;
    background: #ffffff;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast.success .toast-icon {
    color: #0D7377;
}

.toast.error .toast-icon {
    color: #dc2626;
}

.toast-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Toast Content */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.5;
    margin: 0;
}

.toast.success .toast-message {
    color: #1f2937;
}

.toast.error .toast-message {
    color: #1f2937;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    color: #6b7280;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.toast-close:hover {
    color: #1f2937;
    background: #f3f4f6;
}

.toast-close svg {
    width: 18px;
    height: 18px;
}

/* Progress Bar Container */
.toast-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border-radius: 0 0 8px 8px;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: progressDeplete 4s linear forwards;
    border-radius: 0 0 8px 8px;
}

.toast.success .toast-progress-bar {
    background: #0D7377;
}

.toast.error .toast-progress-bar {
    background: #dc2626;
}

/* Slide In Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Slide Out Animation */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Progress Bar Animation */
@keyframes progressDeplete {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Toast Exit Animation */
.toast.exiting {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        padding: 14px 16px;
        min-height: 56px;
    }
    
    .toast-message {
        font-size: 13px;
    }
}

