/* =============================================
   Detektly Academy — Design System
   ============================================= */
@import url('https://unpkg.com/@phosphor-icons/web@2.1.1/src/regular/style.css');

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

:root {
  --bg: #0b1020;
  --bg-soft: #101833;
  --panel: rgba(17, 24, 51, .96);
  --panel-2: rgba(15, 23, 42, .78);
  --panel-3: rgba(20, 31, 58, .88);
  --line: #26345f;
  --line-soft: rgba(148, 163, 184, .18);
  --text: #e9eefc;
  --muted: #9db0d7;
  --accent: #6ea8fe;
  --accent-2: #9bdbff;
  --accent-glow: rgba(110, 168, 255, .15);
  --purple: #8b5cf6;
  --purple-glow: rgba(139, 92, 246, .14);
  --success: #38d39f;
  --warning: #ffcc66;
  --danger: #ff7f7f;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .35);
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-pill: 999px;
  --max-w: 1400px;
  --sidebar-w: 280px;
  --nav-h: 72px;
  --transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

body {
  font-family: 'IBM Plex Sans Arabic', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Tahoma, Arial, sans-serif;
  background: linear-gradient(180deg, #07101f 0%, #0b1020 100%);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
}

i[class*="ph-"] {
  vertical-align: -0.15em;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: var(--transition)
}

a:hover {
  color: var(--accent);
  text-decoration: underline
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 99px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent)
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.3;
  font-weight: 700
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -.02em
}

h2 {
  font-size: clamp(22px, 3vw, 36px)
}

h3 {
  font-size: clamp(18px, 2.4vw, 26px)
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Navigation --- */
.main-nav {
  position: sticky;
  top: 0;
  width: 100%;
  left: 0;
  z-index: 100;
  background: rgba(11, 16, 32, .88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line-soft);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--accent)
}

.nav-brand svg,
.nav-brand img {
  width: 36px;
  height: 36px
}

.nav-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, .06);
  text-decoration: none;
}

.nav-links a.active {
  color: var(--accent)
}

/* Mobile menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(7, 16, 31, .96);
  backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 24px;
  gap: 8px;
  animation: fadeIn .2s ease;
  overflow-y: auto;
}

.mobile-menu.open {
  display: flex
}

.mobile-menu a {
  display: block;
  padding: 14px 18px;
  border-radius: 14px;
  color: var(--text);
  font-size: 1.05rem;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line-soft);
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, .06);
  text-decoration: none
}

.mobile-menu-close {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  margin-bottom: 8px;
}

/* --- Layout --- */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px
}

.page-content {
  padding: 32px 0 80px
}

.section {
  margin-bottom: 48px
}

/* --- Cards --- */
.card {
  background: linear-gradient(180deg, rgba(17, 24, 51, .96), rgba(12, 19, 39, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(110, 168, 255, .25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14, 23, 45, .95), rgba(17, 25, 50, .82));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  margin-bottom: 40px;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: var(--radius-pill);
  filter: blur(80px);
  opacity: .25;
  pointer-events: none;
}

.hero::before {
  top: -80px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: var(--accent);
}

.hero::after {
  bottom: -80px;
  left: -60px;
  width: 320px;
  height: 320px;
  background: var(--purple);
}

.hero-content {
  position: relative;
  z-index: 2
}

.hero h1 {
  margin-bottom: 16px
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 800px;
  margin-bottom: 24px
}

/* --- Eyebrow / Badge --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--accent-glow);
  border: 1px solid rgba(110, 168, 255, .2);
  color: #cfe0ff;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid rgba(110, 168, 255, .2);
  background: var(--accent-glow);
  color: #d9e7ff;
}

.badge-success {
  background: rgba(56, 211, 159, .12);
  border-color: rgba(56, 211, 159, .25);
  color: #a8f0d8;
}

.badge-purple {
  background: var(--purple-glow);
  border-color: rgba(139, 92, 246, .25);
  color: #c4b5fd;
}

.badge-warning {
  background: rgba(255, 204, 102, .1);
  border-color: rgba(255, 204, 102, .25);
  color: #ffe4a0;
}

/* --- Stats Grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat-card {
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.stat-label {
  color: var(--muted);
  font-size: .9rem
}

/* --- Progress Bar --- */
.progress-bar {
  height: 10px;
  background: #091327;
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: var(--radius-pill);
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* --- Progress Ring (SVG) --- */
.progress-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.progress-ring svg {
  transform: rotate(-90deg)
}

.progress-ring circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset .6s ease;
}

.progress-ring .track {
  stroke: var(--line)
}

.progress-ring .fill {
  stroke: url(#grad)
}

.progress-ring .label {
  position: absolute;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}

/* --- Path Cards --- */
.path-card {
  background: linear-gradient(180deg, rgba(17, 24, 51, .96), rgba(12, 19, 39, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.path-card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 168, 255, .3);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}

.path-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.path-icon-seo {
  background: linear-gradient(135deg, rgba(110, 168, 255, .2), rgba(110, 168, 255, .08))
}

.path-icon-geo {
  background: linear-gradient(135deg, rgba(139, 92, 246, .2), rgba(139, 92, 246, .08))
}

.path-icon-tools {
  background: linear-gradient(135deg, rgba(56, 211, 159, .2), rgba(56, 211, 159, .08))
}

.path-icon-strategy {
  background: linear-gradient(135deg, rgba(255, 204, 102, .2), rgba(255, 204, 102, .08))
}

.path-card h3 {
  font-size: 1.2rem
}

.path-card p {
  color: var(--muted);
  font-size: .92rem;
  flex: 1
}

.path-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
}

.path-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Pill / Tag --- */
.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line-soft);
  font-size: .82rem;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(52, 120, 246, .9), rgba(124, 58, 237, .9));
  border-color: rgba(110, 168, 255, .35);
  color: #fff;
}

.btn-primary:hover {
  color: #fff
}

.btn-secondary {
  background: #101b38
}

.btn-sm {
  padding: 8px 16px;
  font-size: .85rem;
  border-radius: 10px
}

.btn-ghost {
  background: transparent;
  border-color: transparent
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .05)
}

/* --- CTA row --- */
.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap
}

/* --- Feature grid --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* --- Journey Steps --- */
.journey {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.journey-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  position: relative;
}

.journey-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  border: 2px solid var(--line);
  background: var(--bg-soft);
  margin-bottom: 14px;
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.journey-step.active .journey-dot {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: #fff;
  box-shadow: 0 0 20px rgba(110, 168, 255, .3);
}

.journey-step.done .journey-dot {
  border-color: var(--success);
  background: rgba(56, 211, 159, .15);
  color: var(--success);
}

.journey-line {
  position: absolute;
  top: 46px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--line);
  z-index: 1;
}

.journey-step h4 {
  font-size: .95rem;
  margin-bottom: 6px
}

.journey-step p {
  color: var(--muted);
  font-size: .82rem
}

/* --- Accordion --- */
.accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden
}

.accordion-item {
  border-bottom: 1px solid var(--line)
}

.accordion-item:last-child {
  border-bottom: none
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, .02);
  transition: var(--transition);
}

.accordion-header:hover {
  background: rgba(255, 255, 255, .04)
}

.accordion-arrow {
  font-size: .85rem;
  transition: transform .3s ease;
  color: var(--muted);
}

.accordion-item.open .accordion-arrow {
  transform: rotate(180deg)
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s ease;
  padding: 0 20px;
}

.accordion-item.open .accordion-body {
  max-height: 2000px;
  padding: 0 20px 20px;
}

/* --- Module Card --- */
.module-card {
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  transition: var(--transition);
}

.module-card:hover {
  background: rgba(255, 255, 255, .04);
  border-color: rgba(110, 168, 255, .2);
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

/* --- Lesson List --- */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid transparent;
  transition: var(--transition);
  color: var(--text);
  text-decoration: none;
}

.lesson-item:hover {
  background: rgba(255, 255, 255, .05);
  border-color: var(--line-soft);
  text-decoration: none;
}

.lesson-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  font-size: .7rem;
}

.lesson-item.completed .lesson-check {
  border-color: var(--success);
  background: rgba(56, 211, 159, .15);
  color: var(--success);
}

.lesson-item.locked {
  opacity: .5;
  pointer-events: none
}

.lesson-item.locked .lesson-check {
  border-color: var(--line)
}

.lesson-title {
  font-size: .92rem;
  flex: 1
}

.lesson-duration {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap
}

/* --- Resource List --- */
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px
}

.resource-link {
  display: block;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  color: var(--text);
  transition: var(--transition);
}

.resource-link:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(110, 168, 255, .2);
  text-decoration: none;
}

/* --- Footer --- */
.main-footer {
  border-top: 1px solid var(--line-soft);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-inner p {
  color: var(--muted);
  font-size: .85rem
}

/* --- Utility --- */
.hidden {
  display: none !important
}

.muted {
  color: var(--muted)
}

.text-center {
  text-align: center
}

.text-sm {
  font-size: .85rem
}

.mt-1 {
  margin-top: 8px
}

.mt-2 {
  margin-top: 16px
}

.mt-3 {
  margin-top: 24px
}

.mb-1 {
  margin-bottom: 8px
}

.mb-2 {
  margin-bottom: 16px
}

.mb-3 {
  margin-bottom: 24px
}

.gap-1 {
  gap: 8px
}

.gap-2 {
  gap: 16px
}

.gap-3 {
  gap: 24px
}

.flex {
  display: flex
}

.flex-col {
  flex-direction: column
}

.items-center {
  align-items: center
}

.justify-between {
  justify-content: space-between
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px
}

/* --- Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .6
  }
}

.anim-fade {
  animation: fadeIn .5s ease
}

.anim-slide {
  animation: slideUp .5s ease
}

/* --- Quote --- */
.quote {
  border-right: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 16px 0;
  color: var(--muted);
  background: rgba(255, 255, 255, .02);
  border-radius: 0 12px 12px 0;
}

/* --- Responsive --- */
@media(max-width:1024px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr
  }

  .journey {
    flex-direction: column;
    gap: 0
  }

  .journey-line {
    display: none
  }
}

@media(max-width:768px) {
  .nav-links {
    display: none
  }

  .nav-toggle {
    display: block
  }

  .hero {
    padding: 32px 24px;
    margin-top: 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr
  }

  .feature-grid {
    grid-template-columns: 1fr
  }

  .wrap {
    padding: 0 16px
  }

  h1 {
    font-size: clamp(24px, 6vw, 36px)
  }
}

@media(max-width:480px) {
  .stat-grid {
    grid-template-columns: 1fr
  }

  .cta-row {
    flex-direction: column
  }

  .cta-row .btn {
    width: 100%
  }
}