/* GenTech — brand: red / green / yellow — kid-friendly STEM */

:root {
  --primary: #0028a0;
  --primary-dark: #001f7a;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  --green: #0ea5e9;
  --green-dark: #0284c7;
  --teal: #0ea5e9;
  --bg: #f0f5ff;
  --surface: #ffffff;
  --ink: #1e293b;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nunito', 'Cairo', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

html.lang-ar body,
html[lang='ar'] body {
  font-family: 'Cairo', 'Nunito', system-ui, sans-serif;
}

.bg-page {
  background:
    radial-gradient(ellipse 70% 45% at 5% 0%, rgba(0, 40, 160, 0.12), transparent),
    radial-gradient(ellipse 55% 40% at 100% 5%, rgba(59, 130, 246, 0.16), transparent),
    radial-gradient(ellipse 50% 35% at 50% 100%, rgba(14, 165, 233, 0.1), transparent),
    #f0f5ff;
}

.text-primary { color: var(--primary); }
.bg-primary { background-color: var(--primary); }
.border-primary { border-color: var(--primary); }
.bg-accent { background-color: var(--accent); }
.text-accent { color: var(--accent-dark); }
.bg-teal { background-color: var(--green); }
.text-teal { color: var(--green); }
.bg-primary\/10 { background-color: rgba(0, 40, 160, 0.1); }
.bg-primary\/20 { background-color: rgba(0, 40, 160, 0.2); }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:border-primary:hover { border-color: var(--primary); }
.hover\:bg-primary:hover { background-color: var(--primary); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 40, 160, 0.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 40, 160, 0.4);
}
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}
.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px) scale(1.02);
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--primary);
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.progress-track {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--green));
  border-radius: 999px;
  transition: width 0.5s ease;
}

.course-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.course-card:hover {
  transform: translateY(-6px);
}

.social-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: #1e293b;
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}
.social-icon:hover {
  background: var(--primary);
  transform: translateY(-2px);
}

.hero-search {
  box-shadow: 0 12px 40px rgba(0, 40, 160, 0.12);
}

.category-tile {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.category-tile:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.15);
}

.step-num {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 1rem;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 40, 160, 0.35);
}

.accordion-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #fff;
}
.accordion-btn {
  width: 100%;
  text-align: start;
  padding: 1rem 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  transition: background 0.2s ease;
}
.accordion-btn:hover { background: #f8fafc; }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.accordion-item.open .accordion-panel { max-height: 320px; }
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-chevron { transition: transform 0.25s ease; }

.video-shell {
  background: #0f172a;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}
.video-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-play span {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 999px;
  background: rgba(0, 40, 160, 0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.video-play:hover span { transform: scale(1.08); }

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.quiz-option:hover {
  border-color: var(--primary);
  background: rgba(0, 40, 160, 0.04);
}
.quiz-option.selected {
  border-color: var(--primary);
  background: rgba(0, 40, 160, 0.08);
}
.quiz-option.correct {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}
.quiz-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.badge-tile {
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.badge-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.badge-tile.locked {
  opacity: 0.55;
  filter: grayscale(0.6);
}
.badge-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.streak-ring {
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--primary) calc(var(--pct, 0) * 1%), #e2e8f0 0);
  position: relative;
}
.streak-ring::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: #fff;
}
.streak-ring > * { position: relative; z-index: 1; }

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.chart-bar .bar {
  width: 100%;
  max-width: 2.5rem;
  border-radius: 0.5rem 0.5rem 0.25rem 0.25rem;
  background: linear-gradient(180deg, var(--primary), var(--accent), var(--green));
  transition: height 0.5s ease;
  min-height: 4px;
}

/* —— Homepage animations —— */
.fade-up {
  animation: fadeUp 0.7s ease both;
}
.fade-up-delay-1 { animation-delay: 0.12s; }
.fade-up-delay-2 { animation-delay: 0.24s; }
.fade-up-delay-3 { animation-delay: 0.36s; }

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

.float-y {
  animation: floatY 4s ease-in-out infinite;
}
.float-y-delay {
  animation: floatY 5s ease-in-out 0.8s infinite;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.bounce-soft {
  animation: bounceSoft 2.2s ease-in-out infinite;
}
@keyframes bounceSoft {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

.wiggle {
  animation: wiggle 3s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.spin-slow {
  animation: spinSlow 12s linear infinite;
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 40, 160, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(0, 40, 160, 0); }
}

.site-logo {
  height: 2.75rem;
  width: auto;
  display: block;
  transition: transform 0.2s ease;
}
.site-logo:hover {
  transform: scale(1.04);
}
.site-logo-lg {
  height: auto;
  width: min(180px, 42vw);
  max-width: 200px;
  margin-inline: auto;
  display: block;
  will-change: transform;
  animation:
    logoEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1) both,
    logoFloat 6s ease-in-out 0.9s infinite;
}
@keyframes logoEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.site-logo-footer {
  height: 3.5rem;
  width: auto;
  display: block;
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.hero-kids {
  position: relative;
  overflow: hidden;
  min-height: min(85vh, 720px);
  display: flex;
  align-items: center;
}
.hero-blob {
  position: absolute;
  border-radius: 40% 60% 55% 45%;
  filter: blur(0);
  opacity: 0.35;
  animation: morphBlob 8s ease-in-out infinite;
}
@keyframes morphBlob {
  0%, 100% { border-radius: 40% 60% 55% 45%; transform: scale(1) rotate(0deg); }
  50% { border-radius: 55% 45% 40% 60%; transform: scale(1.08) rotate(8deg); }
}

.floating-icon {
  position: absolute;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.age-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 2px solid #bfdbfe;
  color: #0028a0;
  font-weight: 800;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  animation: bounceSoft 2.8s ease-in-out infinite;
}

.track-card-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}
.category-tile:hover .track-card-icon {
  transform: rotate(-8deg) scale(1.1);
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.lesson-side-item.active {
  background: rgba(0, 40, 160, 0.1);
  color: var(--primary);
  font-weight: 700;
}

[dir='rtl'] .video-play span i.fa-play {
  margin-inline-start: 3px;
}

.table-wrap { overflow-x: auto; }
.gentech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.gentech-table th {
  text-align: start;
  padding: 0.75rem 1rem;
  background: #dbeafe;
  font-weight: 700;
  color: #475569;
}
.gentech-table td {
  padding: 0.85rem 1rem;
  border-top: 1px solid #e2e8f0;
}
.gentech-table tr:hover td { background: #f0f5ff; }

.leader-row:nth-child(1) {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.2), transparent);
}
.leader-row:nth-child(2) {
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.15), transparent);
}
.leader-row:nth-child(3) {
  background: linear-gradient(90deg, rgba(0, 40, 160, 0.1), transparent);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 40, 160, 0.15);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .fade-up,
  .float-y,
  .float-y-delay,
  .bounce-soft,
  .wiggle,
  .spin-slow,
  .pulse-glow,
  .hero-blob,
  .age-pill,
  .site-logo-lg {
    animation: none !important;
  }
}
