/* تنسيق عام */
:root {
    --primary-color: #28a745;
    --secondary-color: #333;
    --background-color: #f4f4f4;
    --text-color: #333;
    --white: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
}

/* تنسيق الـ Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 20px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0; /* تغيير من -250px إلى 0 لجعله مرئيًا دائمًا */
    transition: left 0.3s ease;
    z-index: 1000;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: var(--white);
    display: block;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar ul li a:hover {
    background-color: var(--primary-color);
}

/* زر فتح/إغلاق الـ Sidebar */
.sidebar-toggle {
    display: none; /* إخفاء زر التبديل على الحاسوب */
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px;
    font-size: 1.2rem;
    z-index: 1001;
    cursor: pointer;
}

/* تنسيق الـ Main Content */
.main-content {
    margin-left: 250px; /* إضافة هامش لليسار لتعويض عرض الـ Sidebar */
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* تنسيق الجدول */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: center;
}

table th {
    background-color: var(--primary-color);
    color: var(--white);
}

table td a {
    color: var(--primary-color);
    margin: 0 5px;
}

table td a:hover {
    text-decoration: underline;
}

/* تنسيق النموذج */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #218838;
}

/* تنسيق الصفحة الرئيسية */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

nav {
    margin-top: 10px;
}

nav a {
    margin: 0 10px;
    font-size: 1.1rem;
}

/* تنسيق صفحة تسجيل الدخول */
.login-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* تنسيق صفحة لوحة التحكم */
.dashboard-container {
    display: flex;
}

/* تنسيق للهواتف */
@media (max-width: 768px) {
    .sidebar {
        left: -250px; /* إخفاء الـ Sidebar على الأجهزة المحمولة */
    }

    .sidebar.active {
        left: 0; /* إظهار الـ Sidebar عند النقر على زر التبديل */
    }

    .sidebar-toggle {
        display: block; /* إظهار زر التبديل على الأجهزة المحمولة */
    }

    .main-content {
        margin-left: 0; /* إزالة الهامش على الأجهزة المحمولة */
    }

    .sidebar.active + .main-content {
        margin-left: 0; /* إزالة الهامش عند ظهور الـ Sidebar على الأجهزة المحمولة */
    }
}

/* تنسيق تفاصيل الشركة */
.company-details {
    background-color: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.company-details p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.company-details strong {
    color: var(--primary-color);
}

.back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: #218838;
}
/* صفحة اختيار القوالب */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.template-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.template-card.selected {
    border: 2px solid #4CAF50;
    background-color: #f8fff8;
}

.template-card input[type="radio"] {
    display: none;
}

.template-card h3 {
    margin-top: 0;
    color: #333;
}

.template-preview img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
}

.form-actions {
    margin-top: 20px;
    text-align: center;
}

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