/* Toast notification container */
#toast-container {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
    width: 90vw;
}

/* Toast base */
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.toast-hide {
    opacity: 0;
    transform: translateY(-16px);
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-16px) scale(0.95);
    }
}

/* Toast icon */
.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

/* Toast text */
.toast-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* Close button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    opacity: 0.5;
    color: inherit;
    transition: opacity 0.15s;
}

.toast-close:hover {
    opacity: 1;
}

/* Type variants */
.toast-info {
    background: rgba(59, 130, 246, 0.92);
    color: #fff;
}
.toast-info .toast-icon {
    background: rgba(255, 255, 255, 0.25);
}

.toast-success {
    background: rgba(34, 197, 94, 0.92);
    color: #fff;
}
.toast-success .toast-icon {
    background: rgba(255, 255, 255, 0.25);
}

.toast-warning {
    background: rgba(245, 158, 11, 0.92);
    color: #fff;
}
.toast-warning .toast-icon {
    background: rgba(255, 255, 255, 0.25);
}

.toast-error {
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
}
.toast-error .toast-icon {
    background: rgba(255, 255, 255, 0.25);
}

/* Dark theme overrides */
[data-theme="dark"] .toast-info {
    background: rgba(30, 64, 175, 0.92);
}
[data-theme="dark"] .toast-success {
    background: rgba(21, 128, 61, 0.92);
}
[data-theme="dark"] .toast-warning {
    background: rgba(161, 98, 7, 0.92);
}
[data-theme="dark"] .toast-error {
    background: rgba(185, 28, 28, 0.92);
}

/* Retry button inside system messages */
.retry-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 14px;
    font-size: 13px;
    color: var(--accent, #3b82f6);
    background: transparent;
    border: 1px solid var(--accent, #3b82f6);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.retry-btn:hover {
    background: var(--accent, #3b82f6);
    color: #fff;
}
