/* Custom Toast Notification System */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none; /* Let clicks pass through the container */
}

.custom-toast {
    pointer-events: auto; /* Re-enable clicks on the toast itself */
    min-width: 300px;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy enter */
}

/* Dark mode support */
html:not(.light-mode) .custom-toast {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
}

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

.custom-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.toast-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main, #0f172a);
}

html:not(.light-mode) .toast-title {
    color: #f8fafc;
}

.toast-message {
    font-size: 13px;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}

html:not(.light-mode) .toast-message {
    color: #94a3b8;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 4px;
    margin: -4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main, #0f172a);
}

html:not(.light-mode) .toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Progress bar inside toast */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

body.dark-mode .toast-progress, [data-theme="dark"] .toast-progress {
    background: rgba(255, 255, 255, 0.1);
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: transform 10ms linear;
}

.toast-success .toast-progress-bar { background: #10b981; }
.toast-error .toast-progress-bar { background: #ef4444; }
.toast-warning .toast-progress-bar { background: #f59e0b; }
.toast-info .toast-progress-bar { background: #3b82f6; }
