/* main.css - ملف الأنماط الموحد للنظام */

/* الأساسيات العامة */
:root {
  /* الألوان الرئيسية */
  --primary: #0078D4;
  --primary-dark: #106EBE;
  --primary-light: #EFF6FC;
  --secondary: #2B88D8;
  --success: #107C10;
  --success-light: #DFF6DD;
  --info: #038387;
  --info-light: #D7F9F9;
  --warning: #F2C811;
  --warning-light: #FFF4CE;
  --danger: #D83B01;
  --danger-light: #FDE7E9;
  
  /* درجات الرمادي */
  --gray-10: #FAF9F8;
  --gray-20: #F3F2F1;
  --gray-30: #EDEBE9;
  --gray-40: #E1DFDD;
  --gray-50: #D2D0CE;
  --gray-60: #C8C6C4;
  --gray-70: #BEB9B7;
  --gray-80: #B3B0AD;
  --gray-90: #A19F9D;
  --gray-100: #8A8886;
  --gray-110: #605E5C;
  --gray-120: #3B3A39;
  --gray-130: #323130;
  --gray-140: #292827;
  --gray-150: #252423;
  --gray-160: #201F1E;
  
  /* الظلال */
  --shadow-sm: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
  --shadow-md: 0 3.2px 7.2px 0 rgba(0, 0, 0, 0.132), 0 0.6px 1.8px 0 rgba(0, 0, 0, 0.108);
  --shadow-lg: 0 6.4px 14.4px 0 rgba(0, 0, 0, 0.132), 0 1.2px 3.6px 0 rgba(0, 0, 0, 0.108);
  
  /* ألوان إضافية لـ hr-operations */
  --primary-color: #0078D4;
  --secondary-color: #2B88D8;
  --success-color: #107C10;
  --warning-color: #F2C811;
  --danger-color: #D83B01;
}

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

body {
  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  background-color: var(--gray-20);
  color: var(--gray-160);
  line-height: 1.5;
  direction: rtl;
}

/* الهيدر المشترك */
.header {
  background-color: var(--primary);
  color: white;
  padding: 1rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #0e6b0e;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #b83201;
}

.btn-outline {
  background-color: white;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-light);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* الكروت */
.card {
  background: white;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-30);
}

.card-header {
  background-color: var(--primary);
  color: white;
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 1.5rem;
}

/* الجداول */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 0.75rem;
  text-align: right;
  border: 1px solid var(--gray-40);
}

.table thead th {
  background-color: var(--gray-20);
  font-weight: 600;
}

.table-hover tbody tr:hover {
  background-color: var(--gray-10);
}

.table-responsive {
  overflow-x: auto;
}

/* التقسيم الصفحي */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  gap: 0.5rem;
}

.page-item {
  margin: 0 0.25rem;
}

.page-link {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-40);
  border-radius: 4px;
  color: var(--primary);
  text-decoration: none;
}

.page-item.active .page-link {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-item.disabled .page-link {
  color: var(--gray-90);
  pointer-events: none;
}

/* النماذج وعناصر الإدخال */
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-60);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.input-group {
  display: flex;
  margin-bottom: 1rem;
}

.input-group .form-control {
  flex: 1;
}

.input-group button {
  margin-right: 0.5rem;
}

/* الإشعارات والتنبيهات */
.notification {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  display: none;
}

.notification.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.notification.error {
  background-color: var(--danger-light);
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

.notification.success {
  background-color: var(--success-light);
  border-left: 4px solid var(--success);
  color: var(--success);
}

.notification.warning {
  background-color: var(--warning-light);
  border-left: 4px solid var(--warning);
  color: var(--warning);
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  color: var(--gray-160);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1000;
  transform: translateX(150%);
  transition: transform 0.3s ease;
  border-left: 4px solid var(--primary);
  max-width: 350px;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast .close {
  margin-right: 0.5rem;
  cursor: pointer;
  color: var(--gray-100);
}

/* الصفحات الخاصة */

/* صفحة الموظفين */
.employee-card {
  margin-bottom: 1rem;
}

.employee-card .card-header {
  background-color: var(--gray-20);
  color: var(--gray-160);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.bg-success {
  background-color: var(--success);
}

.status-badge.bg-warning {
  background-color: var(--warning);
}

.status-badge.bg-danger {
  background-color: var(--danger);
}

.status-badge.bg-secondary {
  background-color: var(--gray-90);
}

/* صفحة الملف الشخصي */
.profile-container {
  max-width: 800px;
  margin: 1.25rem auto;
  padding: 1.25rem;
  background-color: white;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-30);
}

.profile-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--primary-light);
  margin: 0 auto;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: var(--gray-10);
  border-radius: 4px;
}

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

/* صفحة إعدادات الموارد البشرية */
.settings-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.setting-item {
  display: flex;
  align-items: center;
}

.setting-item input {
  margin-left: 0.5rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  background-color: var(--gray-20);
  border: 1px solid var(--gray-40);
  border-radius: 4px;
  padding: 0.375rem 0.75rem;
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.tag button {
  background: none;
  border: none;
  color: var(--gray-100);
  cursor: pointer;
  font-size: 1rem;
  margin-right: 0.25rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.tag button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: var(--danger);
}

/* صفحة عمليات الموارد البشرية (hr-operations) */
.fluent-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  margin: 1rem;
  overflow: hidden;
}

.fluent-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: var(--gray-10);
  border-bottom: 1px solid var(--gray-30);
}

.fluent-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.fluent-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-30);
}

.fluent-tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.fluent-tab:hover {
  background-color: var(--gray-10);
}

.fluent-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.fluent-tab-content {
  padding: 1.5rem;
}

.request-card {
  background-color: white;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
}

.request-card.approved {
  border-left-color: var(--success);
}

.request-card.rejected {
  border-left-color: var(--danger);
}

.request-card.pending {
  border-left-color: var(--warning);
}

.request-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.request-title {
  font-weight: 600;
  color: var(--primary);
}

.request-status {
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.request-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--gray-100);
}

.detail-value {
  font-weight: 500;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* تأثيرات الحركة */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* التكيف مع الأجهزة المحمولة */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }
  
  .profile-container {
    margin: 0.625rem;
    padding: 1rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .table th, .table td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  .fluent-tabs {
    flex-direction: column;
    border-bottom: none;
  }
  
  .fluent-tab {
    border-bottom: none;
    border-right: 2px solid transparent;
  }
  
  .fluent-tab.active {
    border-bottom: none;
    border-right-color: var(--primary);
  }
  
  .request-details {
    grid-template-columns: 1fr;
  }
}