/* Custom styles - متابعة المهام */

/* تحسينات RTL وتجربة الاستخدام */
html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* سكرول جميل */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* انيميشن الفتح والإغلاق */
.fade-in { animation: fadeIn 0.2s ease-in; }
.slide-up { animation: slideUp 0.25s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* بطاقة المهمة */
.task-card {
  transition: all 0.15s ease;
}
.task-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* شارات الأولوية */
.priority-high { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.priority-medium { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.priority-low { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* شارات الحالة */
.status-new { background: #e0e7ff; color: #3730a3; border: 1px solid #c7d2fe; }
.status-in_progress { background: #cffafe; color: #155e75; border: 1px solid #a5f3fc; }
.status-completed { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.status-cancelled { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.status-overdue { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2563eb;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* عناصر النموذج */
.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: white;
  transition: all 0.15s;
  font-size: 0.95rem;
}
.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #334155;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: #2563eb;
  color: white;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #94a3b8; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: #475569;
  border-color: #e2e8f0;
}
.btn-secondary:hover { background: #f8fafc; }

.btn-danger {
  background: #dc2626;
  color: white;
}
.btn-danger:hover { background: #b91c1c; }

.btn-ghost {
  background: transparent;
  color: #475569;
}
.btn-ghost:hover { background: #f1f5f9; }

/* المودال */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s;
}
.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s;
}

/* التقويم */
.calendar-cell {
  min-height: 90px;
  border: 1px solid #e2e8f0;
  padding: 0.5rem;
  background: white;
  position: relative;
}
.calendar-cell.other-month { background: #f8fafc; color: #94a3b8; }
.calendar-cell.today { background: #eff6ff; border-color: #3b82f6; }
.calendar-task {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* تمييز التابات */
.tab-active {
  border-bottom: 2px solid #2563eb;
  color: #2563eb;
  font-weight: 600;
}

/* responsive */
@media (max-width: 640px) {
  .calendar-cell { min-height: 60px; padding: 0.25rem; font-size: 0.75rem; }
}

/* toast notifications */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 100;
  animation: slideUp 0.2s;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }
