/* متغيّرات متوافقة مع header.css */
:root {
  --primary: #4361ee;
  --primary-light: #6a7dee;
  --primary-dark: #2c4be0;
  --secondary: #3a0ca3;
  --secondary-light: #4d1dca;
  --accent: #f72585;
  --accent-light: #ff70a6;
  --dark: #1a1a2e;
  --dark-light: #2a2a42;
  --light: #f8f9fa;
  --light-dark: #e9ecef;
  --text-dark: #2b2d42;
  --text-light: #edf2f4;
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

body {
  background: var(--light);
  font-family: 'Cairo', sans-serif;
  min-height: 100vh;
  transition: background 0.5s ease, color 0.5s ease;
}

body.dark-mode {
  background: var(--dark-light);
  color: var(--text-light);
}

/* sidebar - تم تحسين التصميم هنا */
.sidebar {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  min-height: 100vh;
  padding-top: 1.5rem;
  box-shadow: 
    5px 0 20px rgba(0, 0, 0, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

/* الشريط العلوي - تم التعديل هنا */
.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px; /* زيادة الارتفاع */
  background: linear-gradient(90deg, #ff6b6b 0%, #f72585 100%); /* تدرج لوني مميز */
  z-index: 1;
  box-shadow: 0 4px 10px rgba(247, 37, 133, 0.3); /* إضافة ظل */
}

body.dark-mode .sidebar {
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark-light) 100%);
}

.sidebar-logo {
  padding: 25px 20px 20px; /* تعديل الحشو ليكون تحت الشريط */
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
  margin-top: 8px; /* تباعد عن الشريط العلوي */
}

.user-welcome {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 12px;
  margin: 20px 10px;
  text-align: center;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 2;
}

.nav-link {
  color: rgba(0, 0, 0, 0.9) !important;
  padding: 15px 20px;
  margin: 5px 10px;
  border-radius: 12px;
  transition: var(--transition);
  font-weight: 600;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
  border-left: 4px solid transparent;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(239, 237, 237, 0.479);
  color: white !important;
  transform: translateX(-5px);
  border-left-color: var(--accent);
  box-shadow: 0 5px 15px rgba(120, 45, 45, 0.814);
}

.nav-link i {
  margin-left: 10px;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.nav-link:hover i {
  transform: scale(1.2);
}

/* البطاقات */
.dashboard-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  height: 100%;
  position: relative;
  overflow: hidden;
}

body.dark-mode .dashboard-card {
  background: rgba(42, 42, 66, 0.95);
  border-color: rgba(255, 255, 255, 0.05);
}

.dashboard-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

body.dark-mode .dashboard-card:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

.card-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
  background: rgba(67, 97, 238, 0.1) !important;
}

.btn-primary {
  background: var(--primary);
  border: none;
  padding: 10px 25px;
  font-weight: 600;
  border-radius: 50px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 7px 15px rgba(67, 97, 238, 0.3);
}

/* بطاقات الإحصائيات */
.stats-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--box-shadow);
  padding: 25px;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .stats-card {
  background: rgba(42, 42, 66, 0.95);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.05);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode .stats-header {
  border-color: rgba(255, 255, 255, 0.1);
}

.stats-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    min-height: auto;
  }
  .dashboard-card {
    margin-bottom: 1rem;
  }
  .sidebar::before {
    height: 8px; /* تقليل الارتفاع في الموبايل */
  }
}

/* navbar للموبايل */
.navbar-brand {
  font-weight: 700;
  color: var(--primary) !important;
}

body.dark-mode .navbar-brand {
  color: var(--accent) !important;
}

/* تحسينات إضافية */
.sidebar-logo h3 {
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  top: -5px; /* تعديل الموقع النسبي */
}

.user-welcome h6 {
  font-weight: 600;
  margin-bottom: 5px;
}

.user-welcome small {
  opacity: 0.85;
  font-size: 0.85em;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.2) !important;
}