/* ============================================
   Toast Notification System
   Slide-in from upper-right corner
   ============================================ */

/* Container */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 2rem);
}

/* Individual Toast */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md, 8px);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-family, 'Inter', sans-serif);
    line-height: 1.5;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12), 0 4px 10px -4px rgba(0,0,0,0.08);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
    overflow: hidden;
    position: relative;
}

.toast.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Icon */
.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.toast-icon svg {
    width: 20px;
    height: 20px;
}

/* Toast Body */
.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8125rem;
    font-weight: 400;
    opacity: 0.9;
    word-wrap: break-word;
}

/* Toast Close */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.15s ease, opacity 0.15s ease;
    opacity: 0.5;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(0,0,0,0.08);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Progress bar (auto-dismiss timer) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 var(--radius-md, 8px);
    animation: toast-progress-shrink linear forwards;
    transform-origin: left;
}

@keyframes toast-progress-shrink {
    from { width: 100%; }
    to { width: 0%; }
}

/* ── Toast Types ─────────────────────────────── */

/* Success */
.toast-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.toast-success .toast-icon {
    color: #16a34a;
}

.toast-success .toast-progress {
    background-color: #16a34a;
}

/* Error */
.toast-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.toast-error .toast-icon {
    color: #dc2626;
}

.toast-error .toast-progress {
    background-color: #dc2626;
}

/* Warning */
.toast-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.toast-warning .toast-icon {
    color: #d97706;
}

.toast-warning .toast-progress {
    background-color: #d97706;
}

/* Info */
.toast-info {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.toast-info .toast-icon {
    color: #64748b;
}

.toast-info .toast-progress {
    background-color: #64748b;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 479px) {
    .toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
    }

    .toast {
        font-size: 0.8125rem;
        padding: 0.75rem 0.875rem;
    }
}

/* ============================================
   Confirmation Modal System
   Reusable styled confirmation dialogs
   ============================================ */

/* Backdrop */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-backdrop.confirm-show {
    opacity: 1;
    visibility: visible;
}

/* Dialog */
.confirm-dialog {
    background: var(--bg-card, #ffffff);
    border-radius: var(--radius-xl, 16px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 420px;
    transform: scale(0.9) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.confirm-backdrop.confirm-show .confirm-dialog {
    transform: scale(1) translateY(0);
}

/* Icon area */
.confirm-icon-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.5rem 0.5rem;
}

.confirm-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-icon-circle svg {
    width: 28px;
    height: 28px;
}

/* Icon type variants */
.confirm-icon-danger .confirm-icon-circle {
    background-color: #fef2f2;
    color: #dc2626;
}

.confirm-icon-warning .confirm-icon-circle {
    background-color: #fffbeb;
    color: #d97706;
}

.confirm-icon-info .confirm-icon-circle {
    background-color: #f1f5f9;
    color: #64748b;
}

.confirm-icon-success .confirm-icon-circle {
    background-color: #f0fdf4;
    color: #16a34a;
}

/* Body text */
.confirm-body {
    padding: 0.75rem 1.5rem 1rem;
    text-align: center;
}

.confirm-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.confirm-message {
    font-size: 0.875rem;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
}

/* Footer with buttons */
.confirm-footer {
    padding: 0.75rem 1.5rem 1.25rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-footer .btn {
    min-width: 110px;
    font-weight: 600;
    border-radius: var(--radius-md, 8px);
}

/* Responsive */
@media (max-width: 479px) {
    .confirm-dialog {
        margin: 0 0.5rem;
        max-width: 100%;
    }

    .confirm-footer {
        flex-direction: column-reverse;
    }

    .confirm-footer .btn {
        width: 100%;
    }
}
