/* VizaLearn learner experience
   Intentionally scoped to .learner-app so tutor/admin dashboards retain their UI. */

.learner-app {
  --vl-ink: #15253f;
  --vl-muted: #64748b;
  --vl-border: #dbe4ef;
  --vl-surface: #ffffff;
  --vl-canvas: #f5f8fc;
  --vl-brand: #1167d8;
  --vl-brand-dark: #0a4faa;
  --vl-brand-soft: #eaf3ff;
  --vl-teal: #0f9f91;
  --vl-teal-soft: #e8faf7;
  --vl-warm: #ffb15b;
  --vl-shadow: 0 18px 45px rgba(28, 53, 86, 0.1);
  --vl-shadow-soft: 0 8px 24px rgba(28, 53, 86, 0.08);
  color: var(--vl-ink);
  background:
    radial-gradient(circle at 78% 4%, rgba(57, 139, 255, 0.09), transparent 27rem),
    var(--vl-canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.learner-app h1,
.learner-app h2,
.learner-app h3,
.learner-app h4 {
  color: var(--vl-ink);
  letter-spacing: -0.025em;
}

.learner-app a {
  color: var(--vl-brand-dark);
}

.learner-app button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--vl-brand), #2b7de7);
  box-shadow: 0 8px 18px rgba(17, 103, 216, 0.22);
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.learner-app button:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(17, 103, 216, 0.27);
}

.learner-app button:focus-visible,
.learner-app a:focus-visible,
.learner-app input:focus-visible,
.learner-app select:focus-visible {
  outline: 3px solid rgba(17, 103, 216, 0.24);
  outline-offset: 3px;
}

/* App chrome */
.learner-app .fixed-header {
  height: 72px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(219, 228, 239, 0.85);
  z-index: 100;
}

.learner-app .generic-popup {
  padding: 78px 24px 32px;
  border-radius: 0;
  background: rgba(9, 25, 46, 0.97);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}

.learner-app .generic-popup ul {
  width: min(420px, 100%);
  margin: 0 auto;
}

.learner-app .generic-popup ul li {
  margin: 4px 0;
}

.learner-app .generic-popup ul li a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  color: #fff;
  font-weight: 650;
}

.learner-app #mobile-nav-popup .mobile-course-link {
  margin-left: 26px;
}

.learner-app #mobile-nav-popup .mobile-course-link a {
  color: #c8dbef;
  font-size: 0.94rem;
}

.learner-app .generic-popup .close-icon {
  all: unset;
  position: absolute;
  top: 14px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
}

.learner-app .fixed-header::before,
.learner-app .fixed-footer::before {
  width: 232px;
  background: #0e2847;
}

.learner-app .logo {
  width: 180px;
  max-height: 46px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.learner-app .desktop-nav {
  gap: 14px;
}

.learner-app .profile-image-icon {
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--vl-brand-soft), var(--vl-shadow-soft);
}

.learner-app .language-icon {
  border-radius: 7px;
}

.learner-app .layout {
  margin-top: 72px;
  margin-bottom: 52px;
  padding-left: 232px;
  min-height: calc(100vh - 124px);
}

.learner-app:has(#ai-tutor-side) .layout {
  padding-right: 244px;
}

.learner-app .fixed-nav {
  top: 72px;
  width: 232px;
  max-width: 232px;
  height: calc(100vh - 124px);
  padding: 28px 18px;
  background: #0e2847;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.learner-app .fixed-nav .submenu-header {
  margin: 4px 0;
  padding: 0;
  opacity: 1;
}

.learner-app .fixed-nav .submenu-header a,
.learner-app .fixed-nav .submenu li a {
  border-radius: 10px;
  color: #d7e6f7;
  line-height: 1.3;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.learner-app .fixed-nav .submenu-header a {
  padding: 11px 12px;
  font-size: 0.93rem;
  font-weight: 750;
}

.learner-app .fixed-nav .submenu li a {
  margin-left: 8px;
  padding: 8px 14px;
  color: #c8dbef;
  font-size: 0.9rem;
}

.learner-app .fixed-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
  transform: translateX(2px);
}

.learner-app .fixed-nav a.active {
  position: relative;
  color: #fff;
  background: rgba(75, 163, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.15);
}

.learner-app .fixed-nav .submenu li a.active {
  color: #fff;
}

.learner-app .fixed-nav .submenu li a.active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #60a5fa;
  transform: translateY(-50%);
}

.learner-app .main-content {
  width: min(1040px, calc(100vw - 312px));
  max-width: 1040px;
  flex: 0 1 1040px;
  margin: 26px auto 22px;
  padding: 28px 34px 32px;
  border: 1px solid rgba(219, 228, 239, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--vl-shadow);
}

.learner-app:has(#ai-tutor-side) .main-content {
  width: min(1040px, calc(100vw - 536px));
  flex-basis: min(1040px, calc(100vw - 536px));
}

.learner-app .main-content.no-box {
  background: transparent;
}

.learner-app .subject-header,
.learner-app .language-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--vl-border);
}

.learner-app .subject-title,
.learner-app .language-title {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.15;
}

.learner-app .subject-type,
.learner-app .subject-level,
.learner-app .language-type,
.learner-app .language-level {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--vl-brand-soft);
  color: var(--vl-brand-dark);
  font-size: 0.82rem;
  font-weight: 750;
}

.learner-app .secondary-text {
  color: var(--vl-muted);
}

.learner-app .fixed-footer {
  height: 52px;
  padding: 10px 24px;
  border-top: 1px solid var(--vl-border);
  background: rgba(255,255,255,0.94);
}

/* Logged-in learning hub */
.learner-app .content-wrapper {
  width: 100%;
  max-width: none;
}

.learner-app .content-wrapper > h3 {
  margin: 8px 0 22px;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.learner-app .top-cards-container {
  width: 100%;
  gap: 14px;
  margin: 0 auto 18px;
}

.learner-app .top-card {
  min-height: 106px;
  padding: 18px 20px;
  border: 1px solid var(--vl-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
}

.learner-app .top-card:hover {
  border-color: #b9d3f5;
  box-shadow: var(--vl-shadow-soft);
  transform: translateY(-2px);
}

.learner-app .card-link i {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-right: 16px;
  border-radius: 14px;
  background: var(--vl-brand-soft);
  color: var(--vl-brand);
  font-size: 1.35rem;
}

.learner-app .card-text .card-title {
  color: var(--vl-ink);
}

.learner-app .card-text .card-value {
  color: var(--vl-muted);
}

.learner-app .home-search-section {
  margin: 18px 0 24px;
}

.learner-app .home-search-sort-container {
  width: 100%;
}

.learner-app .home-search-container,
.learner-app .search-container {
  min-height: 52px;
  border: 1px solid var(--vl-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(28, 53, 86, 0.06);
}

.learner-app .home-search-container > button,
.learner-app .search-container > button:not(.start-button):not(.stop-button):not(.refill-button) {
  all: unset;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--vl-brand);
  cursor: pointer;
}

.learner-app .home-search-container > button:hover,
.learner-app .search-container > button:not(.start-button):not(.stop-button):not(.refill-button):hover {
  background: var(--vl-brand-soft);
}

.learner-app .subject-grid {
  gap: 16px;
  margin: 0;
}

.learner-app .subject-card[data-subject] {
  max-width: none !important;
  min-height: 170px;
  padding: 22px !important;
  border: 1px solid var(--vl-border);
  border-radius: 20px !important;
  background: linear-gradient(145deg, #fff 28%, var(--subject-gradient) 150%) !important;
  box-shadow: none;
}

.learner-app .subject-card[data-subject]:hover {
  border-color: #b9d3f5;
  box-shadow: var(--vl-shadow-soft);
  transform: translateY(-3px);
}

.learner-app .subject-card[data-subject] .subject-icon {
  width: 94px;
  height: 94px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(28, 53, 86, 0.16);
}

.learner-app .subject-card[data-subject] .subject-title {
  color: var(--vl-ink);
  font-size: 1.25rem !important;
}

.learner-app .subject-card[data-subject] .top-courses-label,
.learner-app .subject-card[data-subject] .top-courses-list a {
  color: var(--vl-muted) !important;
}

/* Subject catalogs */
.learner-app #language-home ul,
.learner-app #subject-home > ul,
.learner-app #subject-home-search > ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  max-width: 900px;
  gap: 22px;
  margin-top: 28px;
}

.learner-app .flag-container-home,
.learner-app .icon-home {
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 18px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.learner-app .flag-container-home:hover,
.learner-app .icon-home:hover {
  border-color: var(--vl-border);
  background: #fff;
  transform: translateY(-3px);
}

.learner-app .flag-container-home img,
.learner-app .icon-home img {
  border-radius: 16px;
  box-shadow: 0 9px 24px rgba(28, 53, 86, 0.17);
}

.learner-app .radius-30 img {
  border-radius: 24px;
}

.learner-app .flag-container-home:hover img,
.learner-app .icon-home:hover img {
  transform: none;
  box-shadow: 0 12px 30px rgba(28, 53, 86, 0.2);
}

.learner-app .flag-container-home span,
.learner-app .icon-home span {
  margin-top: 10px;
  color: var(--vl-ink);
  font-size: 0.9rem;
}

.learner-app #last-course-div {
  margin: 30px 0 8px;
}

@media (min-width: 1001px) {
  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child),
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    max-width: 960px;
  }

  .learner-app .section-container {
    margin-bottom: 24px;
  }

  .learner-app .section-left,
  .learner-app .section-right {
    padding: 16px 20px;
  }

  .learner-app .section-left .center > p,
  .learner-app .section-right .center > p {
    margin-top: 6px;
    margin-bottom: 8px;
  }

  .learner-app .card-item {
    width: 154px;
  }

  .learner-app .card-button,
  .learner-app .card-select {
    width: min(100%, 220px);
  }
}

/* Course overview */
.learner-app .section-container {
  gap: 18px;
  margin-bottom: 32px;
}

.learner-app .section-left,
.learner-app .section-right {
  flex: 1 1 280px;
  max-width: none;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--vl-border);
  border-radius: 20px;
  background: linear-gradient(155deg, #fff, #f8fbff);
}

.learner-app .section-left h4,
.learner-app .section-right h4 {
  font-size: 1.05rem;
}

.learner-app .card-item {
  width: 184px;
  padding: 9px;
  border: 1px solid var(--vl-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--vl-shadow-soft);
}

.learner-app .card-item img {
  border-radius: 13px;
}

.learner-app .card-button,
.learner-app .card-select {
  width: min(100%, 240px);
}

.learner-app select {
  min-height: 46px;
  border: 1px solid var(--vl-border);
  border-radius: 12px;
  color: var(--vl-ink);
}

.learner-app .search-container.course-filter {
  margin: 16px auto 4px;
  padding: 5px 12px;
  border: 1px solid var(--vl-border);
  border-radius: 14px;
  background: #fff;
}

.learner-app .table-container {
  border: 1px solid var(--vl-border);
  border-radius: 16px;
  background: #fff;
}

.learner-app .progress-table {
  border-collapse: separate;
  border-spacing: 0;
}

.learner-app .progress-table th {
  padding: 12px 14px;
  background: #f3f7fc;
  color: var(--vl-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.learner-app .progress-table td {
  padding: 10px 14px;
  border-top: 1px solid #eef2f7;
}

.learner-app .stage-header td {
  padding: 13px 14px;
  border-top: 1px solid var(--vl-border);
  background: #f8fbff;
  color: var(--vl-ink);
  font-weight: 750;
}

.learner-app .icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background-color: #b8cbe3;
  box-shadow: none;
}

.learner-app .icon.next {
  border: 2px solid var(--vl-brand);
  box-shadow: 0 0 0 4px var(--vl-brand-soft);
}

/* Lessons */
.learner-app .lesson-content {
  max-width: 780px;
  margin: 0 auto 30px;
}

.learner-app .lesson-paragraph {
  margin-bottom: 30px;
}

.learner-app .lesson-paragraph h3 {
  margin-bottom: 10px;
  color: var(--vl-ink);
  font-size: 1.22rem;
  line-height: 1.35;
}

.learner-app .lesson-paragraph p,
.learner-app .lesson-paragraph li {
  color: #334155;
  font-size: 1rem;
  line-height: 1.78;
}

.learner-app .lesson-highlight {
  padding: 18px 20px;
  border: 1px solid #cfe1f8;
  border-left: 4px solid var(--vl-brand);
  border-radius: 14px;
  background: #f5f9ff;
}

.learner-app .lesson-highlight.equation,
.learner-app .lesson-highlight.graph {
  min-height: 92px;
  overflow: auto;
  background: #fbfdff;
}

.learner-app .responsive-image img,
.learner-app .lesson-content svg,
.learner-app .lesson-content canvas {
  max-width: 100%;
}

/* Tests */
.learner-app .test-question {
  padding: 12px 0 22px;
  color: var(--vl-ink);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  line-height: 1.45;
}

.learner-app .button-grid {
  width: min(760px, 100%);
  grid-template-columns: repeat(2, minmax(180px, 280px));
  margin: 18px auto 30px;
  gap: 14px;
}

.learner-app .choice-button {
  min-width: 0;
  min-height: 84px;
  padding: 20px 24px;
  border: 2px solid var(--vl-border);
  border-radius: 16px;
  background: #fff;
  color: var(--vl-ink);
  box-shadow: 0 4px 12px rgba(28, 53, 86, 0.06);
  font-size: 1.08rem;
  font-weight: 700;
}

.learner-app .choice-button:hover {
  border-color: var(--vl-brand);
  background: var(--vl-brand-soft);
  color: var(--vl-brand-dark);
}

.learner-app .choice-button.disabled {
  border-color: #e2e8f0;
  background: #f1f5f9;
  color: #94a3b8;
}

.learner-app .language-footer,
.learner-app .subject-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--vl-border);
}

/* Persistent tutor card */
.learner-app #ai-tutor-side {
  top: 118px;
  right: 22px;
  width: 220px;
  max-width: 220px;
  height: auto;
  padding: 16px;
  border: 1px solid var(--vl-border);
  border-radius: 22px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--vl-shadow);
}

.learner-app #ai-tutor-side::before {
  content: "AI study coach";
  margin-bottom: 10px;
  color: var(--vl-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.learner-app #ai-tutor-side #ai-tutor-image {
  width: 100%;
  max-height: 190px;
  border-radius: 16px;
  object-fit: cover;
  object-position: top;
  background: linear-gradient(145deg, var(--vl-brand-soft), #fff);
}

.learner-app #ai-tutor-side #ai-tutor-button {
  width: 100%;
  min-width: 0;
  margin: 12px 0 8px;
  font-size: 0.9rem;
}

.learner-app #ai-tutor-side #ai-tutor-minutes {
  color: var(--vl-muted);
  font-size: 0.8rem;
}

@media (max-width: 1240px) and (min-width: 1001px) {
  .learner-app:has(#ai-tutor-side) .main-content {
    width: calc(100vw - 488px);
    padding: 24px;
  }
  .learner-app #ai-tutor-side {
    right: 14px;
    width: 210px;
  }
}

@media (max-width: 1000px) {
  .learner-app .fixed-header {
    height: 64px;
    padding: 10px 16px;
    background: #fff;
  }

  .learner-app .logo {
    max-width: 158px;
    filter: none;
  }

  .learner-app .layout {
    margin-top: 64px;
    padding: 14px;
  }

  .learner-app:has(#ai-tutor-side) .layout {
    padding-right: 14px;
  }

  .learner-app .main-content {
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
    margin: 0 0 84px;
    padding: 22px 18px 28px;
    border-radius: 20px;
  }

  .learner-app:not(:has(#ai-tutor-side)) .main-content {
    margin-bottom: 0;
  }

  .learner-app:has(#ai-tutor-side) .main-content {
    width: 100%;
    flex-basis: 100%;
    padding-bottom: 110px;
  }

  .learner-app .subject-header,
  .learner-app .language-header {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 22px;
    text-align: left;
  }

  .learner-app .subject-title,
  .learner-app .language-title {
    text-align: left;
  }

  .learner-app .subject-type-level-container,
  .learner-app .language-type-level-container {
    justify-content: flex-start;
  }

  .learner-app .top-cards-container {
    display: grid;
    grid-template-columns: 1fr;
  }

  .learner-app .assignments-card {
    display: flex;
  }

  .learner-app .subject-grid {
    gap: 12px;
  }

  .learner-app #language-home ul,
  .learner-app #subject-home > ul,
  .learner-app #subject-home-search > ul {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child),
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child) > li,
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) > li {
    grid-column: span 2;
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child) > li:nth-child(4),
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) > li:nth-child(4) {
    grid-column: 2 / span 2;
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child) > li:nth-child(5),
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) > li:nth-child(5) {
    grid-column: 4 / span 2;
  }

  .learner-app .subject-card,
  .learner-app .subject-card[data-subject] {
    width: 100% !important;
  }

  .learner-app .section-left,
  .learner-app .section-right {
    flex-basis: 100%;
  }

  .learner-app #ai-tutor-side {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    top: auto;
    width: auto;
    max-width: none;
    padding: 10px 12px;
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(14, 40, 71, 0.24);
  }

  .learner-app #ai-tutor-side::before,
  .learner-app #ai-tutor-side #ai-tutor-image {
    display: none;
  }

  .learner-app #ai-tutor-side #ai-tutor-button {
    width: auto;
    flex: 1;
    margin: 0;
  }

  .learner-app .button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learner-app .fixed-footer {
    position: static;
    min-height: 52px;
    height: auto;
    padding: 14px 12px;
    background: #fff;
  }

  .learner-app .choice-button {
    min-height: 74px;
    padding: 16px 10px;
  }
}

@media (max-width: 560px) {
  .learner-app .layout {
    padding: 8px;
  }

  .learner-app .main-content {
    padding: 20px 15px 24px;
    border-radius: 16px;
  }

  .learner-app .subject-card[data-subject] {
    min-height: 142px;
    padding: 14px !important;
  }

  .learner-app .subject-card[data-subject] .subject-icon {
    width: 76px !important;
    height: 76px !important;
  }

  .learner-app .subject-card[data-subject] .top-courses-list {
    grid-template-columns: 1fr !important;
  }

  .learner-app .subject-card[data-subject] .top-courses-list li:nth-child(n+3) {
    display: none;
  }

  .learner-app #language-home ul,
  .learner-app #subject-home > ul,
  .learner-app #subject-home-search > ul {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    gap: 14px;
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child),
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child) > li,
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) > li,
  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child) > li:nth-child(4),
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) > li:nth-child(4) {
    grid-column: auto;
  }

  .learner-app #subject-home > ul:has(> li:nth-child(5):last-child) > li:last-child,
  .learner-app #subject-home-search > ul:has(> li:nth-child(5):last-child) > li:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 7px);
    justify-self: center;
  }

  .learner-app .button-grid {
    grid-template-columns: 1fr;
  }

  .learner-app .choice-button {
    min-height: 64px;
  }

  .learner-app .fixed-footer {
    justify-content: center;
    font-size: 0.78rem;
  }

  .learner-app .search-sort-container {
    flex-wrap: wrap !important;
    gap: 10px;
  }

  .learner-app .search-sort-container > .search-container {
    flex-basis: 100% !important;
  }

  .learner-app .search-sort-container > .sort-container {
    flex: 1 0 100% !important;
    margin-left: 0 !important;
  }

  .learner-app .search-sort-container > .sort-container select {
    width: 100% !important;
    max-width: none !important;
  }
}
