/* لایه پس‌زمینه */
.rbm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 10, 56, .3);
	backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* کانتینر اصلی مودال */
.rbm-container {
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 90vh;
    
    /* انیمیشن پیش‌فرض برای دسکتاپ */
    transform: scale(0.95) translateY(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rbm-overlay.active .rbm-container {
    transform: scale(1) translateY(0);
}

/* هدر */
.rbm-header {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.rbm-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* دکمه بستن */
.rbm-close-btn {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    font-size: 20px;
    line-height: 1;
}

.rbm-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.rbm-btn-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* بدنه */
.rbm-body {
    padding: 15px;
    overflow-y: auto;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
}

.rbm-close {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-block;
    border-radius: 50%;
    background-color: #ff4d4d; 
    border: 1px solid #e5e5e5;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.rbm-close:before, .rbm-close:after {
    content: "";
    position: absolute;
    width: 18px;
    height: 2px;
    background-color: #ffffff; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.rbm-close:after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.rbm-close:hover {
    background-color: #e74c3c;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.rbm-close:active {
    background-color: #c0392b;
    transform: scale(0.9);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* --- حالت تاریک (وقتی بادی کلاس dark دارد) --- */
.dark .rbm-container {
    background: #1e293b;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.dark .rbm-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

.dark .rbm-title {
    color: #f8fafc;
}

.dark .rbm-body {
    color: #cbd5e1;
}

.dark .rbm-close-btn {
    background: #334155;
    color: #94a3b8;
}

.dark .rbm-close-btn:hover {
    background: #475569;
    color: #fff;
}

/* --- واکنش‌گرا (موبایل) --- */
@media (max-width: 768px) {
    .rbm-overlay {
        align-items: flex-end;
        justify-content: center;
    }

    .rbm-container {
        width: 100%;
        max-width: 100%;
        border-radius: 10px 10px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .rbm-overlay.active .rbm-container {
        transform: translateY(0);
    }
}