/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 90%;
    width: 420px;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    backdrop-filter: blur(12px);
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
}

.toast-text {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
}

.toast-close {
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.85rem;
    padding: 4px;
    transition: opacity 0.2s;
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toastIn {
    0% { opacity: 0; transform: translateY(-30px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-20px) scale(0.95); }
}

@media (max-width: 480px) {
    .toast-container {
        top: 10px;
        width: calc(100% - 20px);
    }
    .toast {
        padding: 12px 16px;
        font-size: 0.82rem;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    z-index: 9998;
    direction: rtl;
}

.loading-box {
    background: var(--bg-section, #fff);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    color: var(--text-color, #1e293b);
}

.loading-box .spinner {
    color: var(--primary, #d9822b);
    width: 48px;
    height: 48px;
    border-width: 5px;
    margin-bottom: 1rem;
}

.loading-box p {
    font-size: 0.95rem;
    font-weight: 600;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

