* {
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
}

/* Profile Header */
.profile-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 40px 20px;
  border-radius: 16px;
  margin-bottom: 32px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.2);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.2);
  border: 4px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 48px;
}

.profile-name {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.profile-email {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.card-header {
  padding: 20px 24px;
  background: var(--alt-section);
  border-bottom: 1px solid var(--card-border);
}

.card-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
}

.card-body {
  padding: 24px;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 14px;
}

.form-control {
  padding: 12px;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  color: var(--text-dark);
  background: var(--card-bg);
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.25);
}

.form-control:disabled {
  background: var(--alt-section);
  cursor: not-allowed;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.3);
  color: white;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--card-border);
  border: none;
  color: var(--text-dark);
  padding: 10px 20px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--alt-section);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 40px;
  font-size: 16px;
  width: 100%;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--alt-section);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--card-border);
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-gray);
  font-weight: 600;
}

/* Alerts */
.alert {
  border-radius: 10px;
  border: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
}

.alert-warning {
  background-color: #fff3cd;
  color: #856404;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

/* Text Colors */
.text-gray {
  color: var(--text-gray) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-muted {
  color: var(--text-gray) !important;
}

.fw-bold {
  font-weight: 700 !important;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* RTL Support */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .text-end {
  text-align: right;
}

html[dir="rtl"] .text-start {
  text-align: right;
}

html[dir="rtl"] .ms-3 {
  margin-right: 1rem;
  margin-left: 0;
}

html[dir="rtl"] .ps-5 {
  padding-right: 3rem;
  padding-left: 0;
}

html[dir="rtl"] .me-2 {
  margin-right: 0;
  margin-left: 0.5rem;
}

/* Dark theme support */
html[data-theme="dark"] body {
  --card-bg: #1f2937;
  --text-dark: #f3f4f6;
  --text-gray: #9ca3af;
  --card-border: #374151;
  --alt-section: #111827;
}

html[data-theme="dark"] .card {
  background-color: #1f2937;
  border-color: #374151;
}

html[data-theme="dark"] .form-control {
  background-color: #111827;
  color: #f3f4f6;
  border-color: #374151;
}

html[data-theme="dark"] .sidebar-card {
  background-color: #1f2937;
  color: #f3f4f6;
}

html[data-theme="dark"] .nav-link {
  color: #9ca3af;
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-link.active {
  color: #fff;
  background-color: rgba(14, 165, 233, 0.1);
}

html[data-theme="dark"] .course-item {
  border-color: #374151;
  background-color: #111827;
}

/* RTL Sidebar Navigation */
html[dir="rtl"] {
  direction: rtl;
}

html[dir="rtl"] .sidebar-card {
  text-align: right;
}

html[dir="rtl"] .nav-link {
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

html[dir="rtl"] .nav-link i {
  order: 2;
  font-size: 1.1rem;
  flex-shrink: 0;
}

html[dir="rtl"] .nav-link span {
  order: 1;
  flex-grow: 1;
  text-align: right;
}

html[dir="rtl"] .nav-pills {
  gap: 0.5rem;
}

html[dir="rtl"] .nav-pills .nav-link {
  border-radius: 0.375rem;
  transition: all 0.3s ease;
  padding: 0.75rem 1rem !important;
}

html[dir="rtl"] .nav-pills .nav-link.active {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
}

html[dir="rtl"] .nav-pills .nav-link:hover:not(.active) {
  background-color: rgba(14, 165, 233, 0.1);
  color: var(--text-dark);
}

html[dir="rtl"] .text-end {
  text-align: right !important;
}

html[dir="rtl"] .text-danger {
  color: #dc3545 !important;
}

