/* ============================================
   Custom Dialog Box - MAXTHON Theme
   ============================================ */

/* Overlay */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-dialog-overlay.active {
    display: flex;
    opacity: 1;
}

/* Dialog Container */
.custom-dialog {
    background: white;
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid #dee2e6;
}

/* پس‌زمینه در تم‌های تاریک */
html[data-bs-theme="dark"] .custom-dialog,
html[data-bs-theme="blue-theme"] .custom-dialog {
    background: var(--bs-body-bg);
    border-color: var(--bs-border-color);
}

.custom-dialog-overlay.active .custom-dialog {
    transform: scale(1);
}

/* Dialog Header - پیش‌فرض: قرمز (برای حذف) */
.custom-dialog-header {
    background: #ef4444;
    padding: 1.5rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.custom-dialog-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}

.custom-dialog-header-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-dialog-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.custom-dialog-icon i {
    font-size: 28px;
    color: white;
}

.custom-dialog-title {
    font-family: Dana, sans-serif;
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Dialog Body */
.custom-dialog-body {
    padding: 2rem;
}

.custom-dialog-message {
    font-family: Dana, sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--bs-body-color);
    text-align: right;
    margin: 0;
    direction: rtl;
}

/* Dialog Footer */
.custom-dialog-footer {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* وقتی فقط یک دکمه هست، پهنای مناسب داشته باشد */
.custom-dialog-footer.single-button {
    justify-content: center;
}

.custom-dialog-footer.single-button .custom-dialog-btn-confirm {
    min-width: 150px;
}

.custom-dialog-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 10px;
    font-family: Dana, sans-serif;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.custom-dialog-btn i {
    font-size: 20px;
}

/* Confirm Button */
.custom-dialog-btn-confirm {
    background: #ef4444;
    color: white;
}

.custom-dialog-btn-confirm:hover {
    transform: scale(1.05);
    background: #dc2626;
}

/* Cancel Button */
.custom-dialog-btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
}

.custom-dialog-btn-cancel:hover {
    background: #5a6268;
    transform: scale(1.05);
}

/* Danger Dialog - Header قرمز (برای حذف) */
.custom-dialog.danger .custom-dialog-header {
    background: #ef4444;
}

.custom-dialog.danger .custom-dialog-btn-confirm {
    background: #ef4444;
    color: white;
}

.custom-dialog.danger .custom-dialog-btn-confirm:hover {
    background: #dc2626;
}

/* Success Dialog - Header سبز */
.custom-dialog.success .custom-dialog-header {
    background: #10b981;
}

.custom-dialog.success .custom-dialog-btn-confirm {
    background: #10b981;
    color: white;
}

.custom-dialog.success .custom-dialog-btn-confirm:hover {
    background: #059669;
}

/* Warning Dialog - Header زرد/طلایی */
.custom-dialog.warning .custom-dialog-header {
    background: #fbbf24;
}

.custom-dialog.warning .custom-dialog-btn-confirm {
    background: #fbbf24;
    color: white;
}

.custom-dialog.warning .custom-dialog-btn-confirm:hover {
    background: #f59e0b;
}

/* Info Dialog - Header آبی */
.custom-dialog.info .custom-dialog-header {
    background: #3b82f6;
}

.custom-dialog.info .custom-dialog-btn-confirm {
    background: #3b82f6;
    color: white;
}

.custom-dialog.info .custom-dialog-btn-confirm:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 576px) {
    .custom-dialog {
        width: 95%;
        max-width: none;
    }

    .custom-dialog-header {
        padding: 1.25rem 1.5rem;
    }

    .custom-dialog-body {
        padding: 1.5rem;
    }

    .custom-dialog-footer {
        flex-direction: column;
        padding: 1rem 1.5rem 1.5rem;
    }

    .custom-dialog-btn {
        width: 100%;
    }
}

/* Animation */
@keyframes dialogBounce {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.custom-dialog-overlay.active .custom-dialog {
    animation: dialogBounce 0.4s ease-out;
}

