/* Sonner-Inspired Toast & Confirmation Modal System */

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 420px;
    pointer-events: none;
}

/* Sonner-Style Toast */
.toast {
    pointer-events: auto;
    min-width: 320px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: sonnerSlideIn 0.4s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    transform-origin: bottom right;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.toast.success::before {
    background: linear-gradient(180deg, #10b981, #059669);
}

.toast.error::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

.toast.warning::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.toast.info::before {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.toast.success .toast-icon {
    background: #dcfce7;
    color: #16a34a;
}

.toast.error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast.warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast.info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    margin: -4px -4px -4px 0;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #374151;
}

@keyframes sonnerSlideIn {
    0% {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes sonnerSlideOut {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
}

.toast.hiding {
    animation: sonnerSlideOut 0.3s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

/* Confirmation Modal */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.confirm-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);
}

.confirm-modal-overlay.active .confirm-modal {
    transform: scale(1) translateY(0);
}

.confirm-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.confirm-modal-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.confirm-modal-icon.danger {
    background: #fee2e2;
    color: #dc2626;
}

.confirm-modal-icon.info {
    background: #dbeafe;
    color: #2563eb;
}

.confirm-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 8px;
}

.confirm-modal-message {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-modal-btn.cancel {
    background: #f3f4f6;
    color: #4b5563;
}

.confirm-modal-btn.cancel:hover {
    background: #e5e7eb;
}

.confirm-modal-btn.confirm {
    background: #dc2626;
    color: white;
}

.confirm-modal-btn.confirm:hover {
    background: #b91c1c;
}

.confirm-modal-btn.confirm.primary {
    background: #2563eb;
}

.confirm-modal-btn.confirm.primary:hover {
    background: #1d4ed8;
}

.confirm-modal-btn.confirm.warning {
    background: #d97706;
}

.confirm-modal-btn.confirm.warning:hover {
    background: #b45309;
}

@media (max-width: 768px) {
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }

    .confirm-modal {
        margin: 16px;
    }
}