/* ===== إعادة تعيين أساسية ===== */
#rcm-floating-menu {
    position: fixed;
    z-index: 999999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#rcm-floating-menu.rcm-dragging {
    opacity: 0.9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ===== المواقع الثابتة ===== */
.rcm-position-top-left {
    top: 30px;
    left: 30px;
}
.rcm-position-top-right {
    top: 30px;
    right: 30px;
}
.rcm-position-bottom-left {
    bottom: 30px;
    left: 30px;
}
.rcm-position-bottom-right {
    bottom: 30px;
    right: 30px;
}

/* ===== الزر العائم - بدون دوران ===== */
#rcm-toggle-button {
    padding: 6px 6px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 120px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}


@media only screen and (max-width: 800px) {
  
 
#rcm-toggle-button {
   position:relative;
   top:70px;
   display:block;

}
}






#rcm-toggle-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 115, 170, 0.4);
    background: linear-gradient(135deg, #005a87 0%, #003d5c 100%);
}

#rcm-toggle-button.rcm-active {
    background: linear-gradient(135deg, #003d5c 0%, #002a3f 100%);
}

/* السهم فقط بدون دوران */
#rcm-toggle-button:after {
    content: '▼';
    font-size: 14px;
    transition: transform 0.3s ease;
}

#rcm-toggle-button.rcm-active:after {
    content: '▲';
}

/* ===== القائمة الرئيسية ===== */
#rcm-categories-list {
    position: absolute;
    background: white;
    border-radius: 12px;
    width: 350px;
    max-height: 500px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: default;
}

.rcm-position-top-left #rcm-categories-list {
    left: 0;
    top: 100%;
}
.rcm-position-top-right #rcm-categories-list {
    right: 0;
    top: 100%;
}
.rcm-position-bottom-left #rcm-categories-list {
    left: 0;
    bottom: 100%;
}
.rcm-position-bottom-right #rcm-categories-list {
    right: 0;
    bottom: 100%;
}

.rcm-categories-hidden {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
}

.rcm-categories-visible {
    display: block;
    animation: menuFadeIn 0.3s ease forwards;
}

@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== هيدر القائمة - التدرج الأساسي فقط (يتم التعديل من PHP) ===== */
.rcm-categories-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    background: linear-gradient(135deg, #000000 0%, #8B0000 100%); /* القيمة الافتراضية فقط */
    color: #FFFFFF; /* القيمة الافتراضية فقط */
}

.rcm-categories-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    color:#fff !important;
}

#rcm-close-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color:#fff !important;
}

#rcm-close-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== محتوى التصنيفات ===== */
.rcm-categories-content {
    padding: 20px;
    max-height: 350px;
    overflow-y: auto;
}

/* ===== التصنيفات الفردية ===== */
.rcm-term-item {
    margin-bottom: 8px;
}

.rcm-term-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.rcm-term-link:hover {
    background: #e3f2fd;
    color: #0073aa;
    border-left-color: #0073aa;
}

.rcm-term-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.rcm-term-count {
    background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.rcm-term-link:hover .rcm-term-count {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
}

/* زر التوسيع/الطي */
.rcm-toggle-children {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rcm-toggle-children:hover {
    background: linear-gradient(135deg, #005a87 0%, #003d5c 100%);
    transform: scale(1.1);
}

.rcm-toggle-children[data-state="expanded"] {
    background: linear-gradient(135deg, #003d5c 0%, #002a3f 100%);
}

/* التصنيفات الفرعية */
.rcm-child-terms {
    margin-left: 34px;
    padding-left: 15px;
    border-left: 2px dashed #e0e0e0;
    margin-top: 5px;
}

/* ===== تذييل القائمة ===== */
.rcm-categories-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

.rcm-collapse-all {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rcm-collapse-all:hover {
    background: linear-gradient(135deg, #555 0%, #333 100%);
    transform: translateY(-2px);
}

/* ===== نظام السحب ===== */
#rcm-floating-menu.ui-draggable {
    cursor: move;
}

#rcm-floating-menu.ui-draggable-dragging {
    z-index: 1000001;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

/* مؤشر السحب على الزر وهيدر القائمة */
#rcm-toggle-button.ui-draggable-handle,
.rcm-categories-header.ui-draggable-handle {
    cursor: move !important;
}

/* ===== التجاوب ===== */
@media (max-width: 768px) {
    #rcm-floating-menu {
        left: 15px !important;
        right: auto !important;
        top: 15px !important;
        bottom: auto !important;
    }
    
    #rcm-categories-list {
        width: 300px;
        left: 0 !important;
        right: auto !important;
        top: 60px !important;
        bottom: auto !important;
    }
    
    .rcm-position-top-left #rcm-categories-list,
    .rcm-position-top-right #rcm-categories-list,
    .rcm-position-bottom-left #rcm-categories-list,
    .rcm-position-bottom-right #rcm-categories-list {
        left: 0 !important;
        right: auto !important;
        top: 60px !important;
        bottom: auto !important;
    }
    
    #rcm-toggle-button {
        padding: 6px 6px;
        font-size: 16px;
        min-width: 120px;
    }
    
    /* تعطيل السحب على الشاشات الصغيرة */
    #rcm-floating-menu.ui-draggable {
        cursor: default;
    }
    
    #rcm-toggle-button.ui-draggable-handle,
    .rcm-categories-header.ui-draggable-handle {
        cursor: pointer !important;
    }
}

/* ===== شريط التمرير ===== */
.rcm-categories-content::-webkit-scrollbar {
    width: 6px;
}
.rcm-categories-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.rcm-categories-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border-radius: 3px;
}
.rcm-categories-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #005a87 0%, #003d5c 100%);
}