.study-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(46, 232, 120, 0.14), transparent 28%),
    radial-gradient(circle at 88% 6%, rgba(72, 207, 255, 0.12), transparent 30%),
    linear-gradient(135deg, #020617 0%, #07111d 48%, #020617 100%);
  color: #f8fbff;
}

.study-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px 30px;
}

.study-hero h1 {
  margin: 10px 0 16px;
  max-width: 980px;
  color: #ffffff;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.05;
  text-shadow: 0 0 28px rgba(72, 207, 255, 0.24);
}

.study-hero p {
  max-width: 880px;
  color: #cbd5e1;
  font-size: 1.06rem;
  line-height: 1.8;
}

.study-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 82px;
}

.study-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid rgba(125, 211, 252, 0.22);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 38px rgba(0, 0, 0, 0.24);
}

.study-mode-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 118px;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 900;
  padding: 8px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.study-mode-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 211, 252, 0.34);
  color: #ffffff;
}

.study-mode-tab.is-active {
  background: linear-gradient(135deg, #22d3ee, #2ee878);
  color: #042f2e;
  box-shadow: 0 14px 30px rgba(46, 232, 120, 0.20);
}

.study-progress-view[hidden],
[data-reading-study-view][hidden],
[data-grammar-study-view][hidden] {
  display: none;
}

.study-progress-view {
  display: grid;
  gap: 18px;
}

.study-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.study-toolbar h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.study-page .level-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.study-page .level-tab {
  min-width: 98px;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.72);
  color: #dbeafe;
  font-weight: 900;
  padding: 9px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.study-page .level-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(72, 207, 255, 0.58);
}

.study-page .level-tab.active {
  background: linear-gradient(135deg, #18bd62, #0ea5e9);
  border-color: rgba(112, 245, 157, 0.55);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(14, 165, 233, 0.22);
}

.translation-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid rgba(125, 211, 252, 0.26);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(46, 232, 120, 0.16), rgba(72, 207, 255, 0.14)),
    rgba(2, 6, 23, 0.78);
  color: #ecfeff;
  font-weight: 900;
  padding: 10px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.translation-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(112, 245, 157, 0.58);
  box-shadow: 0 0 0 1px rgba(46, 232, 120, 0.20), 0 16px 36px rgba(72, 207, 255, 0.16);
}

.level-chip,
.demo-status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 6px 10px;
  text-transform: uppercase;
}

.level-chip.easy {
  background: rgba(46, 232, 120, 0.16);
  color: #a7fbc0;
  border: 1px solid rgba(112, 245, 157, 0.28);
}

.level-chip.medium {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.28);
}

.level-chip.hard {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.30);
}

.demo-status-pill {
  background: rgba(46, 232, 120, 0.16);
  color: #a7fbc0;
  border: 1px solid rgba(112, 245, 157, 0.28);
}

.practice-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 122px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #d0ffd8;
  font-weight: 900;
  padding: 10px 14px;
  transition: transform 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.practice-link span {
  transition: transform 0.22s ease;
}

.practice-link:hover {
  transform: translateX(4px);
  border-color: rgba(112, 245, 157, 0.62);
  color: #ffffff;
  box-shadow: 0 0 22px rgba(46, 232, 120, 0.18);
}

.practice-link:hover span {
  transform: translateX(4px);
}

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.demo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(8px);
}

.demo-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(46, 232, 120, 0.16), transparent 32%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.58);
  color: #ffffff;
  padding: 28px;
}

.demo-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(125, 211, 252, 0.20);
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.72);
  color: #ffffff;
}

.demo-modal-panel h2 {
  margin: 16px 40px 10px 0;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1.15;
}

.demo-modal-panel p {
  color: #cbd5e1;
  line-height: 1.7;
}

@media (max-width: 680px) {
  .study-hero {
    padding: 48px 18px 24px;
  }

  .study-shell {
    padding: 18px 18px 58px;
  }

  .study-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .study-mode-tab {
    min-width: 0;
  }

  .study-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .study-page .level-tabs,
  .study-search,
  .schedule-button,
  .translation-toggle,
  .practice-link {
    width: 100%;
  }

  .study-page .level-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }
}
