/*
 * Stylesheet for Crypto Maxx Academy landing page
 *
 * Colours and layout rules are inspired by the crypto/Web3 aesthetic:
 * dark backgrounds, glowing accents and clean typography. These styles
 * match the markup in index.html and support both Arabic (RTL) and
 * English (LTR) layouts – direction is set dynamically via JS.
 */

:root {
  /* Base colours */
  --bg: #0b0f17;
  --panel: #101827;
  --panel2: #0f1626;
  --text: #e9eefc;
  --muted: #a8b3cf;
  --line: rgba(255, 255, 255, 0.08);
  --primary: #4f8cff;
  --primary2: #6de3ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius2: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Roboto", "Arial", "Noto Sans", "Noto Sans Arabic", sans-serif;
  /* Base dark background. Additional animated overlay is applied via ::before */
  background: radial-gradient(1200px 600px at 80% -10%, rgba(79, 140, 255, 0.25), transparent 60%), radial-gradient(900px 500px at 10% 10%, rgba(109, 227, 255, 0.15), transparent 55%), var(--bg);
  color: var(--text);
}

/* Animated moving backdrop for extra depth. A pseudo element covers the page and
   slowly drifts the gradient background. It sits behind all content via
   negative z‑index. */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(79, 140, 255, 0.2), transparent 60%), radial-gradient(900px 500px at 10% 10%, rgba(109, 227, 255, 0.12), transparent 55%);
  animation: move-bg 45s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes move-bg {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10%, -10%);
  }
  100% {
    transform: translate(0, 0);
  }
}

/* Hamburger menu button with three bars */
.hamburger {
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 8px;
}
.hamburger .bar {
  width: 18px;
  height: 2px;
  background: var(--text);
  display: block;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* When the menu is open, animate the bars into an "X" */
.hamburger.active .bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}
.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger.active .bar:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Navigation overlay styles */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  z-index: 1000;
}
.nav-overlay.open {
  display: block;
}

.nav-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(16, 24, 39, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 250px;
  text-align: center;
}

.nav-panel a {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}
.nav-panel a:last-child {
  border-bottom: none;
}
.nav-panel a:hover {
  color: var(--primary2);
}

.nav-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  margin-bottom: 8px;
}

/* Sub navigation list under the features item */
.nav-panel .nav-sub {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px 0;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.nav-panel .nav-sub a {
  font-size: 16px;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: none;
  color: var(--text);
}
.nav-panel .nav-sub a:hover {
  color: var(--primary2);
}

/* Icon inside feed cards */
.post__icon {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Article cover image */
.article-cover img {
  width: 100%;
  border-radius: var(--radius2);
  margin-bottom: 16px;
}

/* Advertisement cards extra styling */
.post--ad .ad-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.post--ad .ad-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
/* Stats chips for ads reuse chip styling */
.chip {
  display: inline-block;
  margin-right: 4px;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 18px 0 60px;
}

/*
 * Add a subtle 3D feeling to key components. To achieve depth without
 * overwhelming the design, we declare a perspective on the page root
 * and give interactive elements a transform on hover. The shadows are
 * deepened and the elements lift slightly and tilt in 3D space when
 * hovered. These effects work in both dark and light modes and scale
 * down gracefully on mobile screens.
 */
body {
  /* enable 3D transforms for children */
  perspective: 1000px;
}

/*
 * Cards, strip items and feed posts all share a similar 3D hover style.
 * We add a base transition to smooth the movement and enlarge the
 * existing box‑shadow to emphasise depth. On hover the element lifts,
 * scales up a bit and rotates slightly on both the X and Y axes.
 */
.card,
.strip__item,
.post {
  transform-origin: center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}

.card:hover,
.strip__item:hover,
.post:hover {
  transform: translateY(-6px) scale(1.02) rotateX(3deg) rotateY(-3deg);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4), 0 15px 20px rgba(0, 0, 0, 0.25);
}


/* Top bar */
.topbar {
  width: min(1120px, 92%);
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(16, 24, 39, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.brand__name {
  font-weight: 800;
  letter-spacing: 0.3px;
}

.brand__tagline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Buttons */
.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.btn--primary {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.9), rgba(109, 227, 255, 0.45));
  border-color: rgba(79, 140, 255, 0.55);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
}

.chip {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

/* Hero section */
.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  margin-top: 18px;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero__left {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(16, 24, 39, 0.55);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero__right {
  display: flex;
}

h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
}

@media (max-width: 520px) {
  h1 {
    font-size: 30px;
  }
}

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

.hero__cta {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.social a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.1s ease;
}

.social a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.social img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

/* Card */
.card {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(16, 24, 39, 0.55);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

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

.card--glow:before {
  content: "";
  position: absolute;
  inset: -80px;
  background: radial-gradient(circle at 30% 20%, rgba(79, 140, 255, 0.22), transparent 50%), radial-gradient(circle at 70% 70%, rgba(109, 227, 255, 0.18), transparent 55%);
  filter: blur(6px);
  z-index: 0;
}

.card--glow > * {
  position: relative;
  z-index: 1;
}

.card__title {
  font-weight: 800;
  margin-bottom: 10px;
}

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

.stat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.stat__num {
  font-size: 20px;
  font-weight: 900;
}

.stat__label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

/* Feature strip */
.strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0 0;
}

@media (max-width: 920px) {
  .strip {
    grid-template-columns: 1fr;
  }
}

.strip__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(16, 24, 39, 0.5);
  box-shadow: var(--shadow);
}

.strip__icon {
  font-size: 20px;
}

.strip__title {
  font-weight: 900;
}

/* Feed */
.feed {
  margin-top: 18px;
}

.feed__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 22px;
}

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

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
}

.tab--active {
  border-color: rgba(79, 140, 255, 0.55);
  background: rgba(79, 140, 255, 0.12);
}

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

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.post {
  padding: 14px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: rgba(16, 24, 39, 0.5);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 170px;
}

.badgeRow {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.badge--news {
  border-color: rgba(109, 227, 255, 0.35);
  color: rgba(109, 227, 255, 0.9);
}

.badge--article {
  border-color: rgba(79, 140, 255, 0.35);
  color: rgba(79, 140, 255, 0.95);
}

.badge--ad {
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

.post__title {
  font-weight: 950;
  font-size: 16px;
  line-height: 1.25;
}

.post__desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.post__meta {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.post__date {
  color: var(--muted);
  font-size: 12px;
}

.post__link {
  font-weight: 900;
  color: var(--text);
  opacity: 0.95;
}

/* Final CTA */
.final {
  margin-top: 18px;
}

.final__box {
  padding: 18px;
  border-radius: var(--radius2);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.14), rgba(109, 227, 255, 0.06));
  box-shadow: var(--shadow);
}

.final__cta {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.footer {
  width: min(1120px, 92%);
  margin: 10px auto 18px;
  padding: 12px 4px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/*
 * Additional mobile tweaks. When the viewport is narrow, the top bar
 * rearranges its items vertically, the action buttons spread out and
 * the stat grid collapses into a single column. Social buttons also
 * expand to fill the available width for easier tapping on phones.
 */
@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .actions {
    width: 100%;
    justify-content: space-between;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .social a {
    width: 100%;
    justify-content: flex-start;
  }
  .brand__name {
    font-size: 18px;
  }
  .brand__tagline {
    font-size: 12px;
  }
}