/**
 * Beautiful Toast Notification Styles
 * Mobile-friendly, non-intrusive design
 */

/* Toast Container — top center (horizontally centered, near the top) */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 40px);
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #3b82f6;
    position: relative;
    overflow: hidden;
}

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

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

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

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

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

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

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

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

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

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-center;
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.toast-close:active {
    transform: scale(0.95);
}

/* Toast takes the full width of the centered container. */
.toast {
    width: 100%;
    box-sizing: border-box;
}

/* Toast Animations — fade + scale from center. */
@keyframes slideIn {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.92);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-show {
    animation: none;
}

.toast-exit {
    animation: slideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Progress Bar (Optional) */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progress 3s linear forwards;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Mobile Responsive — top center, just a bit narrower. */
@media (max-width: 640px) {
    .toast-container {
        top: 16px;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 400px;
    }
    
    .toast {
        padding: 14px 16px;
    }
    
    .toast-icon {
        font-size: 20px;
    }
    
    .toast-message {
        font-size: 13px;
    }
}

/* Dark Theme Support (Optional) */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1e293b;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .toast-message {
        color: #f1f5f9;
    }
    
    .toast-close {
        color: #cbd5e1;
    }
    
    .toast-close:hover {
        background: #334155;
        color: #e2e8f0;
    }
}
