@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Cairo:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #F4F7FC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFE;
  --bg-glass: rgba(255, 255, 255, 0.7);
  --primary: #1E4F9A;
  --primary-light: #2A6FD4;
  --accent: #18D6E4;
  --accent-glow: rgba(24, 214, 228, 0.25);
  --accent-dim: rgba(24, 214, 228, 0.08);
  --text-primary: #0B1A33;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-light: #F8FAFC;
  --border-color: #E2E8F0;
  --border-glow: rgba(24, 214, 228, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px rgba(24, 214, 228, 0.12);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --font-en: 'Inter', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-primary);
}

body {
  direction: rtl;
  font-family: var(--font-ar);
  background: var(--bg-primary);
  color: var(--text-secondary);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ar);
  font-weight: 700;
  color: var(--text-primary);
}

p, span, a, li, td, th, label, input, textarea, button, select, option, small, strong, em {
  font-family: var(--font-ar);
}

.text-green { color: #10B981; }
.text-blue { color: var(--primary-light); }
.text-cyan { color: var(--accent); }
.text-teal { color: var(--accent); }
.text-red { color: #EF4444; }
.text-purple { color: #8B5CF6; }
.text-muted-custom { color: var(--text-muted); }
.text-secondary-custom { color: var(--text-secondary); }
.text-navy { color: var(--text-primary); }
.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navbar */
.navbar-academy {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  padding: 8px 0;
  transition: var(--transition);
}

.navbar-academy .navbar-brand img {
  height: 40px;
  width: auto;
  border-radius: 6px;
}

.navbar-academy .navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-academy .navbar-brand span {
  font-family: var(--font-en);
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.navbar-academy .nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.navbar-academy .nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: var(--transition);
}

.navbar-academy .nav-link:hover::after,
.navbar-academy .nav-link.active::after { width: 24px; }

.navbar-academy .nav-link:hover,
.navbar-academy .nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.navbar-academy .dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-hover);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-top: 8px !important;
}

.navbar-academy .dropdown-item {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  transition: var(--transition);
}

.navbar-academy .dropdown-item:hover,
.navbar-academy .dropdown-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.navbar-academy .dropdown-item small { color: var(--text-muted); }

.navbar-toggler {
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Buttons */
.btn-academy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  border-radius: 50px;
  padding: 10px 28px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-ar);
}

.btn-academy:hover { transform: translateY(-2px); }

.btn-academy-primary {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-academy-primary:hover {
  box-shadow: 0 8px 32px var(--accent-glow);
  color: #fff;
}

.btn-academy-green {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.btn-academy-green:hover {
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
  color: #fff;
}

.btn-academy-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-academy-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Hero */
.hero-section {
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 60px;
  background: #fff;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -250px;
  right: -150px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 214, 228, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 79, 154, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  line-height: 1.9;
  max-width: 600px;
}

/* Characters / Cards */
.char-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.char-card {
  padding: 20px;
  position: relative;
  z-index: 1;
}

.char-card img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.char-card .char-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Cards */
.academy-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.academy-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
  opacity: 0;
  transition: var(--transition);
}

.academy-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.academy-card:hover::before { opacity: 1; }

.level-card { border-radius: var(--radius-lg); overflow: hidden; }
.level-card.level-1 { border-color: rgba(16, 185, 129, 0.15); }
.level-card.level-1:hover { border-color: rgba(16, 185, 129, 0.3); }
.level-card.level-2 { border-color: rgba(24, 214, 228, 0.15); }
.level-card.level-2:hover { border-color: rgba(24, 214, 228, 0.3); }
.level-card.level-3 { border-color: rgba(239, 68, 68, 0.15); }
.level-card.level-3:hover { border-color: rgba(239, 68, 68, 0.3); }

.level-icon {
  width: 70px; height: 70px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 15px;
}

.level-icon.l1 { background: rgba(16, 185, 129, 0.08); color: #10B981; }
.level-icon.l2 { background: rgba(24, 214, 228, 0.08); color: var(--accent); }
.level-icon.l3 { background: rgba(239, 68, 68, 0.08); color: #EF4444; }

.badge-level {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-level.l1 {
  background: rgba(16, 185, 129, 0.08);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-level.l2 {
  background: rgba(24, 214, 228, 0.08);
  color: var(--accent);
  border: 1px solid rgba(24, 214, 228, 0.2);
}

.badge-level.l3 {
  background: rgba(239, 68, 68, 0.08);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glassmorphism helper */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: var(--radius-md);
}

/* Footer */
.footer-academy {
  border-top: 1px solid var(--border-color);
  background: #fff;
  padding: 30px 0;
  margin-top: 80px;
}

.footer-academy .footer-logo {
  height: 36px;
  width: auto;
  border-radius: 8px;
}

.footer-academy .footer-logo-text {
  font-family: var(--font-en);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Progress */
.progress-academy {
  height: 8px;
  background: var(--bg-primary);
  border-radius: 50px;
  overflow: hidden;
}

.progress-academy .progress-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.8s ease;
}

.progress-academy .progress-fill.green { background: linear-gradient(90deg, #10B981, #059669); }
.progress-academy .progress-fill.gold { background: linear-gradient(90deg, var(--accent), var(--primary-light)); }
.progress-academy .progress-fill.red { background: linear-gradient(90deg, #EF4444, #DC2626); }

/* Tables */
.table-academy {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-academy th {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
}

.table-academy td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.table-academy tr:hover td { background: var(--bg-primary); }

/* Form controls */
.form-control-academy {
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 14px 18px !important;
  transition: var(--transition);
}

.form-control-academy:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 4px var(--accent-dim) !important;
}

.form-control-academy::placeholder { color: var(--text-muted); }

.form-label-academy {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

/* Quiz */
.quiz-option {
  display: block;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: right;
}

.quiz-option:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.quiz-option.selected {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.06);
}

.quiz-option.correct {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
}

.quiz-option.wrong {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.08);
}

.quiz-option input { display: none; }

/* Code editor */
.code-editor {
  background: #1E293B;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-editor .editor-header {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-editor textarea {
  width: 100%;
  min-height: 200px;
  background: #0F172A;
  color: #E2E8F0;
  border: none;
  padding: 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.9rem;
  direction: ltr;
  text-align: left;
  resize: vertical;
}

.code-editor textarea:focus { outline: none; }

.code-output {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 100px;
  direction: ltr;
}

/* Accordion */
.accordion-academy {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: var(--border-color);
  --bs-accordion-btn-color: var(--text-primary);
  --bs-accordion-btn-bg: transparent;
  --bs-accordion-active-bg: var(--accent-dim);
  --bs-accordion-active-color: var(--accent);
  --bs-accordion-body-padding-x: 20px;
  --bs-accordion-border-radius: var(--radius-sm);
}

.accordion-academy .accordion-item {
  border-color: var(--border-color);
  margin-bottom: 8px;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.accordion-academy .accordion-button {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: none !important;
}

.accordion-academy .accordion-button:not(.collapsed) {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Section divider */
.section-divider-academy {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 48px 0 32px;
}

.section-divider-academy::before,
.section-divider-academy::after {
  content: '';
  flex: 1;
  height: 2px;
  border-radius: 2px;
}

.section-divider-academy::before {
  background: linear-gradient(90deg, transparent, var(--accent));
}

.section-divider-academy::after {
  background: linear-gradient(90deg, var(--primary-light), transparent);
}

.section-divider-academy span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  color: #fff;
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.6s ease forwards; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

/* Page header */
.page-header {
  padding: 100px 0 40px;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, rgba(24, 214, 228, 0.04), transparent);
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.page-header .breadcrumb-custom {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.page-header .breadcrumb-custom a {
  color: var(--text-secondary);
  text-decoration: none;
}

.page-header .breadcrumb-custom a:hover { color: var(--accent); }

/* Session card */
.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-card);
}

.session-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

/* Toolkit Cards */
.toolkit-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.toolkit-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-glow);
}

.toolkit-header {
  padding: 24px 24px 20px;
  position: relative;
}

.toolkit-green .toolkit-header { background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), transparent); }
.toolkit-teal .toolkit-header { background: linear-gradient(135deg, rgba(24, 214, 228, 0.06), transparent); }
.toolkit-red .toolkit-header { background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), transparent); }

.toolkit-green { border-top: 4px solid #10B981; }
.toolkit-teal { border-top: 4px solid var(--accent); }
.toolkit-red { border-top: 4px solid #EF4444; }

.toolkit-level { font-weight: 700; font-size: 0.9rem; }
.toolkit-green .toolkit-level { color: #10B981; }
.toolkit-teal .toolkit-level { color: var(--accent); }
.toolkit-red .toolkit-level { color: #EF4444; }

.toolkit-age {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 3px 12px;
  border-radius: 50px;
}

.toolkit-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.toolkit-body { padding: 16px 24px 20px; flex: 1; }

.toolkit-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.toolkit-count { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }

.toolkit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: default;
}

.toolkit-chip:hover { transform: translateY(-2px); }

.chip-green { background: rgba(16, 185, 129, 0.08); color: #10B981; }
.chip-green:hover { background: rgba(16, 185, 129, 0.14); }
.chip-teal { background: rgba(24, 214, 228, 0.08); color: var(--accent); }
.chip-teal:hover { background: rgba(24, 214, 228, 0.14); }
.chip-red { background: rgba(239, 68, 68, 0.08); color: #EF4444; }
.chip-red:hover { background: rgba(239, 68, 68, 0.14); }

/* Session sidebar */
.session-sidebar {
  position: sticky;
  top: 90px;
}

.session-sidebar .nav-pills .nav-link {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.session-sidebar .nav-pills .nav-link:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.session-sidebar .nav-pills .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary-light));
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* Activity card */
.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.step-num {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* Neon glow utility */
.neon-glow {
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Timeline item */
.timeline-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  cursor: pointer;
}

.timeline-item:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

/* Responsive */
@media (max-width: 992px) {
  .hero-title { font-size: 2.5rem; }
  .hero-section { min-height: auto; padding: 100px 0 40px; }
}

@media (max-width: 576px) {
  .hero-title { font-size: 1.8rem; }
  .stat-number { font-size: 1.8rem; }
}

/* Session tab content */
.session-tab-content {
  animation: fadeInUp 0.4s ease;
}

/* Alert overrides */
.alert-info {
  background: rgba(24, 214, 228, 0.06) !important;
  border: 1px solid rgba(24, 214, 228, 0.15) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
}

.alert-info .text-navy { color: var(--text-primary) !important; }

/* Extra utility */
.bg-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
