/* ============================================
   TOAST NOTIFICATION SYSTEM
   ============================================ */

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    max-height: 100vh;
    overflow: visible;
}

/* Individual Toast */
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 440px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--dark-card, #111827);
    border: 1px solid var(--dark-border, #1E293B);
    color: var(--text-primary, #F1F5F9);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    animation: toast-slide-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.toast.toast-removing {
    animation: toast-slide-out 0.3s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    margin-top: 1px;
}

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

.toast-message {
    word-break: break-word;
}

/* Toast Close Button */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary, #94A3B8);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    margin-top: -1px;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #F1F5F9);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    animation: toast-progress linear forwards;
}

/* --- Type Variants --- */

/* Success */
.toast-success {
    border-color: rgba(16, 185, 129, 0.3);
}
.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}
.toast-success .toast-progress {
    background: #10B981;
}

/* Error */
.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}
.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}
.toast-error .toast-progress {
    background: #EF4444;
}

/* Warning */
.toast-warning {
    border-color: rgba(245, 158, 11, 0.3);
}
.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}
.toast-warning .toast-progress {
    background: #F59E0B;
}

/* Info */
.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}
.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}
.toast-info .toast-progress {
    background: #3B82F6;
}

/* --- Animations --- */

@keyframes toast-slide-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

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

/* ============================================
   CONFIRM MODAL
   ============================================ */

.toast-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: confirm-fade-in 0.2s ease forwards;
}

.toast-confirm-overlay.confirm-removing {
    animation: confirm-fade-out 0.2s ease forwards;
}

.toast-confirm-box {
    background: var(--dark-card, #111827);
    border: 1px solid var(--dark-border, #1E293B);
    border-radius: 16px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    animation: confirm-scale-in 0.25s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.toast-confirm-overlay.confirm-removing .toast-confirm-box {
    animation: confirm-scale-out 0.2s ease forwards;
}

.toast-confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.toast-confirm-message {
    color: var(--text-primary, #F1F5F9);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.toast-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.toast-confirm-btn {
    padding: 10px 24px;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
}

.toast-confirm-btn:active {
    transform: scale(0.97);
}

.toast-confirm-btn-cancel {
    background: var(--dark-border, #1E293B);
    color: var(--text-secondary, #94A3B8);
}

.toast-confirm-btn-cancel:hover {
    background: #2D3748;
    color: var(--text-primary, #F1F5F9);
}

.toast-confirm-btn-ok {
    background: #3B82F6;
    color: #fff;
}

.toast-confirm-btn-ok:hover {
    background: #2563EB;
}

@keyframes confirm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes confirm-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes confirm-scale-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes confirm-scale-out {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.9); opacity: 0; }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}
