/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    min-width: 320px;
    max-width: 420px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

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

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

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

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

.toast-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

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

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 0;
    height: 3px;
    border-radius: 0 0 var(--border-radius-sm) 0;
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: toast-progress-shrink linear forwards;
}

@keyframes toast-progress-shrink {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Toast types */
.toast--success { border-left-color: var(--success); }
.toast--success .toast-icon { background: #ecfdf5; color: var(--success); }
.toast--success .toast-progress-bar { background: var(--success); }

.toast--error { border-left-color: var(--danger); }
.toast--error .toast-icon { background: #fef2f2; color: var(--danger); }
.toast--error .toast-progress-bar { background: var(--danger); }

.toast--warning { border-left-color: var(--warning); }
.toast--warning .toast-icon { background: #fffbeb; color: var(--warning); }
.toast--warning .toast-progress-bar { background: var(--warning); }

.toast--info { border-left-color: var(--info); }
.toast--info .toast-icon { background: #eff6ff; color: var(--info); }
.toast--info .toast-progress-bar { background: var(--info); }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.confirm-overlay.show {
    opacity: 1;
}

.confirm-dialog {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 28px;
    max-width: 420px;
    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.4, 0, 0.2, 1);
}

.confirm-overlay.show .confirm-dialog {
    transform: scale(1) translateY(0);
}

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

.confirm-icon--danger { background: #fef2f2; color: var(--danger); }
.confirm-icon--warning { background: #fffbeb; color: var(--warning); }
.confirm-icon--info { background: #eff6ff; color: var(--info); }

.confirm-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

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

.confirm-actions .btn {
    min-width: 110px;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.confirm-btn-cancel {
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.confirm-btn-cancel:hover {
    background: var(--bg-tertiary);
}

.confirm-btn-danger {
    background: var(--danger);
    border: 1px solid var(--danger);
    color: #fff;
}

.confirm-btn-danger:hover {
    background: var(--danger-light);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

.confirm-btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
}

.confirm-btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(8,145,178,0.3);
}

/* ===== LOADING STATE ===== */
.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-tertiary) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 120px;
    border-radius: var(--border-radius);
}

.skeleton-row {
    height: 48px;
    margin-bottom: 8px;
}

.skeleton-text {
    height: 14px;
    width: 60%;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 40%;
    margin-bottom: 16px;
}

/* ===== Mobile adjustments ===== */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }

    .confirm-dialog {
        padding: 24px 20px;
    }
}
