/* إعدادات عامة */
:root {
    --primary-color: #a67c52;
    --primary-dark: #8b5e3c;
    --primary-light: #d4b596;
    --secondary-color: #2c1810;
    --accent-color: #e6b87f;
    --light-color: #f8f4f0;
    --dark-color: #1a1a1a;
    --gray-color: #888;
    --light-gray: #f5f5f5;
    --sidebar-width: 250px;
    --header-height: 70px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-color);
    overflow-x: hidden;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* الشريط الجانبي */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    font-family: 'El Messiri', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 5px;
}

.sidebar-header .logo span {
    color: var(--primary-color);
}

.sidebar-header .tagline {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-right: 3px solid transparent;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-right-color: var(--primary-color);
}

.nav-item i {
    margin-left: 10px;
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.user-details h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.user-details p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.logout-btn {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* المحتوى الرئيسي */
.admin-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 20px;
    min-height: 100vh;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.section-header h1 {
    font-family: 'El Messiri', sans-serif;
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header p {
    color: var(--gray-color);
}

/* بطاقات الإحصاءات */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    color: white;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* الإجراءات السريعة */
.quick-actions {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.quick-actions h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    background-color: var(--light-color);
    border: none;
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

.action-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.action-btn i {
    font-size: 1.8rem;
}

/* الأزرار العامة */
.add-btn, .save-btn, .backup-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover, .save-btn:hover, .backup-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* الجداول */
.section-actions {
    margin-bottom: 20px;
}

.products-table-container, .offers-table-container {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--light-color);
}

.data-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    color: var(--secondary-color);
    border-bottom: 1px solid #e0e0e0;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table tbody tr:hover {
    background-color: rgba(166, 124, 82, 0.05);
}

.table-image {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    object-fit: cover;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.edit-btn {
    background-color: #4CAF50;
    color: white;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.edit-btn:hover, .delete-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* النماذج (مودال) */
.form-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.form-modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    background-color: var(--secondary-color);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

#product-form, #offer-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--gray-color);
    font-size: 0.85rem;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: var(--border-radius);
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(166, 124, 82, 0.05);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--gray-color);
    margin-bottom: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cancel-btn, .submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    transition: var(--transition);
}

.cancel-btn {
    background-color: #f5f5f5;
    color: var(--dark-color);
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

.submit-btn:hover {
    background-color: var(--primary-dark);
}

/* قسم الإعدادات */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.settings-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.settings-card h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.backup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.backup-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.backup-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

/* تصميم متجاوب */
@media (max-width: 992px) {
    .admin-sidebar {
        width: 70px;
    }
    
    .admin-content {
        margin-right: 70px;
    }
    
    .sidebar-header .tagline,
    .nav-item span,
    .user-details,
    .logout-btn span {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 15px;
    }
    
    .nav-item i {
        margin-left: 0;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .logout-btn {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .admin-content {
        padding: 15px;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.9rem;
    }
    
    .data-table th, .data-table td {
        padding: 10px 5px;
    }
    
    .modal-content {
        width: 95%;
    }
}