/**
 * Toast Notifications - نظام الإشعارات العصري
 * Talabatk Toast CSS
 */

/* ===== Toast Notifications ===== */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 99999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

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

/* أيقونات Toast */
.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.2s;
}

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

/* أنواع Toast */
.toast-success {
    border-right: 4px solid #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error {
    border-right: 4px solid #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-warning {
    border-right: 4px solid #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-info {
    border-right: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

/* ===== Confirm Modal ===== */
.toast-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.toast-confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.toast-confirm-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.toast-confirm-dialog {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
}

.toast-confirm-modal.show .toast-confirm-dialog {
    transform: scale(1);
}

.toast-confirm-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-confirm-header i {
    font-size: 24px;
}

.toast-confirm-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.toast-confirm-body {
    padding: 25px 20px;
}

.toast-confirm-body p {
    margin: 0;
    color: #333;
    font-size: 15px;
    line-height: 1.6;
}

.toast-confirm-footer {
    padding: 15px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.toast-confirm-footer button {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cairo', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-confirm-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.toast-confirm-footer .btn-secondary:hover {
    background: #5a6268;
}

.toast-confirm-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.toast-confirm-footer .btn-danger:hover {
    background: #c82333;
}

.toast-confirm-footer .btn-success {
    background: #28a745;
    color: white;
}

.toast-confirm-footer .btn-success:hover {
    background: #218838;
}

.toast-confirm-footer .btn-primary {
    background: #007bff;
    color: white;
}

.toast-confirm-footer .btn-primary:hover {
    background: #0056b3;
}

/* ===== Loading Spinner ===== */
.toast-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.toast-loading.show {
    opacity: 1;
    visibility: visible;
}

.toast-loading-content {
    background: white;
    padding: 30px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    font-family: 'Cairo', sans-serif;
}

.toast-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.toast-loading-content span {
    color: #333;
    font-size: 15px;
    font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: calc(100% - 20px);
    }
    
    .toast-confirm-dialog {
        width: 95%;
    }
}

/* ===== Multiple Toasts Stacking ===== */
.toast-notification:nth-child(2) {
    top: 100px;
}

.toast-notification:nth-child(3) {
    top: 180px;
}

.toast-notification:nth-child(4) {
    top: 260px;
}
