/* ==========================================================
   SHARE MARKET GYAN — STOCK MARKET ACADEMY
   LEARN PAGE

   IMPORTANT:
   This file is written for the CURRENT learn.js markup.

   Current lesson card:
   .lesson-card
   ├── .lesson-number
   ├── .lesson-icon
   ├── .lesson-content
   │   ├── h3
   │   ├── p
   │   └── .lesson-difficulty
   └── .lesson-arrow

   The global style.css contains older rules for:
   .lesson-card
   .lesson-number
   .lesson-content
   .lesson-link

   This file deliberately overrides only the academy cards.
========================================================== */


/* ==========================================================
   DATA STATUS
========================================================== */

#academy-status {
  min-height: 20px;
  margin-bottom: 18px;
}

.academy-data-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  flex-wrap: wrap;

  padding: 11px 16px;

  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 10px;

  background: rgba(34, 197, 94, 0.05);

  color: #475569;

  font-size: 0.86rem;
  line-height: 1.4;
}

.academy-data-status strong {
  color: #166534;
  font-weight: 700;
}

.academy-data-status span {
  opacity: 0.8;
}

.academy-data-error {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.06);
}

.academy-data-error strong {
  color: #991b1b;
}


/* ==========================================================
   LEARN SEARCH
========================================================== */

.learning-search-form {
  position: relative;

  display: flex;
  align-items: center;

  width: min(100%, 760px);

  margin: 28px auto 34px;

  overflow: hidden;

  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;

  background: #ffffff;

  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.10);

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.learning-search-form:focus-within {
  border-color: #2563eb;

  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.12),
    0 0 0 3px rgba(37, 99, 235, 0.10);
}

.learning-search-form input {
  flex: 1 1 auto;

  min-width: 0;

  width: 100%;
  height: 54px;

  padding: 0 58px 0 18px;

  border: 0;
  outline: 0;

  background: transparent;

  color: #0f172a;

  font-family: "Inter", sans-serif;
  font-size: 0.92rem;
}

.learning-search-form input::placeholder {
  color: #94a3b8;
}

.learning-search-form button {
  position: absolute;

  top: 50%;
  right: 7px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;

  padding: 0;

  border: 0;
  border-radius: 10px;

  background: #2563eb;
  color: #ffffff;

  cursor: pointer;

  transform: translateY(-50%);

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.learning-search-form button:hover {
  background: #1d4ed8;

  transform:
    translateY(-50%)
    scale(1.03);
}

.learning-search-form button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}


/* ==========================================================
   VISIBILITY / SEARCH
========================================================== */

.lesson-card[hidden],
.roadmap-card[hidden],
.learning-level-section[hidden],
.academy-search-results[hidden] {
  display: none !important;
}

.academy-search-results {
  margin-top: 28px;
}

.academy-empty-state {
  padding: 28px 18px;

  border: 1px solid #e2e8f0;
  border-radius: 12px;

  background: #ffffff;

  color: #64748b;

  text-align: center;
}


/* ==========================================================
   ACADEMY SECTIONS
========================================================== */

#academy-levels .learning-level-section {
  opacity: 1;
  transform: none;
  visibility: visible;
}

#academy-levels .learning-level-section.hidden {
  opacity: 1;
  transform: none;
  visibility: visible;
}


/* ==========================================================
   LESSON GRID
========================================================== */

#academy-levels .lesson-list {
  display: grid !important;

  grid-template-columns:
    repeat(4, minmax(0, 1fr)) !important;

  gap: 14px !important;

  width: 100%;

  contain: layout paint;
}


/* ==========================================================
   LESSON CARD
========================================================== */

#academy-levels .lesson-card {
  --accent: #a855f7;
  --accent-rgb: 168, 85, 247;

  position: relative !important;

  display: block !important;

  width: 100% !important;

  min-width: 0 !important;

  height: 260px !important;
  min-height: 260px !important;

  margin: 0 !important;
  padding: 0 !important;

  overflow: hidden !important;

  box-sizing: border-box !important;

  isolation: isolate;

  color: #ffffff !important;

  text-decoration: none !important;

  background:
    radial-gradient(
      circle at 18% 32%,
      rgba(var(--accent-rgb), 0.20),
      transparent 34%
    ),
    radial-gradient(
      circle at 92% 92%,
      rgba(var(--accent-rgb), 0.08),
      transparent 36%
    ),
    linear-gradient(
      135deg,
      #10162b 0%,
      #07111f 52%,
      #020812 100%
    ) !important;

  border:
    1px solid
    rgba(var(--accent-rgb), 0.72) !important;

  border-radius: 13px !important;

  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;

  content-visibility: auto;
  contain-intrinsic-size: 260px;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease !important;
}


/* ==========================================================
   CARD GRID
========================================================== */

#academy-levels .lesson-card::before {
  content: "";

  position: absolute;

  inset: 0;

  z-index: -4;

  pointer-events: none;

  opacity: 0.52;

  background-image:
    linear-gradient(
      rgba(var(--accent-rgb), 0.045) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(var(--accent-rgb), 0.045) 1px,
      transparent 1px
    );

  background-size: 22px 22px;
}


/* ==========================================================
   CARD LIGHT / GLOW
========================================================== */

#academy-levels .lesson-card::after {
  content: "";

  position: absolute;

  width: 180px;
  height: 180px;

  left: -90px;
  top: 45px;

  z-index: -3;

  pointer-events: none;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(var(--accent-rgb), 0.18),
      transparent 68%
    );

  filter: blur(7px);
}


/* ==========================================================
   HOVER
========================================================== */

#academy-levels .lesson-card:hover {
  transform: translateY(-4px) !important;

  border-color:
    rgb(var(--accent-rgb)) !important;

  box-shadow:
    0 15px 30px rgba(0, 0, 0, 0.34),
    0 0 22px rgba(var(--accent-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}


/* ==========================================================
   LESSON NUMBER
========================================================== */

#academy-levels .lesson-card .lesson-number {
  position: absolute !important;

  top: 14px !important;
  left: 14px !important;

  z-index: 30;

  display: flex !important;

  align-items: center !important;
  justify-content: center !important;

  width: 43px !important;
  height: 35px !important;

  min-width: 43px !important;
  min-height: 35px !important;

  margin: 0 !important;
  padding: 0 !important;

  flex: none !important;

  border: 0 !important;
  border-radius: 6px !important;

  background:
    linear-gradient(
      145deg,
      #ffffff,
      #e9edf5
    ) !important;

  color:
    rgb(var(--accent-rgb)) !important;

  font-size: 17px !important;
  font-weight: 900 !important;

  line-height: 1 !important;

  box-shadow:
    0 4px 11px rgba(0, 0, 0, 0.28) !important;

  box-sizing: border-box !important;

  transition:
    transform 0.25s ease;
}

#academy-levels .lesson-card:hover .lesson-number {
  transform:
    translateY(-1px)
    scale(1.04);
}


/* ==========================================================
   LESSON ICON
   NOTE: Current JS uses .lesson-icon, not .lesson-card-icon.
========================================================== */

#academy-levels .lesson-card .lesson-icon {
  position: absolute !important;

  left: 17px !important;
  top: 50% !important;

  z-index: 20;

  display: flex !important;

  align-items: center !important;
  justify-content: center !important;

  width: 82px !important;
  height: 82px !important;

  margin: 0 !important;
  padding: 0 !important;

  flex: none !important;

  transform: translateY(-50%) !important;

  box-sizing: border-box !important;

  border:
    1.5px solid
    rgb(var(--accent-rgb)) !important;

  border-radius: 50% !important;

  background:
    radial-gradient(
      circle,
      rgba(var(--accent-rgb), 0.23),
      rgba(var(--accent-rgb), 0.07) 52%,
      rgba(2, 8, 18, 0.94) 75%
    ) !important;

  color:
    rgb(var(--accent-rgb)) !important;

  box-shadow:
    0 0 0 1px
    rgba(var(--accent-rgb), 0.10),

    0 0 20px
    rgba(var(--accent-rgb), 0.20),

    inset 0 0 18px
    rgba(var(--accent-rgb), 0.10) !important;

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease !important;
}


/* inner ring */

#academy-levels .lesson-card .lesson-icon::before {
  content: "";

  position: absolute;

  inset: 8px;

  border:
    1px solid
    rgba(var(--accent-rgb), 0.42);

  border-radius: 50%;
}


/* orbit dot */

#academy-levels .lesson-card .lesson-icon::after {
  content: "";

  position: absolute;

  top: 6px;
  right: 8px;

  width: 6px;
  height: 6px;

  border-radius: 50%;

  background:
    rgb(var(--accent-rgb));

  box-shadow:
    0 0 10px
    rgb(var(--accent-rgb));
}


#academy-levels .lesson-card .lesson-icon i {
  position: relative;

  z-index: 5;

  margin: 0 !important;
  padding: 0 !important;

  color:
    rgb(var(--accent-rgb)) !important;

  font-size: 28px !important;

  line-height: 1 !important;

  filter:
    drop-shadow(
      0 0 7px
      rgba(var(--accent-rgb), 0.45)
    );

  transition:
    transform 0.3s ease;
}


#academy-levels .lesson-card:hover .lesson-icon {
  transform:
    translateY(-50%)
    scale(1.06) !important;

  box-shadow:
    0 0 0 1px
    rgba(var(--accent-rgb), 0.14),

    0 0 29px
    rgba(var(--accent-rgb), 0.28),

    inset 0 0 22px
    rgba(var(--accent-rgb), 0.15) !important;
}


#academy-levels .lesson-card:hover .lesson-icon i {
  transform: scale(1.10);
}


/* ==========================================================
   CONTENT
   CRITICAL FIX:
   Global style.css has .lesson-content { background:#fff; }
   This scoped override removes that white rectangle.
========================================================== */

#academy-levels .lesson-card .lesson-content {
  position: absolute !important;

  top: 0 !important;
  right: 0 !important;
  bottom: 48px !important;
  left: 108px !important;

  z-index: 10;

  display: flex !important;

  flex-direction: column !important;

  justify-content: center !important;
  align-items: flex-start !important;

  width: auto !important;
  height: auto !important;

  min-width: 0 !important;

  margin: 0 !important;
  padding:
    14px
    14px
    7px
    0 !important;

  box-sizing: border-box !important;

  background:
    transparent !important;

  border: 0 !important;
  border-radius: 0 !important;

  color: #ffffff !important;

  box-shadow: none !important;
}


/* ==========================================================
   TITLE
========================================================== */

#academy-levels .lesson-card .lesson-content h3 {
  display: block !important;

  width: 100% !important;

  margin:
    0 0 8px !important;

  padding: 0 !important;

  background:
    transparent !important;

  border: 0 !important;

  color:
    #f8fafc !important;

  font-size: 17px !important;

  font-weight: 800 !important;

  line-height: 1.28 !important;

  letter-spacing: -0.015em;

  text-align: left !important;

  box-shadow: none !important;
}


/* ==========================================================
   DESCRIPTION
========================================================== */

#academy-levels .lesson-card .lesson-content p {
  display: block !important;

  width: 100% !important;

  margin: 0 !important;
  padding: 0 !important;

  background:
    transparent !important;

  border: 0 !important;

  color:
    #b9c3d2 !important;

  font-size: 11px !important;

  font-weight: 400 !important;

  line-height: 1.55 !important;

  text-align: left !important;

  box-shadow: none !important;
}


/* ==========================================================
   DIFFICULTY
   Current JS puts difficulty INSIDE .lesson-content.
   Move it visually into the footer.
========================================================== */

#academy-levels .lesson-card .lesson-difficulty {
  position: absolute !important;

  left: -102px !important;
  bottom: -37px !important;

  z-index: 25;

  display: inline-flex !important;

  align-items: center !important;

  gap: 7px !important;

  margin: 0 !important;
  padding: 0 !important;

  background:
    transparent !important;

  border: 0 !important;

  color:
    rgb(var(--accent-rgb)) !important;

  font-size: 11px !important;

  font-weight: 800 !important;

  line-height: 1 !important;

  white-space: nowrap;

  box-shadow: none !important;
}


/* difficulty dot */

#academy-levels .lesson-card .lesson-difficulty::before {
  content: "";

  width: 7px;
  height: 7px;

  flex: 0 0 7px;

  border-radius: 50%;

  background:
    rgb(var(--accent-rgb));

  box-shadow:
    0 0 8px
    rgba(var(--accent-rgb), 0.72);
}


/* ==========================================================
   FOOTER LINE
========================================================== */

#academy-levels .lesson-card .lesson-content::after {
  content: "";

  position: absolute;

  left: -102px;
  right: -14px;

  bottom: -12px;

  height: 1px;

  background:
    rgba(var(--accent-rgb), 0.42);

  pointer-events: none;
}


/* ==========================================================
   ARROW
   Current JS uses .lesson-arrow, not .lesson-link.
========================================================== */

#academy-levels .lesson-card .lesson-arrow {
  position: absolute !important;

  right: 14px !important;
  bottom: 10px !important;

  z-index: 30;

  display: flex !important;

  align-items: center !important;
  justify-content: center !important;

  width: 30px !important;
  height: 30px !important;

  margin: 0 !important;
  padding: 0 !important;

  border:
    1px solid
    rgba(var(--accent-rgb), 0.62) !important;

  border-radius: 50% !important;

  background:
    rgba(var(--accent-rgb), 0.07) !important;

  color:
    rgb(var(--accent-rgb)) !important;

  box-shadow: none !important;

  box-sizing: border-box !important;

  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease !important;
}


#academy-levels .lesson-card .lesson-arrow i {
  margin: 0 !important;

  color:
    rgb(var(--accent-rgb)) !important;

  font-size: 13px !important;

  line-height: 1 !important;
}


#academy-levels .lesson-card:hover .lesson-arrow {
  transform: translateX(4px);

  background:
    rgba(var(--accent-rgb), 0.15) !important;

  box-shadow:
    0 0 14px
    rgba(var(--accent-rgb), 0.18);
}


/* ==========================================================
   "START LESSON" LABEL
   Created with CSS because current JS only has the arrow.
========================================================== */

#academy-levels .lesson-card .lesson-arrow::before {
  content: "Start Lesson";

  position: absolute;

  right: 40px;

  color:
    rgb(var(--accent-rgb));

  font-size: 11px;

  font-weight: 800;

  white-space: nowrap;
}


/* ==========================================================
   DECORATIVE MARKET BARS
========================================================== */

#academy-levels .lesson-card .lesson-content::before {
  content: "";

  position: absolute;

  right: 3px;
  bottom: 2px;

  width: 82px;
  height: 45px;

  pointer-events: none;

  opacity: 0.16;

  background:

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    3px 25px / 2px 17px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    0 30px / 8px 9px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    22px 16px / 2px 27px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    18px 21px / 9px 12px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    43px 9px / 2px 34px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    39px 15px / 9px 15px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    64px 2px / 2px 41px no-repeat,

    linear-gradient(
      rgb(var(--accent-rgb)),
      rgb(var(--accent-rgb))
    )
    60px 8px / 9px 18px no-repeat;
}


/* ==========================================================
   CARD ACCENTS
========================================================== */

#academy-levels .lesson-card:nth-child(8n + 1) {
  --accent: #a855f7;
  --accent-rgb: 168, 85, 247;
}

#academy-levels .lesson-card:nth-child(8n + 2) {
  --accent: #22d3ee;
  --accent-rgb: 34, 211, 238;
}

#academy-levels .lesson-card:nth-child(8n + 3) {
  --accent: #3b82f6;
  --accent-rgb: 59, 130, 246;
}

#academy-levels .lesson-card:nth-child(8n + 4) {
  --accent: #22c55e;
  --accent-rgb: 34, 197, 94;
}

#academy-levels .lesson-card:nth-child(8n + 5) {
  --accent: #f59e0b;
  --accent-rgb: 245, 158, 11;
}

#academy-levels .lesson-card:nth-child(8n + 6) {
  --accent: #ec4899;
  --accent-rgb: 236, 72, 153;
}

#academy-levels .lesson-card:nth-child(8n + 7) {
  --accent: #0ea5e9;
  --accent-rgb: 14, 165, 233;
}

#academy-levels .lesson-card:nth-child(8n + 8) {
  --accent: #eab308;
  --accent-rgb: 234, 179, 8;
}


/* ==========================================================
   LEVEL 12 — OPTIONS
========================================================== */

#academy-levels
.lesson-card[data-level-number="12"] {
  background:
    radial-gradient(
      circle at 18% 30%,
      rgba(var(--accent-rgb), 0.19),
      transparent 34%
    ),
    radial-gradient(
      circle at 90% 90%,
      rgba(124, 58, 237, 0.10),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      #110b27 0%,
      #080e20 52%,
      #020812 100%
    ) !important;
}


/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1200px) {

  #academy-levels .lesson-list {
    grid-template-columns:
      repeat(3, minmax(0, 1fr)) !important;
  }

}


@media (max-width: 900px) {

  #academy-levels .lesson-list {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
  }

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 700px) {

  .learning-search-form {
    width: 100%;
    margin-top: 22px;
  }

  #academy-levels .lesson-list {
    grid-template-columns: 1fr !important;

    gap: 14px !important;

    contain: none;
  }

  #academy-levels .lesson-card {
    height: 245px !important;
    min-height: 245px !important;

    content-visibility: visible;
  }

  #academy-levels .lesson-icon {
    left: 16px !important;

    width: 78px !important;
    height: 78px !important;
  }

  #academy-levels .lesson-content {
    left: 103px !important;
  }

  #academy-levels .lesson-content h3 {
    font-size: 16px !important;
  }

  #academy-levels .lesson-content p {
    font-size: 11px !important;
  }

}


/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width: 480px) {

  #academy-levels .lesson-card {
    height: 225px !important;
    min-height: 225px !important;
  }

  #academy-levels .lesson-number {
    top: 12px !important;
    left: 12px !important;

    width: 40px !important;
    height: 33px !important;

    min-width: 40px !important;
  }

  #academy-levels .lesson-icon {
    left: 13px !important;

    width: 68px !important;
    height: 68px !important;
  }

  #academy-levels .lesson-content {
    left: 91px !important;

    padding-right: 10px !important;
  }

  #academy-levels .lesson-content h3 {
    font-size: 15px !important;
  }

  #academy-levels .lesson-content p {
    font-size: 10.5px !important;
  }

  #academy-levels .lesson-arrow {
    right: 12px !important;
  }

}


/* ==========================================================
   ACCESSIBILITY
========================================================== */

#academy-levels .lesson-card:focus-visible {
  outline:
    2px solid
    rgb(var(--accent-rgb));

  outline-offset: 3px;
}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

  #academy-levels .lesson-card,
  #academy-levels .lesson-card *,
  #academy-levels .lesson-card::before,
  #academy-levels .lesson-card::after,
  .learning-search-form,
  .learning-search-form button {
    transition: none !important;
  }

  #academy-levels .lesson-card:hover {
    transform: none !important;
  }

}
