/* Major Details Page Styles - Modern Professional Design */

/* Local CSS variables.
   `--jinan-teal`, `--jinan-gold`, `--jinan-charcoal` and `--white` are
   already defined globally by theme-variables.css. Re-declaring them as
   `--jinan-teal: var(--jinan-teal)` here created a circular reference
   that resolved to the initial value (empty) on this file's :root, and
   that "shadow" then propagated to descendants — killing the
   .major-hero linear-gradient (which depends on var(--jinan-teal) +
   var(--jinan-teal-dark)) and leaving the hero unstyled. Only declare
   variables that don't already exist at the global level. */
:root {
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;
  --text-dark: var(--jinan-charcoal);
  --text-light: #6c757d;
  --border-light: #dee2e6;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* Major Details Page Container */
.major-details-page {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", sans-serif;
  background-color: var(--light-gray);
  min-height: 100vh;
}

/* ===============================================================
   EDITORIAL HERO
   Deep teal field. Subtle 8-point star tile pattern + a large
   floating ornament on the right. Left-aligned composition with a
   gold eyebrow, serif title, optional Arabic alt-title, gold rule,
   and a definition-list meta strip. Designed to read like a
   catalog frontispiece rather than a generic page banner.
   =============================================================== */
.major-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-bottom: 56px;
  /* Radial dark-edge backdrop so the title reads without a shadow.
     Centre is the brand teal; edges fade to a deeper teal so the
     hero has visual weight at the corners. */
  background:
    radial-gradient(ellipse at center,
      var(--jinan-teal) 0%,
      var(--jinan-teal-dark) 70%,
      #002822 100%);
  color: var(--white);
  /* Generous vertical air — this is a frontispiece. */
  padding: clamp(56px, 8vw, 96px) 0 clamp(64px, 8.5vw, 104px);
}

/* Repeating 8-point star tile. Pure SVG, ~5% opacity so it reads as
   texture, never as imagery. Sized smaller than the hero so the
   pattern repeats clean. */
.major-hero-tile {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'><g fill='none' stroke='%23f7b243' stroke-width='0.6'><rect x='30' y='30' width='60' height='60'/><rect x='30' y='30' width='60' height='60' transform='rotate(45 60 60)'/><circle cx='60' cy='60' r='30'/></g></svg>");
  background-size: 120px 120px;
  background-position: center;
}

/* The big ornament bleeds in from the right. Same geometry as the
   preloader corner stars so the brand language stays consistent. */
.major-hero-ornament {
  position: absolute;
  top: 50%;
  right: -120px;
  transform: translateY(-50%) rotate(8deg);
  width: 520px;
  height: 520px;
  z-index: 0;
  pointer-events: none;
  color: var(--jinan-gold);
  opacity: 0.18;
}

/* RTL: mirror the floating ornament to the left edge. */
.major-details-page.is-rtl .major-hero-ornament {
  right: auto;
  left: -120px;
  transform: translateY(-50%) rotate(-8deg);
}

/* Bottom seam — a single hairline of gold so the hero edge reads
   intentional, not abrupt. */
.major-hero-seam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(247, 178, 67, 0.45) 25%,
    var(--jinan-gold) 50%,
    rgba(247, 178, 67, 0.45) 75%,
    transparent 100%);
  z-index: 1;
}

/* Grid: single editorial column on the left. Constrained max-width
   so very long titles don't span the full hero — keeps the rag
   tidy and leaves the ornament breathing room. */
.major-hero-grid {
  position: relative;
  z-index: 2;
}
.major-hero-content {
  max-width: 760px;
}

/* Eyebrow — small caps, gold, tracked out. Sets the catalog tone. */
.major-hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  font-family: "Inter", "Lato", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--jinan-gold);
  opacity: 0;
  animation: majorHeroRise 0.9s 0.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.major-hero-eyebrow__item {
  white-space: nowrap;
}
.major-hero-eyebrow__sep {
  color: rgba(247, 178, 67, 0.55);
  font-weight: 700;
}

/* Title — editorial serif. Use clamp() so it scales gracefully on
   mobile. Letter-spacing slightly tightened for display sizes. */
.major-hero-title {
  font-family: "Merriweather", "Zalando Sans Expanded", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  color: var(--white);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
  opacity: 0;
  animation: majorHeroRise 0.9s 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* RTL primary title gets a typeface tuned for Arabic. */
.major-hero-title[lang="ar"] {
  font-family: "RH Zak", "Tajawal", "Cairo", "Merriweather", serif;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
}

/* Bilingual echo — secondary title, smaller, gold-tinted. Sits
   directly under the primary title to anchor the bilingual identity
   without competing for the lead. */
.major-hero-title-alt {
  font-family: "RH Zak", "Tajawal", "Cairo", "Merriweather", serif;
  font-weight: 400;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  letter-spacing: 0;
  line-height: 1.35;
  margin: 0 0 1.25rem;
  color: rgba(247, 178, 67, 0.92);
  opacity: 0;
  animation: majorHeroRise 0.9s 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
/* When secondary is English (page is AR) swap to Latin serif. */
.major-hero-title-alt[lang="en"] {
  font-family: "Merriweather", "Zalando Sans Expanded", Georgia, serif;
  font-weight: 400;
  letter-spacing: 0.005em;
}

/* Gold rule below the title block — short, treated like a
   typographic mark. */
.major-hero-rule {
  display: block;
  width: 72px;
  height: 3px;
  margin: 0.5rem 0 1.75rem;
  background: linear-gradient(90deg,
    var(--jinan-gold) 0%,
    rgba(247, 178, 67, 0.4) 100%);
  border-radius: 2px;
  transform-origin: left center;
  transform: scaleX(0);
  animation: majorHeroRule 0.7s 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.major-details-page.is-rtl .major-hero-rule {
  transform-origin: right center;
  background: linear-gradient(270deg,
    var(--jinan-gold) 0%,
    rgba(247, 178, 67, 0.4) 100%);
}

/* Meta strip — definition-list semantics, visual three-column grid
   on desktop with thin gold dividers, stacked on mobile. */
.major-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: majorHeroRise 0.9s 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.major-hero-meta__cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.1rem 1.6rem 0.1rem 0;
  min-width: 0;
}
.major-details-page.is-rtl .major-hero-meta__cell {
  padding: 0.1rem 0 0.1rem 1.6rem;
}
.major-hero-meta__cell:last-child {
  padding-inline-end: 0;
}
.major-hero-meta__cell dt {
  font-family: "Inter", "Lato", sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--jinan-gold);
  margin: 0;
}
.major-hero-meta__cell dd {
  font-family: "Merriweather", "Zalando Sans Expanded", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--white);
  margin: 0;
}

/* The credits number gets the loudest treatment — large, slightly
   condensed, the "headline numeral" of the page. */
.major-hero-meta__num {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Course code rendered like a catalog reference. */
.major-hero-meta__code {
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, "Courier New", monospace !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(247, 178, 67, 0.12);
  border: 1px solid rgba(247, 178, 67, 0.35);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  align-self: flex-start;
  color: var(--jinan-gold) !important;
}

/* Thin vertical gold divider between meta cells. Hidden on mobile
   where cells stack. */
.major-hero-meta__divider {
  align-self: stretch;
  width: 1px;
  margin: 0.1rem 1.6rem;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(247, 178, 67, 0.5) 25%,
    rgba(247, 178, 67, 0.5) 75%,
    transparent 100%);
}

@keyframes majorHeroRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes majorHeroRule {
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .major-hero-eyebrow,
  .major-hero-title,
  .major-hero-title-alt,
  .major-hero-meta {
    opacity: 1;
    animation: none;
  }
  .major-hero-rule { transform: scaleX(1); animation: none; }
}

/* Mobile: tighten everything, stack the meta strip, drop the
   floating ornament so it doesn't crowd the title. */
@media (max-width: 768px) {
  .major-hero { margin-bottom: 36px; }
  .major-hero-ornament { display: none; }
  .major-hero-meta { flex-direction: column; gap: 1rem; }
  .major-hero-meta__divider { display: none; }
  .major-hero-meta__cell {
    padding: 0 !important;
    flex-direction: row;
    align-items: baseline;
    gap: 0.85rem;
  }
  .major-hero-meta__cell dt { min-width: 6rem; }
  .major-hero-meta__num { font-size: 1.25rem; }
}

/* Legacy class shells — kept so any other view that still uses
   .hero-content / .major-title / .degree-info doesn't break. */
.hero-content { position: relative; z-index: 2; }
.major-title  { color: var(--white); }
.degree-info  { display: flex; gap: 16px; flex-wrap: wrap; }
.degree-type, .credits-info {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Content Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.col-lg-8 {
  flex: 1;
  min-width: 0;
}

.col-lg-4 {
  width: 350px;
  flex-shrink: 0;
}

/* Documents Section */
.documents-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--jinan-gold);
}

/* Suppress the centered 40px + 80px gold dashes that jinan-master.css
   adds via .section-title::before/::after. On the major page we
   already have the full-width gold border-bottom — stacking all three
   read as a "two-dash glitch" under one title. Scoped to .major-
   details-page so home/other pages keep their centered dash style. */
.major-details-page .section-title::before,
.major-details-page .section-title::after {
  content: none;
}

.section-title i {
  color: var(--jinan-teal);
  font-size: 1.3rem;
}

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.document-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--light-gray);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: var(--text-dark);
  transition: var(--transition);
  border: 2px solid transparent;
}

.document-card:hover {
  background: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--jinan-teal);
  text-decoration: none;
  color: var(--text-dark);
}

.doc-icon {
  font-size: 2.5rem;
  color: var(--jinan-teal);
  flex-shrink: 0;
}

.doc-info h4 {
  margin: 0 0 5px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.doc-type {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 500;
}

/* Curriculum Section */
.curriculum-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

/* Levels Accordion */
.levels-accordion {
  margin-top: 20px;
}

.level-card {
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.level-header {
  background: linear-gradient(135deg, var(--jinan-teal) 0%, var(--jinan-teal-dark) 100%);
  color: var(--white);
}

.level-title {
  margin: 0;
  padding: 20px 25px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 600;
  transition: var(--transition);
  user-select: none;
  color: var(--white);
}

.level-title:hover {
  background: rgba(255, 255, 255, 0.1);
}

.level-name {
  flex: 1;
}

.collapse-icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.level-body {
  padding: 25px;
  background: var(--white);
}

/* Courses Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--light-gray);
  border-radius: var(--border-radius);
  padding: 20px;
  transition: var(--transition);
  border: 2px solid transparent;
}

.course-card:hover {
  background: var(--white);
  border-color: var(--jinan-gold);
  box-shadow: var(--shadow);
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.course-code {
  font-weight: 600;
  font-size: 1rem;
}

.course-link {
  color: var(--jinan-teal);
  text-decoration: none;
  transition: var(--transition);
}

.course-link:hover {
  color: var(--jinan-gold-dark);
  text-decoration: underline;
}

.course-code-text {
  color: var(--text-dark);
}

.course-credits {
  background: var(--jinan-gold);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.85rem;
  font-weight: 500;
}

.course-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  line-height: 1.3;
}

.course-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-light);
}

.course-description.unavailable {
  font-style: italic;
  color: var(--dark-gray);
}

/* Sidebar.
   On desktop the white #middleNav becomes a fixed 80px sticky bar
   (set in jinan-master.css). Without offsetting `top` to account for
   it, the sticky sidebar scrolls behind the nav and visually clips.
   Add the nav height + a breathing gap. On mobile the nav stops
   being sticky in the same way, so a smaller offset is fine. */
.sidebar {
  position: sticky;
  top: 1rem;
}
@media (min-width: 992px) {
  .sidebar {
    /* 80px sticky middleNav + 1.5rem clearance. */
    top: calc(80px + 1.5rem);
  }
}

/* Major page specific styles for info display */
.info-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--medium-gray);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: var(--text-dark);
}

.info-value {
  color: var(--text-light);
  text-align: end;
  max-width: 60%;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background: var(--light-gray);
  color: var(--text-dark);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-weight: 500;
}

.action-link:hover {
  background: var(--jinan-teal);
  color: var(--white);
  text-decoration: none;
  transform: translateX(5px);
}

.action-link i {
  color: var(--jinan-gold-dark);
  font-size: 1.1rem;
}

.action-link:hover i {
  color: var(--white);
}

/* No Content State */
.no-content {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.no-content-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text-dark);
}

.no-content p {
  font-size: 1rem;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
  .row {
    flex-direction: column;
  }

  .col-lg-4 {
    width: 100%;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .major-hero {
    padding: 40px 0;
  }

  .major-title {
    font-size: 2rem;
  }

  .degree-info {
    gap: 15px;
  }

  .documents-section,
  .curriculum-section {
    padding: 20px;
    margin-bottom: 20px;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .documents-grid {
    grid-template-columns: 1fr;
  }

  .course-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .info-value {
    text-align: start;
    max-width: 100%;
  }
}

@media (max-width: 576px) {
  .container {
    padding: 0 15px;
  }

  .major-title {
    font-size: 1.75rem;
  }

  .major-icon {
    font-size: 3rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .level-title {
    padding: 15px 20px;
    font-size: 1.1rem;
  }

  .level-body {
    padding: 20px 15px;
  }

  .course-card {
    padding: 15px;
  }

  .info-card {
    padding: 20px 15px;
  }
}
