/* ═══════════════════════════════════════════════════════════════
   Toast Notification System
   ═══════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 40px);
}

.toast-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(15, 18, 36, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.25s ease, transform 0.25s ease;
    color: #f1f5f9;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
}

.toast-item.toast-removing {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.toast-icon svg {
    width: 14px;
    height: 14px;
}

/* Success */
.toast-item.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

/* Error */
.toast-item.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Warning */
.toast-item.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Info */
.toast-item.toast-info .toast-icon {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.toast-message {
    flex: 1;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.toast-close:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.1);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Progress bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    animation: toast-progress linear forwards;
}

.toast-item.toast-success .toast-progress {
    background: #4ade80;
}

.toast-item.toast-error .toast-progress {
    background: #f87171;
}

.toast-item.toast-warning .toast-progress {
    background: #fbbf24;
}

.toast-item.toast-info .toast-progress {
    background: #a5b4fc;
}

.toast-item {
    position: relative;
    overflow: hidden;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toast-progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .toast-item {
        padding: 12px 14px;
        font-size: 0.8125rem;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Confirm Dialog
   ═══════════════════════════════════════════════════════════════ */

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: confirm-fade-in 0.2s ease;
    padding: 20px;
}

.confirm-overlay.confirm-removing {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.confirm-dialog {
    background: rgba(15, 18, 36, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 28px 24px 20px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: confirm-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.confirm-icon svg {
    width: 28px;
    height: 28px;
}

.confirm-message {
    color: #f1f5f9;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 24px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s, background 0.15s;
    min-width: 90px;
}

.confirm-btn:active {
    transform: scale(0.96);
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #f1f5f9;
}

.confirm-btn-ok {
    color: #fff;
}

.confirm-btn-ok.confirm-btn-danger {
    background: #dc2626;
}

.confirm-btn-ok.confirm-btn-danger:hover {
    background: #ef4444;
}

.confirm-btn-ok.confirm-btn-warning {
    background: #d97706;
}

.confirm-btn-ok.confirm-btn-warning:hover {
    background: #f59e0b;
}

.confirm-btn-ok.confirm-btn-info {
    background: #6366f1;
}

.confirm-btn-ok.confirm-btn-info:hover {
    background: #818cf8;
}

@keyframes confirm-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes confirm-scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .confirm-dialog {
        padding: 24px 18px 16px;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-btn {
        width: 100%;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Prompt Dialog (extends confirm-dialog scaffold)
   showPrompt() reuses .confirm-overlay / .confirm-dialog but adds
   an input/textarea and an inline validation hint. The dialog
   stays visually consistent with showConfirm — same surface,
   same buttons, just with editable copy.
   ═══════════════════════════════════════════════════════════════ */

.confirm-dialog--prompt {
    text-align: left;
    align-items: stretch;
}

.confirm-dialog--prompt .confirm-message {
    text-align: left;
    margin-bottom: 12px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.9);
}

.confirm-prompt-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 18, 36, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    color: #f1f5f9;
    font-size: 0.88rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.confirm-prompt-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.confirm-prompt-input::placeholder {
    color: rgba(148, 163, 184, 0.55);
}

.confirm-prompt-hint {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    border-radius: 6px;
    color: #fecaca;
    font-size: 0.78rem;
    line-height: 1.4;
}