/* تحسين القائمة الجانبية - بسيط وأنيق */

.t4s-drawer {
    position: fixed;
    top: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    width: calc(100vw - 65px);
    height: 100%;
    max-height: 100vh;
    z-index: 469;
    transition: all 0.3s ease;
    background: #ffffff;
    border-right: 2px solid #fbbf24;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
}

.rtl_true .t4s-drawer,
.t4s-drawer__right {
    right: 0;
    left: auto;
    border-right: none;
    border-left: 2px solid #fbbf24;
    transform: translateX(100%);
}

.t4s-drawer__bottom-to-top,
.t4s-drawer__top-to-bottom {
    visibility: hidden;
    transform: translateY(100%);
    transition: all 0.3s ease;
    background: #ffffff;
    border-top: 2px solid #fbbf24;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.t4s-drawer__top-to-bottom {
    transform: translateY(-100%);
    border-top: none;
    border-bottom: 2px solid #fbbf24;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rtl_true .t4s-drawer__right {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

.t4s-drawer[aria-hidden=false] {
    pointer-events: auto;
    visibility: visible;
    transform: translateX(0);
    opacity: 1;
}

.t4s-drawer__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: space-between;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* تحسين الهيدر */
.t4s-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    padding: 0 15px 0 20px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    position: relative;
}

.t4s-drawer__header span {
    flex: 1 1 auto;
    font-size: 18px;
    color: #1f2937;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0.5px;
}

button.t4s-drawer__close {
    padding: 0;
    background: #fbbf24;
    border: none;
    border-radius: 8px;
    color: #1f2937;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

button.t4s-drawer__close:hover {
    background: #f59e0b;
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.t4s-drawer__wrap {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.t4s-drawer__main {
    position: relative;
    flex: 1 1 auto;
    background: #ffffff;
}

.t4s-drawer__main .t4s-drawer__scroll {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 100%;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* تحسين القسم السفلي */
.t4s-drawer__bottom {
    flex: 0 0 auto;
    padding: 16px 20px 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.1s;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.t4s-drawer[aria-hidden=false] .t4s-drawer__bottom {
    opacity: 1;
    transform: translateY(0);
}

.t4s-drawer {
    opacity: 1;
}

.t4s-drawer__bottom-to-top,
.t4s-drawer__top-to-bottom {
    opacity: 0;
}

.t4s-drawer__bottom-to-top-lg[aria-hidden=false],
.t4s-drawer__bottom-to-top[aria-hidden=false],
.t4s-drawer__top-to-bottom-lg[aria-hidden=false],
.t4s-drawer__top-to-bottom[aria-hidden=false] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* تحسين المحتوى الداخلي */
.t4s-drawer__main::-webkit-scrollbar {
    width: 6px;
}

.t4s-drawer__main::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.t4s-drawer__main::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.t4s-drawer__main::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* تحسين العناصر الداخلية */
.t4s-drawer .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.t4s-drawer .empty-state h3 {
    font-size: 18px;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 600;
}

.t4s-drawer .empty-state p {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.t4s-drawer .empty-state .btn {
    background: #fbbf24;
    color: #1f2937;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.t4s-drawer .empty-state .btn:hover {
    background: #f59e0b;
    color: #ffffff;
    transform: translateY(-1px);
}

/* تحسينات متجاوبة */
@media screen and (min-width: 641px) {
    .t4s-drawer {
        width: 380px;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    }
    
    .t4s-drawer__header {
        padding: 0 20px 0 25px;
    }
    
    button.t4s-drawer__close {
        width: 44px;
        height: 44px;
    }
}

@media screen and (min-width: 1025px) {
    .t4s-drawer__bottom-to-top-lg,
    .t4s-drawer__top-to-bottom-lg {
        opacity: 0;
        visibility: hidden;
        transform: translateY(100%);
        transition: all 0.3s ease;
        background: #ffffff;
        border-top: 2px solid #fbbf24;
        box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.1);
    }
    
    .t4s-drawer__top-to-bottom-lg {
        transform: translateY(-100%);
        border-top: none;
        border-bottom: 2px solid #fbbf24;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }
}

/* تحسين الشاشات الصغيرة */
@media (max-width: 480px) {
    .t4s-drawer {
        width: calc(100vw - 40px);
    }
    
    .t4s-drawer__header {
        min-height: 55px;
        padding: 0 15px 0 20px;
    }
    
    .t4s-drawer__header span {
        font-size: 16px;
    }
    
    button.t4s-drawer__close {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
    
    .t4s-drawer__main .t4s-drawer__scroll {
        padding: 15px;
    }
    
    .t4s-drawer__bottom {
        padding: 12px 15px 16px;
    }
}

@media (max-width: 360px) {
    .t4s-drawer {
        width: calc(100vw - 20px);
    }
    
    .t4s-drawer__header {
        padding: 0 10px 0 15px;
    }
    
    button.t4s-drawer__close {
        width: 32px;
        height: 32px;
    }
}

/* تحسين الأداء */
.t4s-drawer,
.t4s-drawer__content,
.t4s-drawer__bottom {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* إضافة تأثيرات لطيفة */
.t4s-drawer__header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, #fbbf24, transparent);
    opacity: 0.3;
}

.t4s-drawer__bottom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    opacity: 0.3;
}