/* ملف styles.css */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --sidebar-width: 280px;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
  }
  
  /* التنسيقات العامة */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  body {
    background-color: #f5f7fa;
    color: var(--dark-color);
    line-height: 1.6;
    direction: rtl;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
  
  button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
  }
  
  /* تنسيقات تسجيل الدخول */
  .login-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px;
  }
  
  .login-container {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 450px;
    padding: 30px;
  }
  
  .login-header {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .login-header h2 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 24px;
  }
  
  .login-header p {
    color: #777;
  }
  
  .login-form .form-group {
    margin-bottom: 20px;
  }
  
  .login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
  }
  
  .login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
  }
  
  .login-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  }
  
  .form-actions {
    margin-top: 25px;
  }
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
  }
  
  .btn i {
    margin-left: 8px;
  }
  
  .btn-primary {
    background-color: var(--primary-color);
    color: white;
  }
  
  .btn-primary:hover {
    background-color: var(--secondary-color);
  }
  
  .message {
    padding: 12px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    display: flex;
    align-items: center;
  }
  
  .message.error {
    background-color: #fdecea;
    color: var(--danger-color);
  }
  
  .message.success {
    background-color: #e8f5e9;
    color: var(--success-color);
  }
  
  /* تنسيقات لوحة التحكم */
  .dashboard-section {
    display: none;
  }
  
  .dashboard-container {
    display: flex;
    min-height: 100vh;
  }
  
  /* الشريط الجانبي */
  .dashboard-sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: white;
    padding: 20px 0;
    transition: var(--transition);
    position: fixed;
    height: 100vh;
    z-index: 100;
  }
  
  .user-profile {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
  }
  
  .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 36px;
    color: white;
  }
  
  .user-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
  }
  
  .user-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
  }
  
  .dashboard-nav {
    padding: 20px 0;
  }
  
  .dashboard-nav ul {
    list-style: none;
  }
  
  .dashboard-nav li {
    margin-bottom: 5px;
  }
  
  .dashboard-nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
  }
  
  .dashboard-nav a:hover, .dashboard-nav a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
  }
  
  .dashboard-nav a i {
    margin-left: 10px;
    font-size: 18px;
  }
  
  .logout-section {
    padding: 20px;
    position: absolute;
    bottom: 0;
    width: 100%;
  }
  
  .btn-logout {
    width: 100%;
    padding: 12px;
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    border-radius: var(--border-radius);
  }
  
  .btn-logout:hover {
    background-color: rgba(231, 76, 60, 0.2);
  }
  
  /* المحتوى الرئيسي */
  .dashboard-content {
    flex: 1;
    padding: 20px;
    margin-right: var(--sidebar-width);
    background-color: #f5f7fa;
  }
  
  .section-title {
    color: var(--dark-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
  }
  
  .section-title i {
    margin-left: 10px;
  }
  
  /* الصفحة الرئيسية للوحة التحكم */
  .dashboard-home {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .welcome-message {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
  }
  
  .welcome-text h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
  }
  
  .welcome-text p {
    color: #777;
  }
  
  .welcome-stats {
    display: flex;
    gap: 15px;
    margin-top: 20px;
  }
  
  .stat-card {
    flex: 1;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 15px;
    text-align: center;
    border-top: 3px solid var(--primary-color);
  }
  
  .stat-card i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
  }
  
  .stat-card span {
    display: block;
    color: #777;
    font-size: 14px;
  }
  
  .stat-card strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
    color: var(--dark-color);
  }
  
  .dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
  }
  
  .dashboard-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    transition: var(--transition);
    border-top: 3px solid var(--primary-color);
  }
  
  .dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  }
  
  .dashboard-card i {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 15px;
  }
  
  .dashboard-card h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
  }
  
  .dashboard-card p {
    color: #777;
    font-size: 14px;
  }
  
  .quick-actions {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
  }
  
  .quick-actions h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
  }
  
  .quick-actions h3 i {
    margin-left: 10px;
    color: var(--warning-color);
  }
  
  .actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .action-btn {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
  }
  
  .action-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
  }
  
  .action-btn i {
    margin-left: 8px;
  }
  
  /* إدارة الامتحانات */
  .manage-exams {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .section-header {
    margin-bottom: 25px;
  }
  
  .section-header h2 {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .section-header h2 i {
    margin-left: 10px;
  }
  
  .section-header p {
    color: #777;
  }
  
  .add-exam-form {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
    margin-bottom: 25px;
  }
  
  .add-exam-form h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
  }
  
  .add-exam-form h3 i {
    margin-left: 10px;
    color: var(--success-color);
  }
  
  .form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
  }
  
  .form-group {
    flex: 1;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
  }
  
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
  }
  
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
  }
  
  .exams-list {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 25px;
  }
  
  .exams-list h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
  }
  
  .exams-list h3 i {
    margin-left: 10px;
    color: var(--primary-color);
  }
  
  .exam-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
  }
  
  .exam-item:last-child {
    border-bottom: none;
  }
  
  .exam-info h3 {
    margin-bottom: 5px;
    color: var(--dark-color);
  }
  
  .exam-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #777;
  }
  
  .exam-meta span {
    display: flex;
    align-items: center;
  }
  
  .exam-meta i {
    margin-left: 5px;
  }
  
  .exam-actions {
    display: flex;
    gap: 10px;
  }
  
  .btn-edit {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
  }
  
  .btn-edit:hover {
    background-color: rgba(52, 152, 219, 0.2);
  }
  
  .btn-delete {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
    padding: 8px 15px;
    border-radius: var(--border-radius);
  }
  
  .btn-delete:hover {
    background-color: rgba(231, 76, 60, 0.2);
  }
  
  .no-items {
    text-align: center;
    padding: 30px;
    color: #777;
  }
  
  /* إدارة الشعب */
  .branch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
  }
  
  .branch-info h3 {
    margin-bottom: 5px;
    color: var(--dark-color);
  }
  
  .branch-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #777;
  }
  
  .branch-meta span {
    display: flex;
    align-items: center;
  }
  
  .branch-meta i {
    margin-left: 5px;
  }
  
  /* إدارة الطلاب */
  .students-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
  }
  
  .students-table th,
  .students-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
  }
  
  .students-table th {
    background-color: #f8f9fa;
    color: var(--dark-color);
    font-weight: 500;
  }
  
  .students-table tr:hover {
    background-color: #f8f9fa;
  }
  
  .student-info {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .student-info .avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
    background-color: #f0f0f0;
    color: #777;
  }
  
  .student-info img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }
  
  /* إدارة الأساتذة */
  .teacher-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: var(--border-radius);
    background-color: white;
    box-shadow: var(--box-shadow);
    margin-bottom: 15px;
  }
  
  .teacher-info {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  
  .teacher-info .avatar {
    width: 60px;
    height: 60px;
    font-size: 24px;
    background-color: #f0f0f0;
    color: #777;
  }
  
  .teacher-info img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
  }
  
  .teacher-info .details h3 {
    margin-bottom: 5px;
    color: var(--dark-color);
  }
  
  .teacher-info .details p {
    font-size: 14px;
    color: #777;
    display: flex;
    align-items: center;
  }
  
  .teacher-info .details i {
    margin-left: 5px;
  }
  
  /* إدارة المستخدمين */
  .users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
  }
  
  .users-table th,
  .users-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
  }
  
  .users-table th {
    background-color: #f8f9fa;
    color: var(--dark-color);
    font-weight: 500;
  }
  
  .users-table tr:hover {
    background-color: #f8f9fa;
  }
  
  /* رسائل الخطأ والتحميل */
  .error-message, .unauthorized-message {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin: 20px 0;
  }
  
  .error-message i, .unauthorized-message i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--danger-color);
  }
  
  .unauthorized-message i {
    color: var(--warning-color);
  }
  
  .loading-content {
    text-align: center;
    padding: 40px 20px;
  }
  
  .loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* التجاوب مع الهاتف */
  @media (max-width: 992px) {
    .dashboard-sidebar {
      transform: translateX(100%);
      position: fixed;
      top: 0;
      right: 0;
      height: 100vh;
      z-index: 1000;
      box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
  
    .dashboard-sidebar.active {
      transform: translateX(0);
    }
  
    .dashboard-content {
      margin-right: 0;
    }
  
    .menu-toggle {
      display: block;
      position: fixed;
      top: 15px;
      right: 15px;
      z-index: 100;
      background-color: var(--primary-color);
      color: white;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }
  
    .form-row {
      flex-direction: column;
      gap: 15px;
    }
  
    .welcome-stats {
      flex-direction: column;
    }
  
    .exam-item, .branch-item, .teacher-item {
      flex-direction: column;
      align-items: flex-start;
      gap: 15px;
    }
  
    .exam-actions, .branch-actions, .teacher-actions {
      width: 100%;
      justify-content: flex-end;
    }
  }
  
  @media (max-width: 768px) {
    .dashboard-cards {
      grid-template-columns: 1fr;
    }
  
    .actions-grid {
      grid-template-columns: 1fr;
    }
  
    .students-table, .users-table {
      display: block;
      overflow-x: auto;
    }
  }
  
  /* رأس لوحة التحكم */
  .dashboard-header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: fixed;
    top: 0;
    right: var(--sidebar-width);
    left: 0;
    z-index: 90;
  }
  
  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .top-nav ul {
    display: flex;
    list-style: none;
    gap: 15px;
  }
  
  .top-nav a {
    color: var(--dark-color);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
  }
  
  .top-nav a:hover, .top-nav a.active {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
  }
  
  .user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  
  #mobileUsername {
    font-weight: 500;
    color: var(--dark-color);
  }
  
  /* تعديلات للهاتف على رأس اللوحة */
  @media (max-width: 992px) {
    .dashboard-header {
      right: 0;
    }
  
    .top-nav {
      display: none;
    }
  }
  
  /* تعديلات عامة للهاتف */
  @media (max-width: 576px) {
    .login-container {
      padding: 20px 15px;
    }
  
    .btn {
      padding: 10px 15px;
      font-size: 14px;
    }
  
    .section-header h2 {
      font-size: 20px;
    }
  
    .exam-meta, .branch-meta {
      flex-wrap: wrap;
      gap: 8px;
    }
  
    .teacher-info {
      flex-direction: column;
      align-items: flex-start;
    }
  }





/* تنسيقات أزرار الرجوع */
.back-btn {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: #f5f7fa;
    border: none;
    border-radius: 6px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    margin-left: 10px;
    text-decoration: none;
}

.back-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.back-btn i {
    margin-left: 8px;
    font-size: 0.9rem;
}

.dashboard-back {
    background: rgba(67, 97, 238, 0.1);
}

.home-back {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.home-back:hover {
    background: #28a745;
    color: white;
}

.content-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 768px) {
    .back-btn span {
        display: none;
    }
    
    .back-btn i {
        margin-left: 0;
    }
}


/* أنماط جديدة للشريط الجانبي */
.sidebar-footer {
    margin-top: auto;
    padding: 15px;
    border-top: 1px solid #e1e1e1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 14px;
}

#homeBtn {
    background-color: #f0f0f0;
    color: #333;
}

#homeBtn:hover {
    background-color: #e0e0e0;
    transform: translateX(5px);
}

#logoutBtn {
    background-color: #ff4444;
    color: white;
    border: none;
    cursor: pointer;
}

#logoutBtn:hover {
    background-color: #cc0000;
    transform: translateX(5px);
}

.sidebar-btn i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}


.alert {
    padding: 12px;
    margin: 10px 0;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

.close-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* أنماط نظام التحميل */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-details {
    background-color: #ffebee;
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
    border-left: 4px solid #f44336;
    font-family: monospace;
    font-size: 13px;
    overflow-x: auto;
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.file-upload-wrapper input[type="file"] {
    flex: 1;
}

.btn-upload {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-upload:hover {
    background-color: #5a6268;
}

#fileUploadStatus {
    margin-top: 5px;
    font-size: 0.9em;
    color: #666;
}

.loading-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* تنسيقات متجاوبة للهاتف للوحة التحكم */
.dashboard-section {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
}

/* تسجيل الدخول للهاتف */
.login-container {
    width: 90%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #34495e;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}

.form-check-input {
    margin-left: 8px;
}

.form-actions {
    text-align: center;
    margin-top: 1.5rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-logout {
    background-color: #e74c3c;
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.btn-logout:hover {
    background-color: #c0392b;
}

/* لوحة التحكم للهاتف */
.dashboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.dashboard-sidebar {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    width: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #34495e;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    font-size: 1.8rem;
}

.user-info h3 {
    margin: 0;
    font-size: 1.1rem;
}

.user-info p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: #bdc3c7;
}

.dashboard-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-nav li {
    margin-bottom: 0.5rem;
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #ecf0f1;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    gap: 10px;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    background-color: #34495e;
    color: #3498db;
}

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8f9fa;
}

/* المحتوى للهاتف */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 10px;
}

.content-title {
    color: #2c3e50;
    margin: 0;
}

.back-buttons {
    display: flex;
    gap: 10px;
}

.btn-back {
    background-color: #95a5a6;
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.welcome-message {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.welcome-text h3 {
    margin-top: 0;
    color: #2c3e50;
}

.welcome-stats {
    display: flex;
    gap: 15px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.stat-card i {
    font-size: 1.5rem;
    color: #3498db;
    margin-bottom: 8px;
}

.stat-card span {
    display: block;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.stat-card strong {
    display: block;
    margin-top: 4px;
    color: #2c3e50;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-card i {
    font-size: 2rem;
    color: #3498db;
    margin-bottom: 1rem;
}

.dashboard-card h3 {
    margin: 0 0 0.5rem;
    color: #2c3e50;
}

.dashboard-card p {
    margin: 0;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.quick-actions {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.quick-actions h3 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

/* إدارة الامتحانات للهاتف */
.manage-exams,
.manage-quizzes,
.manage-branches,
.manage-students,
.manage-teachers,
.manage-users,
.manage-schedules {
    padding: 1rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header p {
    color: #7f8c8d;
    margin: 0;
}

.exam-form,
.quiz-form,
.branch-form,
.teacher-form,
.user-form,
.schedule-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.exam-form h3,
.quiz-form h3,
.branch-form h3,
.teacher-form h3,
.user-form h3,
.schedule-form h3 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 250px;
    margin-bottom: 0;
}

.exams-list,
.quizzes-list,
.branches-list,
.teachers-list,
.users-list,
.schedules-list {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.exams-list h3,
.quizzes-list h3,
.branches-list h3,
.teachers-list h3,
.users-list h3,
.schedules-list h3 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.exam-item,
.quiz-item,
.branch-item,
.teacher-item,
.schedule-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.exam-item:last-child,
.quiz-item:last-child,
.branch-item:last-child,
.teacher-item:last-child,
.schedule-item:last-child {
    border-bottom: none;
}

.exam-info h3,
.quiz-info h3,
.branch-info h3,
.teacher-info h3,
.schedule-info h3 {
    margin: 0 0 0.5rem;
    color: #2c3e50;
}

.exam-meta,
.quiz-meta,
.branch-meta,
.schedule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.exam-meta span,
.quiz-meta span,
.branch-meta span,
.schedule-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.exam-actions,
.quiz-actions,
.branch-actions,
.teacher-actions,
.schedule-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    background-color: #3498db;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-distinguished {
    background-color: #f39c12;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-preview {
    background-color: #9b59b6;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.btn-cancel {
    background-color: #95a5a6;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* إدارة الطلاب للهاتف */
.students-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.search-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1;
}

.search-filter input,
.search-filter select {
    flex: 1;
    min-width: 150px;
}

.btn-filter {
    background-color: #2ecc71;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.students-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.students-table th,
.students-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.students-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-form {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* إدارة الطلاب المتميزين للهاتف */
.manage-distinguished {
    padding: 1rem;
}

.distinguished-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.distinguished-students,
.regular-students {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.distinguished-students h3,
.regular-students h3 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.student-card.distinguished {
    border-left: 4px solid #f1c40f;
    background-color: #fffdf6;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #7f8c8d;
}

.student-info .avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.student-info .details h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
}

.student-info .details p {
    margin: 3px 0 0;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.distinguished-rules {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.distinguished-rules h3 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.distinguished-rules ul {
    padding-right: 1.5rem;
    margin-bottom: 0;
}

.distinguished-rules li {
    margin-bottom: 0.5rem;
    color: #7f8c8d;
}

/* إدارة الجداول الدراسية للهاتف */
.days-container {
    margin: 1.5rem 0;
}

.day-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #eee;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 10px;
}

.day-header .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.periods-container {
    margin: 1rem 0;
}

.period-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.period-item .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* تنسيقات عامة للهاتف */
.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-items {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.unauthorized-message {
    text-align: center;
    padding: 2rem;
}

.unauthorized-message i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
    display: block;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sidebar-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar-btn:hover {
    background: #e9ecef;
}

.file-upload-wrapper {
    position: relative;
}

.file-upload-status {
    margin-top: 8px;
    font-size: 0.9rem;
}

/* استعلامات الوسائط للهواتف */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .dashboard-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        z-index: 1000;
        padding: 0.5rem;
        height: auto;
    }
    
    .user-profile {
        display: none;
    }
    
    .dashboard-nav ul {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
    }
    
    .dashboard-nav li {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .dashboard-nav a {
        flex-direction: column;
        padding: 8px;
        font-size: 0.8rem;
        text-align: center;
        min-width: 70px;
    }
    
    .dashboard-nav a i {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .dashboard-nav a span {
        display: none;
    }
    
    .logout-section {
        display: none;
    }
    
    .dashboard-content {
        padding-bottom: 70px; /* مساحة للقائمة السفلية */
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .welcome-stats {
        flex-direction: column;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .exam-item,
    .quiz-item,
    .branch-item,
    .teacher-item,
    .schedule-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .exam-actions,
    .quiz-actions,
    .branch-actions,
    .teacher-actions,
    .schedule-actions {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    
    .students-table {
        display: block;
        overflow-x: auto;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .distinguished-container {
        flex-direction: column;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .back-buttons {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        width: 95%;
        padding: 1rem;
        margin: 1rem auto;
    }
    
    .dashboard-card {
        padding: 1rem;
    }
    
    .exam-form,
    .quiz-form,
    .branch-form,
    .teacher-form,
    .user-form,
    .schedule-form,
    .exams-list,
    .quizzes-list,
    .branches-list,
    .teachers-list,
    .users-list,
    .schedules-list {
        padding: 1rem;
    }
    
    .exam-meta,
    .quiz-meta,
    .branch-meta,
    .schedule-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .student-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .student-card .btn {
        align-self: stretch;
        text-align: center;
    }
}

/* تنسيقات قسم إدارة المستخدمين */
.manage-users {
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.users-table th {
    background: #2c3e50;
    color: white;
    padding: 12px 8px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

.users-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    text-align: right;
    font-size: 14px;
}

.users-table tr:last-child td {
    border-bottom: none;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.user-form {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* تنسيقات للهواتف */
@media (max-width: 768px) {
    .manage-users {
        padding: 10px;
    }
    
    .users-table {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .users-table th:nth-child(2),
    .users-table td:nth-child(2),
    .users-table th:nth-child(4),
    .users-table td:nth-child(4) {
        display: none;
    }
    
    .user-form {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .users-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .users-table th,
    .users-table td {
        min-width: 100px;
        padding: 6px 4px;
        font-size: 11px;
    }
    
    .users-table th:first-child,
    .users-table td:first-child {
        min-width: 120px;
    }
    
    .users-table th:last-child,
    .users-table td:last-child {
        min-width: 80px;
    }
    
    .btn-edit,
    .btn-delete {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .user-form h3 {
        font-size: 16px;
    }
}

/* تنسيقات الأزرار في الجدول */
.users-table .btn {
    padding: 6px 12px;
    margin: 2px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.users-table .btn-edit {
    background: #3498db;
    color: white;
}

.users-table .btn-edit:hover {
    background: #2980b9;
}

.users-table .btn-delete {
    background: #e74c3c;
    color: white;
}

.users-table .btn-delete:hover {
    background: #c0392b;
}

.users-table .btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* تنسيقات النموذج */
.user-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.user-form .form-group {
    flex: 1;
    min-width: 200px;
}

.user-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
}

.user-form input,
.user-form select,
.user-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.user-form input:focus,
.user-form select:focus,
.user-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.user-form small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

/* تنسيقات للأجهزة الصغيرة جداً */
@media (max-width: 320px) {
    .users-table th,
    .users-table td {
        padding: 4px 2px;
        font-size: 10px;
    }
    
    .users-table .btn {
        padding: 3px 6px;
        font-size: 10px;
    }
    
    .user-form {
        padding: 10px;
    }
    
    .user-form input,
    .user-form select,
    .user-form textarea {
        padding: 8px;
        font-size: 12px;
    }
}


