/* ====================================================================== *
 * File: student_app_shell.css
 * Location: static/css/student_app_shell.css
 * Description: Shared authenticated Fereshte student application shell, premium navy sidebar, common canvas, headers, surfaces, controls, footer, and title wrapping rules.
 * Version: 1.0.0
 * Last Modified: Mon Aug 17 2026 - 12:58
 * Dependencies: app.css, student_shell.css, animated_footer.css, Estedad typography
 * ====================================================================== */

/* -------------------------------------------------------------------------- *
 * 1. Shared application tokens and desktop canvas
 * -------------------------------------------------------------------------- */

body.has-student-sidebar {
  --student-app-navy-950: #071f42;
  --student-app-navy-900: #092b59;
  --student-app-navy-850: #0d3568;
  --student-app-gold: #d8a936;
  --student-app-gold-soft: #f5d675;
  --student-app-text: #102a4f;
  --student-app-muted: #70819a;
  --student-app-line: #e1e7ef;
  --student-app-page: #f7f9fc;
  --student-app-surface: #ffffff;
  --student-app-radius: 18px;
  --student-app-control-radius: 11px;
  --student-app-shadow: 0 10px 30px rgba(16, 42, 79, 0.065);
  --student-app-canvas: 1360px;
  --student-sidebar-width: 258px;
  padding-right: var(--student-sidebar-width) !important;
  background:
    radial-gradient(circle at 11% 5%, rgba(42, 93, 165, 0.035), transparent 22%),
    var(--student-app-page) !important;
  color: var(--student-app-text);
}

body.has-student-sidebar > .container {
  width: min(var(--student-app-canvas), calc(100% - 60px)) !important;
  max-width: var(--student-app-canvas) !important;
  margin: 28px auto 34px !important;
}

body.has-student-sidebar > .container > .alert {
  margin-bottom: 14px;
}

.student-app-page {
  width: 100%;
  max-width: none;
  margin: 0;
  direction: rtl;
}

.student-page-header {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding: 20px 24px;
  border: 1px solid var(--student-app-line);
  border-radius: var(--student-app-radius);
  background:
    radial-gradient(circle at 3% 10%, rgba(216, 169, 54, 0.055), transparent 28%),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 26px rgba(15, 42, 80, 0.045);
}

.student-page-header-copy {
  min-width: 0;
}

.student-page-header h1 {
  margin: 0;
  color: var(--student-app-text);
  font-size: clamp(1.55rem, 2.25vw, 2.15rem);
  font-weight: 950;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.student-page-header p {
  margin: 7px 0 0;
  color: var(--student-app-muted);
  font-size: 0.82rem;
  line-height: 1.85;
}

.student-page-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.student-segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid #dfe5ed;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 42, 79, 0.035);
}

.student-segmented-control a,
.student-segmented-control button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 7px 13px;
  background: transparent;
  color: #687991;
  font: inherit;
  font-size: 0.69rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.student-segmented-control a:hover,
.student-segmented-control button:hover {
  color: #153f70;
  background: #f4f7fb;
}

.student-segmented-control a.is-active,
.student-segmented-control button.is-active {
  background: linear-gradient(135deg, #0d376d, #082b58);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(8, 43, 88, 0.16);
}

.student-surface {
  border: 1px solid var(--student-app-line);
  border-radius: var(--student-app-radius);
  background: var(--student-app-surface);
  box-shadow: var(--student-app-shadow);
}

.student-empty-panel {
  display: grid;
  min-height: 230px;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed #d6dfe9;
  border-radius: var(--student-app-radius);
  background:
    radial-gradient(circle at 50% 15%, rgba(37, 95, 163, 0.045), transparent 34%),
    #ffffff;
  color: #728197;
  text-align: center;
}

.student-empty-panel svg {
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
  fill: none;
  stroke: #9b7a30;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-empty-panel strong {
  color: #173b65;
  font-size: 0.95rem;
}

.student-empty-panel p {
  max-width: 620px;
  margin: 0;
  color: #7b899c;
  font-size: 0.76rem;
  line-height: 1.9;
}

.student-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
}

.student-app-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--student-app-navy-900);
  border-radius: var(--student-app-control-radius);
  padding: 9px 16px;
  background: linear-gradient(135deg, #0d376d, #082b58);
  color: #ffffff !important;
  font-size: 0.74rem;
  font-weight: 850;
  text-decoration: none;
}

.student-app-button.secondary {
  border-color: #cad5e2;
  background: #ffffff;
  color: #163c68 !important;
  box-shadow: none;
}

.student-app-button.gold {
  border-color: #d4a534;
  background: linear-gradient(135deg, #f0ca60, #d8a936);
  color: #102844 !important;
}

/* -------------------------------------------------------------------------- *
 * 2. Premium sidebar shared by every authenticated student page
 * -------------------------------------------------------------------------- */

@media (min-width: 961px) {
  body.has-student-sidebar,
  body.sidebar-is-collapsed {
    --student-sidebar-width: 258px !important;
    padding-right: 258px !important;
  }

  body.has-student-sidebar .topbar-authenticated {
    display: none !important;
  }

  body.has-student-sidebar .student-sidebar,
  body.sidebar-is-collapsed .student-sidebar {
    width: 258px !important;
    border-left: 0 !important;
    background:
      radial-gradient(circle at 50% 0, rgba(26, 90, 159, 0.22), transparent 32%),
      linear-gradient(180deg, #082b58 0%, #06244a 48%, #071f42 100%) !important;
    color: #dce8f6;
    box-shadow: -8px 0 28px rgba(3, 20, 45, 0.1) !important;
  }

  body.sidebar-is-collapsed .student-sidebar-brand-copy,
  body.sidebar-is-collapsed .student-sidebar-user {
    display: grid !important;
  }

  body.sidebar-is-collapsed .student-sidebar-section h2,
  body.sidebar-is-collapsed .student-sidebar-link span,
  body.sidebar-is-collapsed .student-sidebar-link b {
    display: initial !important;
  }

  body.sidebar-is-collapsed .student-sidebar-submenu {
    display: grid !important;
  }

  body.sidebar-is-collapsed .student-sidebar-header,
  body.sidebar-is-collapsed .student-sidebar-footer {
    justify-content: initial !important;
    padding-inline: 16px !important;
  }

  body.sidebar-is-collapsed .student-sidebar-link {
    justify-content: flex-start !important;
    padding-inline: 13px !important;
  }

  body.sidebar-is-collapsed .student-sidebar-footer form {
    display: block !important;
  }
}

body.has-student-sidebar .student-sidebar-header {
  min-height: 122px !important;
  justify-content: center !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  padding: 18px 16px 14px !important;
}

body.has-student-sidebar .student-sidebar-brand {
  flex-direction: column;
  gap: 7px;
  text-align: center;
}

body.has-student-sidebar .student-sidebar-mark {
  width: 60px;
  height: 60px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.has-student-sidebar .student-sidebar-mark img {
  width: 60px;
  height: 60px;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.14));
}

body.has-student-sidebar .student-sidebar-brand-copy strong {
  color: #e7ba48;
  font-size: 0.82rem;
}

body.has-student-sidebar .student-sidebar-brand-copy small {
  color: rgba(211, 226, 244, 0.56);
  font-size: 0.56rem;
}

body.has-student-sidebar .student-sidebar-nav {
  padding: 10px 12px 18px;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

body.has-student-sidebar .student-sidebar-section + .student-sidebar-section {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

body.has-student-sidebar .student-sidebar-section h2 {
  margin: 0 10px 7px;
  color: rgba(198, 214, 233, 0.46);
  font-size: 0.56rem;
  font-weight: 750;
}

body.has-student-sidebar .student-sidebar-link {
  position: relative;
  min-height: 43px;
  gap: 12px;
  margin: 3px 0;
  border-radius: 11px;
  padding: 9px 13px;
  color: rgba(229, 238, 250, 0.82);
  font-size: 0.72rem;
  font-weight: 720;
}

body.has-student-sidebar .student-sidebar-link svg {
  width: 19px;
  height: 19px;
  color: rgba(217, 229, 245, 0.78);
  stroke-width: 1.65;
}

body.has-student-sidebar .student-sidebar-link:hover {
  background: rgba(62, 114, 176, 0.17);
  color: #ffffff;
  transform: none;
}

body.has-student-sidebar .student-sidebar-link.is-active {
  background: linear-gradient(90deg, rgba(57, 111, 176, 0.31), rgba(38, 84, 145, 0.18));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(128, 170, 219, 0.08);
}

body.has-student-sidebar .student-sidebar-link.is-active::before {
  position: absolute;
  right: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e8bd4e;
  box-shadow: 0 0 0 3px rgba(232, 189, 78, 0.08);
  content: "";
}

body.has-student-sidebar .student-sidebar-link.is-active svg {
  color: #eac052;
}

body.has-student-sidebar .student-sidebar-details {
  display: block !important;
}

body.has-student-sidebar .student-sidebar-link[data-sidebar-install] {
  display: flex !important;
}

body.has-student-sidebar .student-sidebar-details summary b {
  color: rgba(220, 230, 244, 0.52);
}

body.has-student-sidebar .student-sidebar-submenu {
  border-color: rgba(255, 255, 255, 0.12);
}

body.has-student-sidebar .student-sidebar-submenu a {
  color: rgba(224, 235, 248, 0.72);
}

body.has-student-sidebar .student-sidebar-submenu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

body.has-student-sidebar .student-sidebar-footer {
  min-height: 84px;
  margin: 8px 12px 14px;
  border: 1px solid rgba(150, 182, 222, 0.17);
  border-radius: 14px;
  padding: 11px 12px;
  background: linear-gradient(145deg, rgba(51, 101, 159, 0.28), rgba(20, 59, 107, 0.3));
}

body.has-student-sidebar .student-sidebar-avatar {
  width: 39px;
  height: 39px;
  border: 2px solid rgba(230, 189, 83, 0.65);
  background: #f0f3f7;
  color: #0b315e;
  font-size: 0.72rem;
}

body.has-student-sidebar .student-sidebar-user strong {
  color: #f5f8fd;
  font-size: 0.69rem;
}

body.has-student-sidebar .student-sidebar-user small {
  color: rgba(211, 224, 241, 0.58);
  font-size: 0.54rem;
}

body.has-student-sidebar .student-sidebar-footer button {
  color: rgba(220, 232, 247, 0.65);
}

body.has-student-sidebar .student-sidebar-footer button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1ca62;
}

/* -------------------------------------------------------------------------- *
 * 3. Quiet authenticated footer shared by application pages
 * -------------------------------------------------------------------------- */

body.has-student-sidebar .kinetic-footer {
  width: min(var(--student-app-canvas), calc(100% - 60px)) !important;
  max-width: var(--student-app-canvas) !important;
  min-height: 82px !important;
  margin: 4px auto 24px !important;
  border-radius: 16px;
  overflow: hidden;
}

body.has-student-sidebar .kinetic-footer-shell {
  width: 100% !important;
  min-height: 82px !important;
  grid-template-columns: minmax(280px, 1fr) auto minmax(220px, auto) !important;
  gap: 18px !important;
  padding: 13px 20px !important;
}

body.has-student-sidebar .kinetic-footer-scene {
  display: none !important;
}

body.has-student-sidebar .kinetic-footer-copy {
  align-self: center;
}

body.has-student-sidebar .kinetic-footer-copy .kinetic-footer-kicker,
body.has-student-sidebar .kinetic-footer-copy p {
  display: none !important;
}

body.has-student-sidebar .kinetic-footer-copy strong {
  font-size: 0.68rem !important;
  line-height: 1.7;
}

body.has-student-sidebar .kinetic-footer-trust {
  align-self: center;
  gap: 7px;
}

body.has-student-sidebar .kinetic-footer-trust-label {
  font-size: 0.52rem;
}

body.has-student-sidebar .kinetic-footer-trust .enamad-seal-image {
  width: auto;
  max-width: 44px;
  height: 44px;
}

body.has-student-sidebar .kinetic-footer-meta {
  align-self: center;
  gap: 3px;
  font-size: 0.52rem;
}

/* -------------------------------------------------------------------------- *
 * 4. Revenue-facing title preservation and common control behavior
 * -------------------------------------------------------------------------- */

body.has-student-sidebar .compact-catalog-card h3,
body.has-student-sidebar .course-tile h2,
body.has-student-sidebar .course-tile-body h2,
body.has-student-sidebar .commerce-dashboard-bundle-card h3,
body.has-student-sidebar .next-path-card h2,
body.has-student-sidebar .featured-learning-card h3,
body.has-student-sidebar .compact-learning-card h3,
body.has-student-sidebar .scientific-support-ticket-course,
body.has-student-sidebar .payment-product-title {
  overflow: visible !important;
  max-width: none !important;
  text-overflow: clip !important;
  white-space: normal !important;
  -webkit-line-clamp: unset !important;
  line-clamp: unset !important;
  overflow-wrap: anywhere;
}

body.has-student-sidebar input,
body.has-student-sidebar select,
body.has-student-sidebar textarea,
body.has-student-sidebar button {
  border-radius: var(--student-app-control-radius);
}

/* -------------------------------------------------------------------------- *
 * 5. Tablet and mobile shell behavior
 * -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  body.has-student-sidebar,
  body.sidebar-is-collapsed {
    --student-sidebar-width: min(86vw, 310px) !important;
    padding-right: 0 !important;
  }

  body.has-student-sidebar > .container {
    width: min(100% - 24px, 860px) !important;
    margin: 14px auto 28px !important;
  }

  body.has-student-sidebar .topbar-authenticated {
    display: flex !important;
    height: 58px;
    border-bottom: 1px solid #e5eaf0;
    background: rgba(255, 255, 255, 0.95);
  }

  body.has-student-sidebar .student-sidebar,
  body.sidebar-is-collapsed .student-sidebar {
    width: min(86vw, 310px) !important;
    background:
      radial-gradient(circle at 50% 0, rgba(28, 91, 159, 0.2), transparent 32%),
      linear-gradient(180deg, #082b58, #071f42) !important;
  }

  body.has-student-sidebar .student-sidebar-header {
    min-height: 100px !important;
    justify-content: space-between !important;
  }

  body.has-student-sidebar .student-sidebar-brand {
    flex-direction: row;
    text-align: right;
  }

  body.has-student-sidebar .student-sidebar-mark,
  body.has-student-sidebar .student-sidebar-mark img {
    width: 48px;
    height: 48px;
  }

  body.has-student-sidebar .student-sidebar-close {
    display: grid !important;
    background: rgba(255, 255, 255, 0.08);
    color: #e4edf9;
  }

  body.has-student-sidebar .kinetic-footer {
    width: min(100% - 24px, 860px) !important;
  }

  body.has-student-sidebar .kinetic-footer-shell {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  body.has-student-sidebar .kinetic-footer-trust {
    display: none;
  }
}

@media (max-width: 640px) {
  body.has-student-sidebar > .container {
    width: calc(100% - 20px) !important;
    margin: 10px auto 20px !important;
  }

  .student-page-header {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 14px;
    padding: 17px 16px;
  }

  .student-page-header h1 {
    font-size: 1.42rem;
  }

  .student-page-header p {
    font-size: 0.72rem;
  }

  .student-page-header-actions,
  .student-segmented-control {
    width: 100%;
  }

  .student-segmented-control a,
  .student-segmented-control button {
    flex: 1 1 0;
    padding-inline: 8px;
  }

  .student-empty-panel {
    min-height: 210px;
    padding: 22px 16px;
  }

  .student-empty-actions,
  .student-empty-actions .student-app-button {
    width: 100%;
  }

  body.has-student-sidebar .kinetic-footer {
    width: calc(100% - 20px) !important;
    margin-bottom: 16px !important;
  }

  body.has-student-sidebar .kinetic-footer-shell {
    min-height: 72px !important;
    grid-template-columns: 1fr !important;
    padding: 12px 14px !important;
    text-align: center;
  }

  body.has-student-sidebar .kinetic-footer-copy,
  body.has-student-sidebar .kinetic-footer-meta {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.has-student-sidebar,
  body.has-student-sidebar .student-sidebar,
  body.has-student-sidebar .student-sidebar-link,
  .student-app-button,
  .student-segmented-control a,
  .student-segmented-control button {
    transition: none !important;
  }
}

/* ============================= End of student_app_shell.css ============================= */