/**
 * Toast Notification Styles
 * Ensures reliable, modern, and beautiful toasts across all frontend pages.
 */

/* Container */
#toast-container,
.toast-container {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 2147483647 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    max-width: 400px !important;
    width: auto !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Base Toast Item */
.toast-container .toast,
.toast {
    all: unset !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    padding: 14px 16px !important;
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #64748b !important;
    min-width: 320px !important;
    max-width: 400px !important;
    width: auto !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    opacity: 0 !important;
    transform: translateX(120%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    line-height: 1.5 !important;
}

/* Visible State */
.toast-container .toast.show,
.toast.show {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Exit State */
.toast-container .toast.toast-exit,
.toast.toast-exit {
    animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes toastSlideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Toast Variants */
.toast-container .toast-success,
.toast.toast-success {
    border-left-color: #10b981 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%) !important;
}

.toast-container .toast-success .toast-icon,
.toast.toast-success .toast-icon {
    color: #10b981 !important;
}

.toast-container .toast-error,
.toast.toast-error {
    border-left-color: #ef4444 !important;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%) !important;
}

.toast-container .toast-error .toast-icon,
.toast.toast-error .toast-icon {
    color: #ef4444 !important;
}

.toast-container .toast-warning,
.toast.toast-warning {
    border-left-color: #f59e0b !important;
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%) !important;
}

.toast-container .toast-warning .toast-icon,
.toast.toast-warning .toast-icon {
    color: #f59e0b !important;
}

.toast-container .toast-info,
.toast.toast-info {
    border-left-color: #3b82f6 !important;
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%) !important;
}

.toast-container .toast-info .toast-icon,
.toast.toast-info .toast-icon {
    color: #3b82f6 !important;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0 !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 1px !important;
}

.toast-icon svg {
    width: 22px !important;
    height: 22px !important;
    stroke: currentColor !important;
    display: block !important;
}

/* Toast Content Wrapper */
.toast-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 4px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

/* Toast Title */
.toast-title {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1.35 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

/* Toast Message */
.toast-message {
    font-weight: 400 !important;
    font-size: 13px !important;
    color: #475569 !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    word-break: break-word !important;
}

/* Toast Close Button */
button.toast-close,
.toast-close {
    all: unset !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: -2px -2px 0 auto !important;
    border: none !important;
    border-radius: 6px !important;
    background: transparent !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    opacity: 0.7 !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

button.toast-close:hover,
.toast-close:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
    color: #334155 !important;
    opacity: 1 !important;
}

button.toast-close:active,
.toast-close:active {
    background-color: rgba(0, 0, 0, 0.1) !important;
    transform: scale(0.95) !important;
}

.toast-close svg {
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    display: block !important;
    pointer-events: none !important;
}

/* Responsive Styles for Mobile */
@media (max-width: 640px) {
    #toast-container,
    .toast-container {
        top: 16px !important;
        right: 16px !important;
        left: 16px !important;
        max-width: none !important;
    }

    .toast-container .toast,
    .toast {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 14px !important;
    }
}
