:root {
  --primary-color: #0b1a30;
  --primary-light: #162a4a;
  --accent-gold: #c5a059;
  --accent-gold-hover: #b38e45;
  --accent-gold-light: #f5eedf;
  --dark-bg: #07101e;
  --body-bg: #f4f6f9;
  --card-bg: #ffffff;
  --text-main: #2b303a;
  --text-muted: #6c757d;
  --border-color: #e5e9f2;
  --sidebar-width: 270px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, 'Cairo', sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* RTL / LTR Helpers */
[dir="rtl"] {
  text-align: right;
}

[dir="ltr"] {
  text-align: left;
}

/* Login Overlay */
#loginContainer {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top right, #1b335a, #07101e);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  padding: 40px 35px;
  border-top: 4px solid var(--accent-gold);
}

.login-brand {
  text-align: center;
  margin-bottom: 30px;
}

.login-brand i {
  font-size: 50px;
  color: var(--accent-gold);
}

.login-brand h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 10px;
}

.login-brand p {
  font-size: 14px;
  color: var(--text-muted);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  color: #ffffff;
  border: none;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--accent-gold-hover), #9d7a35);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(197, 160, 89, 0.35);
}

/* Dashboard Layout */
#dashboardContainer {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .sidebar {
  right: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

[dir="ltr"] .sidebar {
  left: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand i {
  font-size: 28px;
  color: var(--accent-gold);
}

.sidebar-brand span {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 15px 12px;
  list-style: none;
  margin: 0;
  flex: 1;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: #ced5e2;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-link i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-link:hover i {
  color: var(--accent-gold);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-hover));
  color: #ffffff;
  font-weight: 600;
}

.nav-link.active i {
  color: #ffffff;
}

.badge-counter {
  margin-right: auto;
  background-color: #e63946;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
}

[dir="ltr"] .badge-counter {
  margin-right: 0;
  margin-left: auto;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

[dir="rtl"] .main-wrapper {
  margin-right: var(--sidebar-width);
}

[dir="ltr"] .main-wrapper {
  margin-left: var(--sidebar-width);
}

/* Header */
.top-header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  position: sticky;
  top: 0;
  z-index: 999;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--accent-gold-light);
  padding: 6px 14px;
  border-radius: 30px;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 14px;
}

.user-badge i {
  color: var(--accent-gold);
  font-size: 18px;
}

/* Page Content */
.content-body {
  padding: 30px;
  flex: 1;
}

/* Stat Cards */
.stat-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-info h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 6px 0;
}

.stat-card .stat-info p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.stat-card .stat-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.stat-icon.gold {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
}

.stat-icon.blue {
  background: #e8f1fd;
  color: #1a73e8;
}

.stat-icon.green {
  background: #e6f7ef;
  color: #0d9f67;
}

.stat-icon.purple {
  background: #f1ecfc;
  color: #7c4dff;
}

/* Card Box */
.card-box {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-color);
  padding: 25px;
  margin-bottom: 25px;
}

.card-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.card-box-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Custom Table */
.table-custom {
  width: 100%;
  margin-bottom: 0;
}

.table-custom th {
  background-color: #f8fafc;
  color: var(--primary-color);
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  padding: 14px 16px;
  font-size: 14px;
}

.table-custom td {
  padding: 14px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.table-custom tr:hover td {
  background-color: #fbfcfe;
}

/* Member Badge */
.member-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  background-color: #f0f3f8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.member-avatar:hover {
  transform: scale(1.08);
}

.member-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Profile File Details Modal (ملف العضو المرتب) */
.profile-cover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  padding: 35px 25px 20px;
  border-radius: 12px 12px 0 0;
  color: #ffffff;
  position: relative;
  text-align: center;
  border-bottom: 4px solid var(--accent-gold);
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

.profile-avatar-lg {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  background: #ffffff;
}

.profile-avatar-placeholder-lg {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--accent-gold);
  border: 4px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 700;
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 5px 0;
}

.profile-subtitle {
  color: var(--accent-gold-light);
  font-size: 14px;
  margin-bottom: 12px;
}

.info-tile {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  height: 100%;
}

.info-tile-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-tile-label i {
  color: var(--accent-gold);
}

.info-tile-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-color);
}

.course-item-card {
  background: #ffffff;
  border: 1px solid #e9edf4;
  border-right: 4px solid var(--accent-gold);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

[dir="ltr"] .course-item-card {
  border-right: 1px solid #e9edf4;
  border-left: 4px solid var(--accent-gold);
}

.course-item-card:hover {
  background: #fdfbf7;
  transform: translateX(-2px);
}

.course-item-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-gold-light);
  color: var(--accent-gold-hover);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}


/* Action Buttons */
.btn-action {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action.edit {
  background: #eef3ff;
  color: #3b82f6;
}

.btn-action.edit:hover {
  background: #3b82f6;
  color: #ffffff;
}

.btn-action.delete {
  background: #fee2e2;
  color: #ef4444;
}

.btn-action.delete:hover {
  background: #ef4444;
  color: #ffffff;
}

.btn-action.view {
  background: #e0f2fe;
  color: #0284c7;
}

.btn-action.view:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Status Badges */
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.active {
  background: #dcfce7;
  color: #16a34a;
}

.badge-status.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.badge-status.unread {
  background: #fee2e2;
  color: #dc2626;
}

.badge-status.read {
  background: #f1f5f9;
  color: #64748b;
}

/* Toast Alerts */
#toastContainer {
  position: fixed;
  bottom: 25px;
  z-index: 11000;
}

[dir="rtl"] #toastContainer {
  left: 25px;
}

[dir="ltr"] #toastContainer {
  right: 25px;
}

/* Responsiveness */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
  }

  [dir="ltr"] .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }
}

/* =======================================================
   Blog Management & Quill.js Custom Styles
   ======================================================= */
.ql-toolbar.ql-snow {
  direction: ltr !important;
  text-align: left !important;
  background: #f8fafc;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-color: #cbd5e1 !important;
}

.ql-container.ql-snow {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-color: #cbd5e1 !important;
  font-size: 15px;
}

.ql-editor {
  direction: rtl !important;
  text-align: right !important;
  min-height: 280px;
  max-height: 500px;
  overflow-y: auto;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif !important;
  line-height: 1.8;
}

.ql-editor.ql-blank::before {
  right: 15px;
  left: auto;
  font-style: normal;
  color: #94a3b8;
}

.blog-thumb-mini {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.gallery-chip-item {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.gallery-chip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-chip-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.gallery-chip-remove:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.badge-featured {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

