/* أنماط عامة لوحة التحكم */
.admin-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    color: #e83e8c;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title i {
    font-size: 1.2em;
}

.admin-actions {
    margin-bottom: 20px;
}

/* الجداول */
.responsive-table {
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.products-table th,
.products-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
}

.products-table th {
    background-color: #f9f9f9;
    color: #e83e8c;
    font-weight: 600;
}

.products-table tr:hover {
    background-color: #fff5f7;
}

/* خلايا الجدول */
.product-image-cell {
    width: 80px;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.no-image {
    width: 60px;
    height: 60px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    border-radius: 4px;
}

.product-name {
    font-weight: 500;
}

.product-category {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.product-price {
    font-weight: 600;
    color: #e83e8c;
}

.product-stock {
    font-weight: 500;
}

.product-stock span {
    display: block;
    font-size: 12px;
}

.in-stock {
    color: #28a745;
}

.out-of-stock {
    color: #dc3545;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background-color: #d4edda;
    color: #28a745;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #dc3545;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-edit {
    background-color: #17a2b8;
}

.btn-delete {
    background-color: #dc3545;
}

.btn-view {
    background-color: #6c757d;
}

.btn-action:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* النماذج */
.product-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group .required {
    color: #dc3545;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #e83e8c;
    outline: none;
    box-shadow: 0 0 0 2px rgba(232, 62, 140, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
}

/* تحميل الملفات */
.file-upload {
    margin-top: 5px;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: inline-block;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-align: center;
}

.file-upload-label:hover {
    background-color: #fff5f7;
    border-color: #e83e8c;
}

.file-upload-label i {
    margin-left: 8px;
    color: #e83e8c;
}

.file-upload-info {
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

.image-preview {
    margin-top: 15px;
    width: 200px;
    height: 200px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.preview-image {
    display: none;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.default-text {
    color: #6c757d;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* الأزرار */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    gap: 8px;
    border: none;
    cursor: pointer;
}

.btn i {
    font-size: 14px;
}

.btn-pink {
    background-color: #e83e8c;
    color: white;
}

.btn-pink:hover {
    background-color: #d4357d;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #e83e8c;
    color: #e83e8c;
}

.btn-outline:hover {
    background-color: #fff5f7;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* التنبيهات */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.alert-success {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.alert i {
    margin-left: 8px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* الحالة الفارغة */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    margin-bottom: 15px;
    color: #e83e8c;
}

.empty-state p {
    font-size: 18px;
}

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .products-table {
        font-size: 14px;
    }

    .products-table th,
    .products-table td {
        padding: 8px 10px;
    }

    .product-actions {
        flex-direction: column;
        gap: 5px;
    }

    .btn-action {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
}

/* new */
/* أساسيات التصميم */
:root {
    --primary-color: #ff6b81;
    --secondary-color: #57606f;
    --dark-color: #2f3542;
    --light-color: #f1f2f6;
    --success-color: #2ed573;
    --danger-color: #ff4757;
    --warning-color: #ffa502;
    --info-color: #1e90ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: #f5f6fa;
    color: #333;
    direction: rtl;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* القائمة الجانبية */
.admin-sidebar {
    width: 250px;
    background-color: var(--dark-color);
    color: white;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-right: 25px;
}

.sidebar-nav .active a {
    background-color: var(--primary-color);
    border-right: 4px solid white;
}

.sidebar-nav .divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

.sidebar-nav i {
    width: 25px;
    text-align: center;
    margin-left: 10px;
}

/* تثبيت شريط الأدمن العلوي عند التمرير */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* إذا كنت تريد تثبيت القائمة الجانبية أيضًا */
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh; /* لجعلها تمتد على طول الصفحة */
    overflow-y: auto; /* لإمكانية التمرير إذا كانت المحتويات طويلة */
}

/* تعديلات للهيدر عند التمرير */
.admin-topbar.sticky {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
}

/* شريط التنقل العلوي */
.admin-topbar {
    background-color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    color: var(--secondary-color);
}

.admin-user {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 10px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px 0;
    width: 200px;
    display: none;
    z-index: 101;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 8px 15px;
    color: var(--secondary-color);
    text-decoration: none;
}

.user-dropdown a:hover {
    background-color: var(--light-color);
}

/* المحتوى الرئيسي */
.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    padding: 20px;
    background-color: #f5f6fa;
}

/* تذييل الصفحة */
.admin-footer {
    padding: 15px 20px;
    background-color: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* تصميم متجاوب */
/* إزالة أو تعديل القاعدة التي تجعل القائمة أفقية */
@media (max-width: 768px) {
    .admin-wrapper {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 280px; /* عرض ثابت للقائمة */
        right: -280px; /* إخفاء القائمة خارج الشاشة */
        height: 100vh;
        position: fixed;
        top: 0;
        z-index: 1000;
        transition: all 0.3s ease;
    }

    .admin-sidebar.active {
        right: 0; /* إظهار القائمة عند النقر على الزر */
    }

    .sidebar-header {
        display: flex; /* إظهار رأس القائمة */
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }

    .sidebar-nav ul {
        display: block; /* عرض العناصر بشكل عمودي */
    }

    .sidebar-nav li:not(.divider) {
        flex: none; /* إزالة الخاصية التي تجعل العناصر تأخذ مساحة متساوية */
        text-align: right; /* محاذاة النص لليمين */
    }

    .sidebar-nav a {
        padding: 15px 20px; /* تعديل المسافات الداخلية */
        font-size: 1rem; /* حجم خط مناسب */
    }

    .sidebar-nav i {
        display: inline-block; /* عرض الأيقونات بشكل عادي */
        margin: 0 10px 0 0; /* تعديل المسافات حول الأيقونات */
    }

    .sidebar-nav .divider {
        display: block; /* إظهار الفواصل بين العناصر */
    }

    .admin-content {
        margin-bottom: 0; /* إزالة الهامش السفلي */
    }
}

/* تحسينات للهواتف الصغيرة جدًا */
@media (max-width: 480px) {
    .admin-sidebar {
        width: 100%; /* استخدام العرض الكامل للشاشة */
        right: -100%; /* إخفاء القائمة خارج الشاشة */
    }

    .admin-sidebar.active {
        right: 0; /* إظهار القائمة عند النقر على الزر */
    }
}

/* تنسيقات المقاسات */
.size-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    background-color: #f9f9f9;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.size-checkbox input[type="checkbox"] {
    transform: scale(1.2);
    accent-color: #e91e63;
}

.size-checkbox:hover {
    background-color: #ffeaf1;
}
.form-group input[type="checkbox"] {
    transform: scale(1.2);
    margin-left: 6px;
}

/* تنسيقات التركيبه */
#new-variants .variant-block {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
}
.variant-block {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
}

.btn-delete-variant {
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s ease;
}

.btn-delete-variant:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}


/* ---------------------------- */
/* body {
            font-family: 'Tajawal', sans-serif;
            background: #f7f7f7;
            padding: 20px;
        } */

        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
        }

        th,
        td {
            padding: 10px;
            border: 1px solid #ddd;
            text-align: right;
        }

        th {
            background-color: #ff6b8b;
            color: white;
        }

        .container {
            max-width: 1000px;
            margin: auto;
        }


/* ============================================= */
/* تحسينات للهواتف المحمولة */
/* ============================================= */

@media (max-width: 992px) {
    /* القائمة الجانبية على الهاتف */
    .admin-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: all 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .admin-sidebar.active {
        right: 0;
    }
    
    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }
    
    .sidebar-close {
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 5px;
    }
    
    /* طبقة التعتيم */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* تعديلات الشريط العلوي */
    .admin-topbar {
        padding: 10px 15px;
    }
    
    .admin-topbar h3 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    
    .user-name {
        display: none;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
    }
    
    /* تعديلات المحتوى الرئيسي */
    .content-wrapper {
        padding: 15px;
    }
    
    /* تحسينات للأزرار */
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    /* تحسينات للجداول */
    .responsive-table {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .products-table {
        min-width: 600px;
    }
    
    .products-table th,
    .products-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .product-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    /* تحسينات للنماذج */
    .form-group input[type="text"],
    .form-group input[type="number"],
    .form-group select,
    .form-group textarea {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* تعديلات إضافية للشاشات الصغيرة جدًا */
    .content-wrapper {
        padding: 10px;
    }
    
    .admin-topbar {
        padding: 8px 10px;
    }
    
    .sidebar-nav a {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .sidebar-nav i {
        margin-left: 8px;
        font-size: 0.9rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .alert {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .empty-state i {
        font-size: 2rem;
    }
    
    .empty-state p {
        font-size: 1rem;
    }
}

/* تحسينات للقائمة المنسدلة للمستخدم */
.user-dropdown {
    right: 0;
    left: auto;
}

/* تحسينات عامة للهاتف */
body {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* تحسينات لزر القائمة الجانبية */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    transition: all 0.3s;
    margin-left: 0;
    margin-right: 10px;
}

.sidebar-toggle:hover {
    background: #eee;
}


/* --------------------------------------------------------------------------- */

/* تنسيقات الملف الشخصي */
.avatar-upload {
    margin-bottom: 20px;
}

.avatar-preview {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ddd;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.card-header {
    border-bottom: none;
}

.alert {
    margin-top: 20px;
}