/* ==========================================================================
   KASHIR VIP MODERN CSS DIALOG & TOAST SYSTEM
   Replaces native javascript alerts and confirms with ultra-modern UI
   ========================================================================== */

/* --------------------------------------------------
   1. Toast Notifications Container
   -------------------------------------------------- */
#kashir-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 92%;
    max-width: 440px;
    pointer-events: none;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.kashir-toast {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 14px 35px -4px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
    transform: translateY(-30px) scale(0.92);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.kashir-toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.kashir-toast.hide {
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.kashir-toast-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.kashir-toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kashir-toast-title {
    font-weight: 800;
    font-size: 0.92rem;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 2px;
}

.kashir-toast-message {
    font-size: 0.84rem;
    color: #475569;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
}

.kashir-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.kashir-toast-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* Toast Progress Bar */
.kashir-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.08);
}

.kashir-toast-progress-bar {
    height: 100%;
    width: 100%;
    transition: width linear;
}

/* Variants */
.kashir-toast.toast-success {
    border-color: rgba(16, 185, 129, 0.3);
}
.kashir-toast.toast-success .kashir-toast-icon {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #059669;
}
.kashir-toast.toast-success .kashir-toast-progress-bar {
    background: #10b981;
}

.kashir-toast.toast-error, .kashir-toast.toast-danger {
    border-color: rgba(239, 68, 68, 0.3);
}
.kashir-toast.toast-error .kashir-toast-icon, .kashir-toast.toast-danger .kashir-toast-icon {
    background: linear-gradient(135deg, #ffe4e6, #fecdd3);
    color: #e11d48;
}
.kashir-toast.toast-error .kashir-toast-progress-bar, .kashir-toast.toast-danger .kashir-toast-progress-bar {
    background: #ef4444;
}

.kashir-toast.toast-warning {
    border-color: rgba(245, 158, 11, 0.3);
}
.kashir-toast.toast-warning .kashir-toast-icon {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}
.kashir-toast.toast-warning .kashir-toast-progress-bar {
    background: #f59e0b;
}

.kashir-toast.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}
.kashir-toast.toast-info .kashir-toast-icon {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
}
.kashir-toast.toast-info .kashir-toast-progress-bar {
    background: #3b82f6;
}


/* --------------------------------------------------
   2. Modern Modal Dialog (Alert / Confirm)
   -------------------------------------------------- */
.kashir-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    padding: 16px;
    box-sizing: border-box;
}

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

.kashir-dialog-box {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 2rem 1.75rem 1.5rem;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transform: scale(0.85) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    position: relative;
}

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

.kashir-dialog-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    position: relative;
    box-shadow: 0 8px 20px -4px rgba(0,0,0,0.1);
}

.kashir-dialog-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.kashir-dialog-message {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    white-space: pre-line;
    word-break: break-word;
}

.kashir-dialog-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    font-size: 1rem;
    font-family: inherit;
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    text-align: right;
}

.kashir-dialog-input:focus {
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.dark-mode .kashir-dialog-input {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

.dark-mode .kashir-dialog-input:focus {
    border-color: #6366f1;
    background: #1e293b;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

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

.kashir-dialog-btn {
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    flex: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.kashir-dialog-btn:active {
    transform: scale(0.96);
}

.kashir-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.kashir-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.kashir-btn-confirm-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.kashir-btn-confirm-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
}

.kashir-btn-confirm-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.kashir-btn-confirm-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.kashir-btn-confirm-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}
.kashir-btn-confirm-primary:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.kashir-btn-confirm-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.kashir-btn-confirm-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

/* Modal Variant Colors */
.dialog-type-danger .kashir-dialog-icon-wrapper {
    background: linear-gradient(135deg, #fee2e2, #fecdd3);
    color: #e11d48;
}
.dialog-type-success .kashir-dialog-icon-wrapper {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #059669;
}
.dialog-type-warning .kashir-dialog-icon-wrapper {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}
.dialog-type-info .kashir-dialog-icon-wrapper {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
}

/* --------------------------------------------------
   3. Dark Mode Support
   -------------------------------------------------- */
.dark-mode .kashir-toast {
    background: rgba(30, 41, 59, 0.95);
    border-color: #334155;
    color: #f1f5f9;
}
.dark-mode .kashir-toast-title {
    color: #f8fafc;
}
.dark-mode .kashir-toast-message {
    color: #94a3b8;
}
.dark-mode .kashir-toast-close {
    color: #64748b;
}
.dark-mode .kashir-toast-close:hover {
    color: #f8fafc;
    background: #334155;
}

.dark-mode .kashir-dialog-box {
    background: #1e293b;
    border-color: #334155;
}
.dark-mode .kashir-dialog-title {
    color: #f8fafc;
}
.dark-mode .kashir-dialog-message {
    color: #94a3b8;
}
.dark-mode .kashir-btn-cancel {
    background: #334155;
    color: #cbd5e1;
}
.dark-mode .kashir-btn-cancel:hover {
    background: #475569;
    color: #ffffff;
}
