/* =========================================================
   My Study Adda professional layout
   Clean 2-column learning layout; no ad slots / ad rails
   ========================================================= */
.hidden { display: none !important; }

.app-header {
  z-index: 1040;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(217, 226, 239, .9);
  box-shadow: 0 6px 24px rgba(15, 23, 42, .06);
}
.app-navbar { min-height: var(--header-main-h); }
.app-nav-container { padding-inline: var(--page-pad); }
.app-brand { min-width: 0; display: flex; align-items: center; gap: .75rem; color: var(--app-text); }
.app-brand:hover { color: var(--app-text); }
.app-brand-logo { width: 56px; height: 56px; object-fit: contain; flex: 0 0 auto; }
.app-brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.app-brand-kicker { font-size: .74rem; color: var(--app-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.app-brand-title { font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-toggler { border: 1px solid var(--app-border); border-radius: 999px; padding: .45rem .6rem; box-shadow: none !important; }
.app-icon-btn { width: 42px; height: 42px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--app-border); color: var(--app-primary); }
.app-navbar .nav-link { color: #344054; font-weight: 650; border-radius: 999px; padding: .55rem .85rem; }
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active { color: var(--app-primary); background: var(--app-primary-soft); }
.dropdown-menu { border: 1px solid var(--app-border); border-radius: 14px; }
.dropdown-item { border-radius: 10px; margin: 2px 6px; width: auto; }
.dropdown-item:hover { background: var(--app-primary-soft); color: var(--app-primary); }

.topic-bar { min-height: var(--topic-bar-h); border-top: 1px solid rgba(217, 226, 239, .75); background: #f8fafc; }
.topic-scroller { min-height: var(--topic-bar-h); display: flex; align-items: center; gap: .5rem; overflow-x: auto; overflow-y: hidden; white-space: nowrap; padding-block: .55rem; scrollbar-width: thin; }
.topic-pill { display: inline-flex; align-items: center; min-height: 34px; padding: .45rem .8rem; border-radius: 999px; color: #344054; text-decoration: none; font-weight: 650; border: 1px solid transparent; transition: all .16s ease; }
.topic-pill:hover { color: var(--app-primary); background: #fff; border-color: var(--app-border); }
.topic-pill.active { background: var(--app-primary); color: #fff; box-shadow: 0 8px 18px rgba(29, 78, 216, .22); }
.topic-pill.disabled { color: var(--app-muted); }

.app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 24px; padding: var(--page-pad); align-items: start; }
.app-sidebar { position: sticky; top: calc(var(--header-h) + var(--page-pad)); max-height: calc(100vh - var(--header-h) - (var(--page-pad) * 2)); overflow: auto; }
.sidebar-card,
.content-card { background: rgba(255,255,255,.96); border: 1px solid rgba(217,226,239,.95); border-radius: var(--app-radius); box-shadow: var(--app-shadow-soft); }
.sidebar-card { padding: 14px; }
.sidebar-heading { display: flex; align-items: center; gap: .6rem; padding: .75rem .85rem; margin-bottom: .45rem; border-radius: 14px; background: linear-gradient(135deg, var(--app-primary), #3b82f6); color: #fff; font-weight: 800; }
.chapter-list { display: grid; gap: .3rem; }
.chapter-link { display: flex; align-items: flex-start; gap: .65rem; padding: .72rem .75rem; border-radius: 12px; color: #344054; text-decoration: none; line-height: 1.25; font-weight: 600; transition: all .15s ease; }
.chapter-link .bi { color: var(--app-muted); margin-top: .08rem; }
.chapter-link:hover { background: var(--app-surface-soft); color: var(--app-primary); }
.chapter-link.active { background: var(--app-primary-soft); color: var(--app-primary); box-shadow: inset 3px 0 0 var(--app-primary); }
.chapter-link.active .bi { color: var(--app-primary); }
.empty-state { color: var(--app-muted); padding: .85rem; background: var(--app-surface-soft); border-radius: 12px; }

.app-content { min-width: 0; }
.content-card { min-height: 58vh; padding: clamp(18px, 2vw, 34px); }
.flash-stack { margin-bottom: 1rem; }
.welcome-panel { padding: clamp(1rem, 4vw, 3rem); border-radius: var(--app-radius); background: linear-gradient(135deg, #eef5ff, #ffffff); border: 1px solid var(--app-border); }
.welcome-panel h1 { font-weight: 850; letter-spacing: -.03em; }
.welcome-panel p { color: var(--app-muted); margin-bottom: 0; }

.chapter-body { font-size: 1.02rem; line-height: 1.75; color: #263445; }
.chapter-body h1,
.chapter-body h2,
.chapter-body h3,
.chapter-body h4 { color: #111827; font-weight: 800; letter-spacing: -.02em; margin-top: 1.35em; margin-bottom: .55em; }
.chapter-body p { margin-bottom: 1rem; }
.chapter-body table { width: 100%; margin: 1rem 0; border-collapse: collapse; background: #fff; border: 1px solid var(--app-border); border-radius: 12px; overflow: hidden; }
.chapter-body th,
.chapter-body td { padding: .75rem; border: 1px solid var(--app-border); vertical-align: top; }
.chapter-body th { background: #f1f5f9; font-weight: 800; }
.chapter-body img { max-width: 100%; height: auto; border-radius: 14px; }
.chapter-body blockquote { border-left: 4px solid var(--app-primary); padding: .75rem 1rem; background: #f8fafc; border-radius: 0 12px 12px 0; color: #475467; }

.card { border-color: var(--app-border); border-radius: var(--app-radius-sm); }
.btn { border-radius: 999px; font-weight: 700; }
.btn-warning { --bs-btn-color: #111827; --bs-btn-bg: var(--app-accent); --bs-btn-border-color: var(--app-accent); }
.form-control,
.form-select { border-radius: 12px; border-color: var(--app-border); }
.form-control:focus,
.form-select:focus { border-color: rgba(29,78,216,.55); box-shadow: 0 0 0 .22rem rgba(29,78,216,.12); }
.modal-content { border: 0; border-radius: 22px; box-shadow: var(--app-shadow); }
.modal-header { border-bottom-color: var(--app-border); }

.mobile-section-title { padding: .85rem 1rem .45rem; font-size: .78rem; font-weight: 800; color: var(--app-muted); text-transform: uppercase; letter-spacing: .08em; }
.offcanvas { border: 0 !important; }
.offcanvas-header { border-bottom: 1px solid var(--app-border); }
.list-group-item { border-color: var(--app-border); }
.list-group-item.active { background: var(--app-primary); border-color: var(--app-primary); }

.app-footer { margin-top: 8px; padding: 0 var(--page-pad) var(--page-pad); }
.app-footer-inner { max-width: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 20px 24px; background: #101828; color: rgba(255,255,255,.82); border-radius: var(--app-radius); box-shadow: var(--app-shadow-soft); }
.footer-brand { font-weight: 850; color: #fff; letter-spacing: -.02em; }
.footer-copy { font-size: .9rem; color: rgba(255,255,255,.68); }
.footer-links { display: flex; flex-wrap: wrap; gap: .75rem 1rem; justify-content: flex-end; }
.footer-links a { color: rgba(255,255,255,.82); text-decoration: none; font-weight: 650; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 991.98px) {
  .app-nav-container { padding-inline: var(--page-pad); }
  .app-brand-logo { width: 48px; height: 48px; }
  .app-brand-kicker { display: none; }
  .app-brand-title { max-width: calc(100vw - 170px); font-size: 1rem; }
  .app-shell { display: block; padding: var(--page-pad); }
  .content-card { padding: 16px; border-radius: 16px; }
  .app-footer { padding-inline: var(--page-pad); }
  .app-footer-inner { flex-direction: column; align-items: flex-start; padding: 18px; }
  .footer-links { justify-content: flex-start; }
}

@media (max-width: 575.98px) {
  .app-brand-title { max-width: calc(100vw - 155px); }
  .content-card { padding: 14px; }
}


/* Admin dashboard */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--bs-primary);
}
.admin-tile {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-height: 112px;
  padding: 1.25rem;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 1rem;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.admin-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, .10);
  color: #0f172a;
}
.admin-tile i {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .85rem;
  background: rgba(13, 110, 253, .10);
  color: var(--bs-primary);
  font-size: 1.35rem;
}
.admin-tile strong, .admin-tile small {
  display: block;
}
.admin-tile small {
  margin-top: .2rem;
  color: #64748b;
}

/* =========================================================
   Admin full-width layout
   Used for /admin/* pages
   ========================================================= */

.app-shell-admin {
    display: block;
    width: 100%;
    max-width: 100%;
}

.app-content-admin {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.content-card-admin {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
}

.admin-full-page {
    width: 100%;
    max-width: 100%;
}

.admin-compact-table th,
.admin-compact-table td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.admin-full-page .card {
    border-radius: 1rem;
}

.admin-full-page .form-label {
    margin-bottom: 0.25rem;
}

.admin-full-page textarea.form-control-sm {
    font-size: 0.9rem;
}

@media (min-width: 992px) {
    .app-content-admin {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .content-card-admin {
        min-height: calc(100vh - 170px);
    }
}

/* ---------------------------------------------------------
   MCQ HTML + MathJax Rendering
--------------------------------------------------------- */

.mcq-render-box {
  font-size: 1rem;
}

.mcq-block {
  margin-bottom: 1rem;
}

.mcq-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.mcq-html {
  font-size: 1rem;
  line-height: 1.65;
  color: #212529;
  word-break: break-word;
}

.mcq-html p {
  margin-bottom: 0.75rem;
}

.mcq-html p:last-child {
  margin-bottom: 0;
}

.mcq-html img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem 0;
  border-radius: 0.5rem;
  border: 1px solid #dee2e6;
}

.mcq-html table {
  width: 100%;
  max-width: 100%;
  margin: 0.75rem 0;
  border-collapse: collapse;
}

.mcq-html table th,
.mcq-html table td {
  border: 1px solid #dee2e6;
  padding: 0.5rem;
  vertical-align: top;
}

.mcq-html ul,
.mcq-html ol {
  padding-left: 1.4rem;
  margin-bottom: 0.75rem;
}

.mcq-html blockquote {
  border-left: 4px solid #dee2e6;
  padding-left: 1rem;
  color: #495057;
  margin: 0.75rem 0;
}

.mcq-choice-list {
  display: grid;
  gap: 0.75rem;
}

.mcq-choice-card {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid #dee2e6;
  border-radius: 0.9rem;
  padding: 0.85rem;
  background: #fff;
}

.mcq-choice-card.is-correct {
  border-color: #198754;
  background: #f0fff6;
}

.mcq-choice-key {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f5;
  font-weight: 700;
  color: #495057;
}

.mcq-choice-content {
  flex: 1 1 auto;
  min-width: 0;
}

.mcq-correct-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #198754;
}

.mcq-explanation .mcq-html {
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  border-radius: 0.9rem;
  padding: 1rem;
}

/* MathJax responsiveness */
.mcq-html .MathJax,
.mcq-html mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

/* Compact rendering inside admin tables */
.mcq-table-preview {
  max-width: 520px;
}

.mcq-table-preview .mcq-html {
  font-size: 0.95rem;
  line-height: 1.45;
  max-height: 5.2rem;
  overflow: hidden;
}

.mcq-table-preview img {
  max-height: 90px;
  object-fit: contain;
}

.btn-msa-register {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  border: 0;
  color: #1f2937;
  font-weight: 700;
}

.btn-msa-register:hover,
.btn-msa-register:focus {
  background: linear-gradient(135deg, #fb8500, #f97316);
  color: #111827;
}
/* ---------------------------------------------------------
   Student Registration + Dashboard
--------------------------------------------------------- */
.student-auth-page,
.student-dashboard-page {
  width: 100%;
}

.student-benefits-card,
.student-form-card,
.student-panel,
.student-stat-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1.35rem;
  background: #fff;
  box-shadow: 0 1rem 2.4rem rgba(15, 23, 42, 0.08);
}

.student-benefits-card {
  padding: 2rem;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.35), transparent 34%),
    linear-gradient(145deg, #0f172a, #1d3557 52%, #023047);
}

.student-form-card,
.student-panel {
  padding: 1.5rem;
}

.student-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255, 183, 3, 0.18);
  color: #ffb703;
}

.student-hero-title {
  font-size: clamp(2rem, 4vw, 2.15rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.student-hero-text {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
  line-height: 1.7;
}

.student-plan-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1.1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.student-price {
  flex: 0 0 auto;
  font-size: 1.8rem;
  font-weight: 900;
  color: #ffb703;
}

.student-price-sm {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0d6efd;
}

.student-benefit-list {
  display: grid;
  gap: 1rem;
}

.student-benefit-item {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.student-benefit-item p {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.student-benefit-icon,
.student-ok-icon,
.student-payment-icon,
.student-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 999px;
}

.student-benefit-icon {
  width: 2.35rem;
  height: 2.35rem;
  background: rgba(255, 183, 3, 0.18);
  color: #ffb703;
}

.student-note {
  border-radius: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.student-check-panel {
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  background: #f8f9fa;
}

.student-payment-icon {
  width: 4rem;
  height: 4rem;
  background: #e7f1ff;
  color: #0d6efd;
  font-size: 2rem;
}

.student-payment-summary {
  border: 1px solid #e9ecef;
  border-radius: 1.1rem;
  padding: 1rem;
  background: #f8fafc;
}

.student-dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  border-radius: 1.35rem;
  padding: 1.6rem;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.30), transparent 35%),
    linear-gradient(145deg, #0d6efd, #0f172a);
  box-shadow: 0 1rem 2.4rem rgba(13, 110, 253, 0.18);
}

.student-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.student-stat-card {
  padding: 1rem;
  height: 100%;
}

.student-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.75rem;
  background: #e7f1ff;
  color: #0d6efd;
}

.student-stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.student-stat-label {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: #64748b;
}

.student-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.student-panel-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.student-panel-header p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.92rem;
}

.student-chapter-list {
  display: grid;
  gap: 0.75rem;
}

.student-chapter-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.student-chapter-card:hover {
  transform: translateY(-1px);
  border-color: #bfd7ff;
  box-shadow: 0 0.7rem 1.5rem rgba(15, 23, 42, 0.08);
}

.student-subscription-active {
  border: 1px solid #b7ebc6;
  border-radius: 1rem;
  padding: 1rem;
  background: #f0fff6;
}

.student-ok-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: #d1f7dd;
  color: #198754;
  font-size: 1.5rem;
}

.student-empty-panel {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  min-height: 8rem;
  border: 1px dashed #d0d7de;
  border-radius: 1rem;
  color: #64748b;
  text-align: center;
  background: #f8fafc;
}

.student-empty-panel i {
  font-size: 1.7rem;
}

.student-empty-panel p {
  margin: 0;
}

@media (max-width: 767.98px) {
  .student-benefits-card,
  .student-form-card,
  .student-panel {
    padding: 1.1rem;
    border-radius: 1rem;
  }

  .student-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 1.2rem;
  }

  .student-hero-actions {
    width: 100%;
    justify-content: stretch;
  }

  .student-hero-actions .btn {
    flex: 1 1 auto;
  }

  .student-plan-box,
  .student-chapter-card {
    flex-direction: column;
  }
}

/* -------------------------------------------------------
   My Study Adda - MathJax / Formula Responsive Styling
   Keeps formulas inside cards, boxes and tables
------------------------------------------------------- */

.card-body,
.table-responsive,
.formula-box,
.math-scroll {
  max-width: 100%;
}

mjx-container {
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 4px;
}

mjx-container[display="true"] {
  display: block !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.formula-box {
  background: #f8fafc;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: .75rem;
  padding: .75rem;
  margin-bottom: .75rem;
  overflow-x: auto;
}

.formula-box p {
  margin-bottom: .35rem;
}

.formula-card {
  overflow-x: auto;
}

.table td,
.table th {
  vertical-align: middle;
}

.table td mjx-container {
  font-size: 95% !important;
}