/* =========================================================
   MUWAJEH — MAJORS PAGE
   General majors directory
   ========================================================= */

:root {
  --color-primary: #0a1d38;
  --color-secondary: #c29447;
  --color-tertiary: #1e304c;
  --color-neutral: #f8fafc;

  --color-white: #ffffff;
  --color-text: #44474d;
  --color-text-muted: #7486a6;

  --color-border: rgba(10, 29, 56, 0.1);
  --color-gold-border: rgba(194, 148, 71, 0.3);

  --font-headline: "Tajawal", sans-serif;
  --font-body: "Cairo", sans-serif;

  --shadow-sm: 0 10px 30px rgba(10, 29, 56, 0.04);
  --shadow-card: 0 8px 24px rgba(10, 29, 56, 0.05);

  --radius: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;

  direction: rtl;
  text-align: right;

  background: var(--color-neutral);
  color: var(--color-text);

  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

/* =========================================================
   HEADER — SAME AS YOUR UNIVERSITY PAGE
   ========================================================= */

.top-navigation {
  box-sizing: border-box;

  position: absolute;

  top: 24px;
  left: 50%;

  transform: translateX(-50%);

  width: calc(100% - 48px);
  max-width: 1280px;

  height: 64px;

  padding: 0 24px;

  display: flex;
  flex-direction: row;

  align-items: center;
  justify-content: space-between;

  gap: 24px;

  background: rgba(247, 249, 251, 0.8);

  border: 1px solid rgba(255, 255, 255, 0.2);

  box-shadow: 0px 10px 30px rgba(10, 29, 56, 0.04);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-radius: 9999px;

  z-index: 5;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo img {
  display: block;

  width: auto;
  height: 48px;

  object-fit: contain;
}

.navigation-links {
  display: flex;

  align-items: center;
  justify-content: center;

  gap: 38px;

  height: 100%;

  margin-right: auto;
  margin-left: auto;
}

.nav-link {
  position: relative;

  display: flex;
  align-items: center;

  height: 100%;

  color: #4b4f55;

  font-family: var(--font-body);

  font-size: 18px;
  font-weight: 500;

  white-space: nowrap;

  text-decoration: none;

  transition: color 180ms ease;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link.active {
  color: var(--color-secondary);
  font-weight: 700;
}

.nav-link.active::after {
  content: "";

  position: absolute;

  bottom: 7px;

  right: 50%;

  transform: translateX(50%);

  width: 5px;
  height: 5px;

  background: var(--color-secondary);

  border-radius: 50%;
}

.login-button {
  display: flex;

  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  height: 48px;

  padding: 0 30px;

  background: var(--color-secondary);

  color: #ffffff;

  border-radius: 9999px;

  font-family: var(--font-body);

  font-size: 18px;
  font-weight: 500;

  text-decoration: none;

  white-space: nowrap;

  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.login-button:hover {
  background: #b1843d;
  transform: translateY(-1px);
}

/* =========================================================
   MAIN
   ========================================================= */

.main-content {
  width: 100%;
  min-height: 100vh;

  padding-top: 120px;
  padding-bottom: 40px;
}

/* =========================================================
   PAGE HEADING
   ========================================================= */

.page-heading {
  width: min(1184px, calc(100% - 48px));

  margin: 0 auto;

  display: flex;
  flex-direction: column;

  align-items: center;

  gap: 20px;

  text-align: center;
}

.breadcrumb {
  min-height: 34px;

  padding: 8px 16px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  gap: 8px;

  background: rgba(255, 255, 255, 0.5);

  border: 1px solid var(--color-border);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-radius: 9999px;

  color: var(--color-primary);

  font-size: 12px;
  font-weight: 500;
}

.breadcrumb .current {
  color: var(--color-secondary);
  font-weight: 700;
}

.breadcrumb i {
  color: var(--color-text-muted);
  font-size: 8px;
}

.page-heading h1 {
  width: 100%;

  margin: 0;

  color: var(--color-primary);

  font-family: var(--font-headline);

  font-size: clamp(34px, 4vw, 48px);

  line-height: 1.25;

  font-weight: 700;

  text-align: center;
}

.page-heading p {
  width: min(760px, 100%);

  margin: 0;

  color: var(--color-text);

  font-size: 18px;

  line-height: 30px;

  text-align: center;
}

/* =========================================================
   SEARCH
   ========================================================= */

.search-section {
  width: min(1184px, calc(100% - 48px));

  margin: 28px auto 0;

  display: flex;
  flex-direction: column;

  align-items: center;

  gap: 12px;
}

.search-box {
  width: min(768px, 100%);
  height: 66px;

  padding: 8px;

  display: flex;
  align-items: center;

  gap: 8px;

  direction: ltr;

  background: rgba(255, 255, 255, 0.65);

  border: 1px solid var(--color-border);

  border-radius: 50px;

  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-button {
  width: 48px;
  height: 48px;

  flex: 0 0 48px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 50%;

  background: var(--color-primary);
  color: var(--color-white);

  cursor: pointer;
}

.search-input-wrapper {
  flex: 1;

  height: 40px;

  display: flex;
  flex-direction: row-reverse;

  align-items: center;

  gap: 10px;

  padding: 5px 8px;

  direction: rtl;
}

.search-input-wrapper i {
  color: var(--color-primary);
  font-size: 16px;
}

.search-input-wrapper input {
  width: 100%;
  height: 30px;

  border: 0;
  outline: 0;

  background: transparent;

  color: var(--color-primary);

  font-size: 16px;

  text-align: right;
}

.search-input-wrapper input::placeholder {
  color: var(--color-text-muted);
}

/* =========================================================
   FILTERS
   ========================================================= */

.filter-row {
  display: flex;

  align-items: center;
  justify-content: center;

  flex-wrap: wrap;

  gap: 10px;

  direction: rtl;
}

.filter-button {
  min-height: 36px;

  padding: 6px 18px;

  border: 1px solid var(--color-border);

  border-radius: 9999px;

  background: #ffffff;

  color: var(--color-primary);

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.filter-button:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.filter-button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

.filter-button:active {
  transform: scale(0.98);
}

.search-hint {
  width: min(768px, 100%);

  margin: 0;

  color: var(--color-text-muted);

  font-size: 12px;

  text-align: right;
}

/* =========================================================
   MAJORS SECTION
   ========================================================= */

.majors-section {
  width: min(1184px, calc(100% - 48px));

  margin: 42px auto 0;
}

.section-heading {
  width: 100%;

  margin-bottom: 24px;

  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 20px;

  direction: rtl;
}

.section-heading-title {
  display: flex;

  align-items: center;

  gap: 12px;
}

.section-heading-title i {
  color: var(--color-secondary);

  font-size: 22px;
}

.section-heading h2 {
  margin: 0;

  color: var(--color-primary);

  font-family: var(--font-headline);

  font-size: 32px;

  line-height: 42px;

  font-weight: 700;
}

.results-count {
  padding: 6px 16px;

  background: var(--color-secondary);

  color: #ffffff;

  border-radius: 9999px;

  font-size: 12px;

  font-weight: 600;

  white-space: nowrap;
}

/* =========================================================
   GENERAL MAJOR GRID
   ========================================================= */

.majors-grid {
  width: 100%;

  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));

  gap: 24px;

  direction: rtl;
}

/* =========================================================
   MAJOR CARD
   ========================================================= */

.major-card {
  position: relative;

  min-height: 245px;

  padding: 24px;

  display: flex;
  flex-direction: column;

  justify-content: flex-start;

  background: #ffffff;

  border: 1px solid var(--color-gold-border);

  border-radius: var(--radius);

  box-shadow: var(--shadow-card);

  overflow: hidden;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.major-card:hover {
  transform: translateY(-4px);

  border-color: rgba(194, 148, 71, 0.55);

  box-shadow: 0 16px 32px rgba(10, 29, 56, 0.09);
}

.major-card[hidden] {
  display: none;
}

/* Favorite */

.favorite-button {
  position: absolute;

  top: 20px;
  right: 20px;

  width: 28px;
  height: 28px;

  padding: 0;

  display: grid;
  place-items: center;

  border: 0;

  background: transparent;

  color: var(--color-secondary);

  font-size: 18px;

  cursor: pointer;
}

.favorite-button:hover {
  transform: scale(1.1);
}

.favorite-button.selected {
  color: var(--color-secondary);
}

/* Card content */

.major-card-content {
  width: 100%;

  display: flex;
  flex-direction: column;

  align-items: flex-end;

  gap: 11px;

  direction: rtl;

  text-align: right;
}

.major-type {
  align-self: flex-start;

  max-width: calc(100% - 45px);

  margin-bottom: 18px;

  padding: 5px 13px;

  background: var(--color-primary);

  color: #ffffff;

  border-radius: 9999px;

  font-size: 11px;

  line-height: 17px;

  font-weight: 600;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.major-card h3 {
  width: 100%;

  margin: 0;

  color: var(--color-primary);

  font-family: var(--font-headline);

  font-size: 24px;

  line-height: 32px;

  font-weight: 700;

  text-align: right;
}

/* University */

.major-university {
  width: 100%;

  display: flex;

  align-items: center;

  justify-content: flex-start;

  gap: 8px;

  color: var(--color-secondary);

  font-size: 13px;

  font-weight: 600;
}

.major-university i {
  font-size: 13px;
}

.major-faculty {
  color: var(--color-text-muted);

  font-size: 12px;

  line-height: 18px;
}

.details-link {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  margin-top: 3px;

  color: var(--color-secondary);

  font-size: 14px;

  line-height: 20px;

  font-weight: 600;
}

.details-link:hover {
  color: var(--color-primary);
}

/* =========================================================
   NO RESULTS
   ========================================================= */

.no-results {
  min-height: 240px;

  padding: 40px;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  text-align: center;

  background: #ffffff;

  border: 1px dashed rgba(10, 29, 56, 0.18);

  border-radius: var(--radius);
}

.no-results[hidden] {
  display: none;
}

.no-results > i {
  color: var(--color-secondary);
  font-size: 30px;
}

.no-results h3 {
  margin: 14px 0 5px;

  color: var(--color-primary);

  font-family: var(--font-headline);

  font-size: 22px;
}

.no-results p {
  margin: 0;

  color: var(--color-text-muted);

  font-size: 13px;
}

/* =========================================================
   FOOTER — LIGHT VERSION
   ========================================================= */

.site-footer {
  position: relative;

  margin-top: 80px;

  background: #f8fafc;

  color: var(--color-primary);

  border-top: 1px solid #e4e8ed;
  border-radius: 32px 32px 0 0;

  overflow: hidden;
}

/* =========================================================
   SUBTLE DECORATION
   ========================================================= */

.site-footer::before {
  content: "";

  position: absolute;

  top: -120px;
  left: 50%;

  width: 320px;
  height: 320px;

  transform: translateX(-50%);

  background: rgba(194, 148, 71, 0.06);

  border-radius: 50%;

  pointer-events: none;
}

/* =========================================================
   FOOTER CONTAINER
   ========================================================= */

.footer-container {
  position: relative;

  z-index: 1;

  width: calc(100% - 48px);
  max-width: 1184px;

  margin: 0 auto;

  padding: 60px 0 48px;

  display: grid;

  grid-template-columns: 2fr 1fr 1.3fr 1.3fr;

  gap: 60px;

  direction: rtl;
}

/* =========================================================
   BRAND
   ========================================================= */

.footer-brand {
  max-width: 330px;
}

.footer-logo {
  display: inline-flex;

  align-items: center;
}

.footer-logo img {
  width: auto;
  height: 58px;

  object-fit: contain;
}

.footer-description {
  margin: 20px 0 0;

  color: #68717c;

  font-family: var(--font-body);

  font-size: 13px;

  line-height: 2;

  text-align: right;
}

/* =========================================================
   FOOTER COLUMNS
   ========================================================= */

.footer-column {
  display: flex;

  flex-direction: column;

  align-items: flex-start;
}

.footer-title {
  position: relative;

  margin: 0 0 22px;

  color: var(--color-primary);

  font-family: var(--font-headline);

  font-size: 18px;

  font-weight: 700;

  line-height: 1.4;
}

/* Gold line */

.footer-title::after {
  content: "";

  display: block;

  width: 28px;
  height: 3px;

  margin-top: 9px;

  background: var(--color-secondary);

  border-radius: 999px;
}

/* =========================================================
   FOOTER LINKS
   ========================================================= */

.footer-link {
  margin-bottom: 11px;

  color: #68717c;

  font-family: var(--font-body);

  font-size: 13px;

  line-height: 1.7;

  text-decoration: none;

  transition:
    color 180ms ease,
    transform 180ms ease;
}

.footer-link:hover {
  color: var(--color-secondary);

  transform: translateX(-3px);
}

/* =========================================================
   CONTACT
   ========================================================= */

.footer-contact-item {
  display: flex;

  align-items: center;

  gap: 10px;

  margin-bottom: 14px;

  color: #68717c;

  font-family: var(--font-body);

  font-size: 12px;

  text-decoration: none;

  transition: color 180ms ease;
}

.footer-contact-item:hover {
  color: var(--color-primary);
}

/* Contact icon */

.footer-icon {
  width: 30px;
  height: 30px;

  display: flex;

  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  background: rgba(194, 148, 71, 0.12);

  color: var(--color-secondary);

  border: 1px solid rgba(194, 148, 71, 0.15);

  border-radius: 50%;

  font-size: 12px;
}

/* =========================================================
   SOCIAL MEDIA
   ========================================================= */

.footer-socials {
  display: flex;

  align-items: center;

  gap: 9px;

  margin-top: 10px;
}

.footer-socials a {
  width: 34px;
  height: 34px;

  display: flex;

  align-items: center;
  justify-content: center;

  background: #ffffff;

  color: var(--color-primary);

  border: 1px solid #dde2e8;

  border-radius: 50%;

  font-size: 13px;

  text-decoration: none;

  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.footer-socials a:hover {
  background: var(--color-secondary);

  color: #ffffff;

  border-color: var(--color-secondary);

  transform: translateY(-2px);
}

/* =========================================================
   FOOTER BOTTOM
   ========================================================= */

.footer-bottom {
  position: relative;

  z-index: 1;

  border-top: 1px solid #e1e5ea;
}

.footer-bottom-container {
  width: calc(100% - 48px);
  max-width: 1184px;

  min-height: 64px;

  margin: 0 auto;

  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 20px;

  direction: rtl;
}

.footer-bottom p {
  margin: 0;

  color: #8a929d;

  font-family: var(--font-body);

  font-size: 11px;
}

.footer-bottom-links {
  display: flex;

  align-items: center;

  gap: 10px;

  color: #8a929d;

  font-family: var(--font-body);

  font-size: 11px;
}

.footer-bottom-links a {
  color: inherit;

  text-decoration: none;

  transition: color 180ms ease;
}

.footer-bottom-links a:hover {
  color: var(--color-secondary);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1.5fr 1fr 1fr;

    gap: 40px;
  }

  .footer-brand {
    grid-column: 1 / -1;

    max-width: 500px;
  }
}

@media (max-width: 600px) {
  .site-footer {
    margin-top: 60px;

    border-radius: 24px 24px 0 0;
  }

  .footer-container {
    width: calc(100% - 32px);

    grid-template-columns: 1fr 1fr;

    gap: 40px 24px;

    padding: 45px 0 35px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-description {
    font-size: 12px;
  }

  .footer-title {
    font-size: 16px;
  }

  .footer-link {
    font-size: 12px;
  }

  .footer-bottom-container {
    width: calc(100% - 32px);

    min-height: auto;

    padding: 20px 0;

    flex-direction: column;

    justify-content: center;

    text-align: center;
  }
}

.auth-header-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #0a1d38;
  color: #c29447;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: 0.2s ease;
}

.profile-button:hover {
  background: #c29447;
  color: #0a1d38;
  transform: translateY(-2px);
}

.login-button[hidden],
.profile-button[hidden] {
  display: none !important;
}

/* =========================
   ACCOUNT POPUP
   ========================= */

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  padding-top: 95px;

}

.account-overlay[hidden] {
  display: none !important;
}

.account-popup {
  position: relative;

  width: 360px;
  max-width: calc(100% - 30px);

  padding: 30px;

  background: #ffffff;
  border-radius: 20px;

  box-shadow: 0 15px 45px rgba(10, 29, 56, 0.2);

  text-align: center;

  animation: accountPopupIn 0.2s ease;
}

@keyframes accountPopupIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.account-close {
  position: absolute;
  top: 12px;
  left: 12px;

  width: 32px;
  height: 32px;

  border: none;
  border-radius: 50%;

  background: #f1f3f5;
  color: #555;

  font-size: 22px;
  line-height: 1;

  cursor: pointer;
}

.account-close:hover {
  background: #e5e7eb;
}

.account-avatar {
  width: 64px;
  height: 64px;

  margin: 0 auto 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  background: #0a1d38;
  color: #c29447;

  font-size: 24px;
}

.account-popup h2 {
  margin: 0 0 24px;

  color: #0a1d38;

  font-family: "Tajawal", sans-serif;
  font-size: 25px;
}

.account-info {
  margin-bottom: 22px;

  border: 1px solid #e1e5ea;
  border-radius: 12px;

  overflow: hidden;
}

.account-info-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;

  gap: 3px;

  padding: 13px 15px;

  text-align: right;
}

.account-info-row + .account-info-row {
  border-top: 1px solid #e1e5ea;
}

.account-info-row span {
  color: #6b7280;
  font-size: 11px;
}

.account-info-row strong {
  width: 100%;

  color: #0a1d38;

  font-size: 14px;

  overflow-wrap: anywhere;
}

.logout-button {
  width: 100%;
  height: 46px;

  border: none;
  border-radius: 999px;

  background: #0a1d38;
  color: #ffffff;

  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  transition: 0.2s ease;
}

.logout-button:hover {
  background: #c29447;
  color: #0a1d38;
}


/* =========================================================
   DYNAMIC MAJORS PAGE — FINAL OVERRIDES
   ========================================================= */

.search-section {
  width: min(1184px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.search-box {
  width: min(768px, 100%);
  height: 66px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.search-button {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  order: 1;
  border: 0;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.search-input-wrapper {
  flex: 1;
  order: 2;
  height: 40px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  direction: rtl;
}

.search-input-wrapper i {
  color: var(--color-primary);
  font-size: 16px;
}

.search-input-wrapper input {
  width: 100%;
  height: 30px;

  border: 0;
  outline: 0;

  background: transparent;

  color: var(--color-primary);

  font-family: var(--font-body);
  font-size: 16px;

  text-align: right;
}

.search-input-wrapper input::placeholder {
  color: var(--color-text-muted);
}


/* Dynamic faculty filters */
.filter-row {
  width: min(100%, 1184px);
}

.filter-button {
  white-space: nowrap;
}

/* The faculty is now the card badge. */
.major-type {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dynamic loading state */
.page-loading {
  min-height: 220px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-primary);
  font-size: 14px;
}

.page-loading i {
  color: var(--color-secondary);
  font-size: 20px;
}

.page-loading[hidden] {
  display: none;
}

/* API error state */
.page-error {
  min-height: 260px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #ffffff;
  border: 1px dashed rgba(10, 29, 56, 0.18);
  border-radius: var(--radius);
}

.page-error[hidden] {
  display: none;
}

.page-error > i {
  color: var(--color-secondary);
  font-size: 30px;
}

.page-error h3 {
  margin: 14px 0 5px;
  color: var(--color-primary);
  font-family: var(--font-headline);
  font-size: 22px;
}

.page-error p {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-size: 13px;
}

.retry-button {
  min-height: 42px;
  padding: 8px 22px;
  border: 0;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 180ms ease;
}

.retry-button:hover {
  background: var(--color-secondary);
}

/* Cards are created by JavaScript, so links/buttons keep
   the same existing visual system. */
.major-card .favorite-button {
  z-index: 2;
}

.details-link {
  cursor: pointer;
}

/* Mobile: keep the two search icons on the left. */
@media (max-width: 600px) {
  .search-box {
    height: 60px;
    padding: 6px;
  }

  .search-button {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .search-input-wrapper {
    height: 40px;
    padding: 5px 6px;
  }

  .search-input-wrapper input {
    font-size: 14px;
  }

  .search-input-wrapper i {
    font-size: 14px;
  }

  .filter-row {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    width: calc(100% + 8px);
    padding: 2px 4px 8px;
    scrollbar-width: thin;
  }
}

/* =========================================================
   FINAL MOBILE HEADER — ALIGNED
   Header only. Uses absolute centering so the hamburger,
   logo and login/profile are ALWAYS on the exact same row.
   ========================================================= */

.mobile-menu-button {
  display: none;
}

@media (max-width: 800px) {

  .top-navigation {
    position: absolute !important;

    top: 14px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;

    width: calc(100% - 28px) !important;
    max-width: none !important;
    height: 58px !important;

    padding: 0 !important;
    margin: 0 !important;

    display: block !important;

    box-sizing: border-box !important;

    z-index: 1000 !important;
  }


  /* =====================================================
     HAMBURGER — RIGHT
     ===================================================== */

  .top-navigation .mobile-menu-button {
    position: absolute !important;

    top: 50% !important;
    right: 12px !important;

    transform: translateY(-50%) !important;

    width: 40px !important;
    height: 40px !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;

    color: #0a1d38 !important;

    font-size: 21px !important;
    line-height: 1 !important;

    cursor: pointer !important;

    z-index: 1003 !important;
  }


  /* =====================================================
     LOGO — EXACT CENTER OF HEADER
     ===================================================== */

  .top-navigation .logo {
    position: absolute !important;

    top: 50% !important;
    left: 50% !important;

    transform: translate(-50%, -50%) !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    z-index: 1002 !important;
  }

  .top-navigation .logo img {
    display: block !important;

    width: auto !important;
    height: 42px !important;
    max-width: 120px !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: contain !important;
  }


  /* =====================================================
     LOGIN / PROFILE — LEFT
     ===================================================== */

  .top-navigation .auth-header-area {
    position: absolute !important;

    top: 50% !important;
    left: 12px !important;

    transform: translateY(-50%) !important;

    width: auto !important;
    height: auto !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    gap: 7px !important;

    z-index: 1003 !important;
  }


  /* Login */

  .top-navigation .login-button {
    width: auto !important;
    height: 38px !important;

    margin: 0 !important;
    padding: 0 14px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    font-size: 13px !important;
    line-height: 1 !important;

    white-space: nowrap !important;
  }


  /* Profile */

  .top-navigation .profile-button {
    width: 38px !important;
    height: 38px !important;

    margin: 0 !important;
    padding: 0 !important;

    flex: 0 0 38px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }


  /* =====================================================
     HIDE DESKTOP NAVIGATION
     ===================================================== */

  .top-navigation .navigation-links {
    display: none !important;
  }


  /* =====================================================
     OPEN MENU — DIRECTLY UNDER HEADER
     ===================================================== */

  .top-navigation.mobile-menu-open .navigation-links {
    position: absolute !important;

    top: 100% !important;
    right: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: auto !important;

    margin: 0 !important;
    padding: 7px !important;

    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;

    gap: 2px !important;

    background: #ffffff !important;

    border: 1px solid rgba(10, 29, 56, 0.08) !important;
    border-top: 0 !important;

    border-radius: 0 0 16px 16px !important;

    box-shadow: 0 14px 32px rgba(10, 29, 56, 0.14) !important;

    z-index: 1001 !important;
  }


  /* =====================================================
     MOBILE NAV LINKS
     ===================================================== */

  .top-navigation.mobile-menu-open
  .navigation-links
  .nav-link {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;

    margin: 0 !important;
    padding: 0 10px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;

    border-radius: 9px !important;

    font-size: 12px !important;
    line-height: 1 !important;

    white-space: nowrap !important;

    color: #4b4f55 !important;
  }

  .top-navigation.mobile-menu-open
  .navigation-links
  .nav-link:hover {
    background: rgba(194, 148, 71, 0.10) !important;
    color: #0a1d38 !important;
  }

  .top-navigation.mobile-menu-open
  .navigation-links
  .nav-link.active {
    background: rgba(194, 148, 71, 0.12) !important;
    color: #c29447 !important;
    font-weight: 700 !important;
  }

  .top-navigation.mobile-menu-open
  .navigation-links
  .nav-link.active::after {
    display: none !important;
  }


  /* =====================================================
     PROFILE POPUP
     ===================================================== */

  .account-overlay {
    padding-top: 82px !important;
  }

  .account-popup {
    width: 340px !important;
    max-width: calc(100% - 24px) !important;
  }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

  .top-navigation {
    top: 11px !important;
    width: calc(100% - 20px) !important;
    height: 54px !important;
  }

  .top-navigation .mobile-menu-button {
    right: 9px !important;

    width: 36px !important;
    height: 36px !important;

    font-size: 19px !important;
  }

  .top-navigation .logo img {
    height: 38px !important;
    max-width: 105px !important;
  }

  .top-navigation .auth-header-area {
    left: 9px !important;
    gap: 5px !important;
  }

  .top-navigation .login-button {
    height: 36px !important;
    padding: 0 11px !important;
    font-size: 11px !important;
  }

  .top-navigation .profile-button {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
  }

  .top-navigation.mobile-menu-open
  .navigation-links
  .nav-link {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 11px !important;
  }
}


/* =========================================================
   MAJORS + MAJOR DETAILS
   SHARED PROFILE + FOOTER COMPONENTS
   ========================================================= */

.site-footer {
  position: relative !important;
  margin-top: 80px !important;
  background: #f8fafc !important;
  color: var(--color-primary, #0a1d38) !important;
  border-top: 1px solid #e4e8ed !important;
  border-radius: 32px 32px 0 0 !important;
  overflow: hidden !important;
}

.site-footer::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  pointer-events: none !important;
}

.footer-container {
  position: relative !important;
  z-index: 1 !important;
  width: calc(100% - 48px) !important;
  max-width: 1184px !important;
  margin: 0 auto !important;
  padding: 60px 0 48px !important;
  display: grid !important;
  grid-template-columns: 2fr 1fr 1.3fr 1.3fr !important;
  gap: 60px !important;
  direction: rtl !important;
}

.footer-bottom-container {
  width: calc(100% - 48px) !important;
  max-width: 1184px !important;
  min-height: 64px !important;
  margin: 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 20px !important;
  direction: rtl !important;
}

.account-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding-top: 95px !important;
}

.account-overlay[hidden] {
  display: none !important;
}

.account-popup {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 360px !important;
  max-width: calc(100% - 30px) !important;
  padding: 30px !important;
  background: #ffffff !important;
  border-radius: 20px !important;
  box-shadow: 0 15px 45px rgba(10, 29, 56, 0.20) !important;
  text-align: center !important;
  animation: accountPopupIn 0.2s ease !important;
}

.account-close {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  width: 32px !important;
  height: 32px !important;
  border: none !important;
  border-radius: 50% !important;
  background: #f1f3f5 !important;
  color: #555 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.account-close:hover {
  background: #e5e7eb !important;
}

.account-avatar {
  width: 64px !important;
  height: 64px !important;
  margin: 0 auto 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background: #0a1d38 !important;
  color: #c29447 !important;
  font-size: 24px !important;
}

.account-popup h2 {
  margin: 0 0 24px !important;
  color: #0a1d38 !important;
  font-family: "Tajawal", sans-serif !important;
  font-size: 25px !important;
}

.account-info {
  margin-bottom: 22px !important;
  border: 1px solid #e1e5ea !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.account-info-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 3px !important;
  padding: 13px 15px !important;
  text-align: right !important;
}

.account-info-row + .account-info-row {
  border-top: 1px solid #e1e5ea !important;
}

.account-info-row span {
  color: #6b7280 !important;
  font-size: 11px !important;
}

.account-info-row strong {
  width: 100% !important;
  color: #0a1d38 !important;
  font-size: 14px !important;
  overflow-wrap: anywhere !important;
}

.logout-button {
  width: 100% !important;
  height: 46px !important;
  margin-top: 0 !important;
  border: none !important;
  border-radius: 999px !important;
  background: #0a1d38 !important;
  color: #ffffff !important;
  font-family: "Cairo", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: 0.2s ease !important;
}

.logout-button:hover {
  background: #c29447 !important;
  color: #0a1d38 !important;
}

/* =========================================================
   FINAL MOBILE CARDS — MAJORS
   One card per row, compact and readable
   ========================================================= */

@media (max-width: 900px) {
  .majors-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .major-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 20px !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 600px) {
  .majors-grid {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .major-card {
    width: 100% !important;
    min-height: 0 !important;
    padding: 16px !important;
    border-radius: 15px !important;
    box-sizing: border-box !important;
  }

  .major-card-content {
    width: 100% !important;
    min-width: 0 !important;
  }

  .major-card h3 {
    font-size: 18px !important;
    line-height: 1.5 !important;
  }

  .major-card p {
    font-size: 11px !important;
    line-height: 1.75 !important;
  }

  .details-link {
    width: 100% !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
    font-size: 10px !important;
  }

  .favorite-button {
    width: 34px !important;
    height: 34px !important;
  }
}


/* =========================================================
   FINAL MOBILE CARDS — MAJOR DETAILS
   ========================================================= */

@media (max-width: 900px) {
  .major-page {
    width: min(100%, calc(100% - 32px)) !important;
  }

  .detail-panel {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .semester-grid,
  .admission-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .admission-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 600px) {
  .major-page {
    width: calc(100% - 20px) !important;
    padding-top: 82px !important;
    padding-bottom: 35px !important;
  }

  .detail-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    scrollbar-width: none !important;
    box-sizing: border-box !important;
  }

  .detail-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .detail-tab {
    flex: 0 0 auto !important;
    min-width: 110px !important;
    padding: 9px 14px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  .detail-panel {
    width: 100% !important;
    padding: 16px 12px !important;
    border-radius: 0 0 15px 15px !important;
  }

  .overview-content {
    padding: 18px 12px 22px !important;
  }

  .overview-content h2 {
    font-size: 20px !important;
    line-height: 1.5 !important;
  }

  .overview-content p {
    font-size: 11px !important;
    line-height: 1.9 !important;
  }

  .year-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    scrollbar-width: none !important;
  }

  .year-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .year-tab {
    flex: 0 0 auto !important;
    min-width: 95px !important;
    font-size: 10px !important;
  }

  .semester-grid,
  .admission-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .semester,
  .admission-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .admission-card {
    min-height: 0 !important;
    padding: 16px !important;
    border-radius: 14px !important;
  }

  .admission-card h3 {
    font-size: 15px !important;
  }

  .fee-label {
    font-size: 10px !important;
  }

  .fee-value {
    font-size: 19px !important;
  }
}


@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1.5fr 1fr 1fr;

    gap: 40px;
  }

  .footer-brand {
    grid-column: 1 / -1;

    max-width: 500px;
  }
}

@media (max-width: 600px) {
  .site-footer {
    margin-top: 60px;

    border-radius: 24px 24px 0 0;
  }

  .footer-container {
    width: calc(100% - 32px);

    grid-template-columns: 1fr 1fr;

    gap: 40px 24px;

    padding: 45px 0 35px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-description {
    font-size: 12px;
  }

  .footer-title {
    font-size: 16px;
  }

  .footer-link {
    font-size: 12px;
  }

  .footer-bottom-container {
    width: calc(100% - 32px);

    min-height: auto;

    padding: 20px 0;

    flex-direction: column;

    justify-content: center;

    text-align: center;
  }
}

/* =========================================================
   MOBILE AUTH VISIBILITY — DO NOT OVERRIDE HIDDEN
   ========================================================= */

@media (max-width: 800px) {

    .top-navigation .login-button[hidden],
    .top-navigation .profile-button[hidden] {
        display: none !important;
    }

    .top-navigation .login-button:not([hidden]) {
        display: flex !important;
    }

    .top-navigation .profile-button:not([hidden]) {
        display: flex !important;
    }
}


/* =========================================================
   INDEX.CSS FOOTER — FINAL MATCH
   This block intentionally comes last so older footer rules
   in this file cannot override the index footer.
   ========================================================= */

.site-footer {
    position: relative !important;
    margin-top: 80px !important;
    background: #F8FAFC !important;
    color: #0A1D38 !important;
    border-top: 1px solid #E4E8ED !important;
    border-radius: 32px 32px 0 0 !important;
    overflow: hidden !important;
}

.site-footer::before {
    content: "" !important;
    position: absolute !important;
    top: -120px !important;
    left: 50% !important;
    width: 320px !important;
    height: 320px !important;
    transform: translateX(-50%) !important;
    background: rgba(194, 148, 71, 0.06) !important;
    border-radius: 50% !important;
    pointer-events: none !important;
}

.footer-container {
    position: relative !important;
    z-index: 1 !important;
    width: calc(100% - 48px) !important;
    max-width: 1184px !important;
    margin: 0 auto !important;
    padding: 60px 0 48px !important;
    display: grid !important;
    grid-template-columns: 2fr 1fr 1.3fr 1.3fr !important;
    gap: 60px !important;
    direction: rtl !important;
}

.footer-brand {
    max-width: 330px !important;
}

.footer-logo {
    display: inline-flex !important;
    align-items: center !important;
}

.footer-logo img {
    width: auto !important;
    height: 58px !important;
    object-fit: contain !important;
}

.footer-description {
    margin: 20px 0 0 !important;
    max-width: none !important;
    color: #68717C !important;
    font-family: "Cairo", sans-serif !important;
    font-size: 13px !important;
    line-height: 2 !important;
    text-align: right !important;
}

.footer-column {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
}

.footer-title {
    position: relative !important;
    margin: 0 0 22px !important;
    color: #0A1D38 !important;
    font-family: "Tajawal", sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

.footer-title::after {
    content: "" !important;
    display: block !important;
    width: 28px !important;
    height: 3px !important;
    margin-top: 9px !important;
    background: #C29447 !important;
    border-radius: 999px !important;
}

.footer-link {
    margin-bottom: 11px !important;
    color: #68717C !important;
    font-family: "Cairo", sans-serif !important;
    font-size: 13px !important;
    line-height: 1.7 !important;
    text-decoration: none !important;
    transition: color 180ms ease, transform 180ms ease !important;
}

.footer-link:hover {
    color: #C29447 !important;
    transform: translateX(-3px) !important;
}

.footer-contact-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    color: #68717C !important;
    font-family: "Cairo", sans-serif !important;
    font-size: 12px !important;
    text-decoration: none !important;
    transition: color 180ms ease !important;
}

.footer-contact-item:hover {
    color: #0A1D38 !important;
}

.footer-icon {
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: rgba(194, 148, 71, 0.12) !important;
    color: #C29447 !important;
    border: 1px solid rgba(194, 148, 71, 0.15) !important;
    border-radius: 50% !important;
    font-size: 12px !important;
}

.footer-socials {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    margin-top: 10px !important;
}

.footer-socials a {
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #FFFFFF !important;
    color: #0A1D38 !important;
    border: 1px solid #DDE2E8 !important;
    border-radius: 50% !important;
    font-size: 13px !important;
    text-decoration: none !important;
    transition:
        background-color 180ms ease,
        color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease !important;
}

.footer-socials a:hover {
    background: #C29447 !important;
    color: #FFFFFF !important;
    border-color: #C29447 !important;
    transform: translateY(-2px) !important;
}

.footer-bottom {
    position: relative !important;
    z-index: 1 !important;
    border-top: 1px solid #E1E5EA !important;
}

.footer-bottom-container {
    width: calc(100% - 48px) !important;
    max-width: 1184px !important;
    min-height: 64px !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    direction: rtl !important;
}

.footer-bottom p {
    margin: 0 !important;
    color: #8A929D !important;
    font-family: "Cairo", sans-serif !important;
    font-size: 11px !important;
}

.footer-bottom-links {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    color: #8A929D !important;
    font-family: "Cairo", sans-serif !important;
    font-size: 11px !important;
}

.footer-bottom-links a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 180ms ease !important;
}

.footer-bottom-links a:hover {
    color: #C29447 !important;
}

@media (max-width: 900px) {
    .footer-container {
        grid-template-columns: 1.5fr 1fr 1fr !important;
        gap: 40px !important;
    }

    .footer-brand {
        grid-column: 1 / -1 !important;
        max-width: 500px !important;
    }
}

@media (max-width: 600px) {
    .site-footer {
        margin-top: 60px !important;
        border-radius: 24px 24px 0 0 !important;
    }

    .footer-container {
        width: calc(100% - 32px) !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 40px 24px !important;
        padding: 45px 0 35px !important;
    }

    .footer-brand {
        grid-column: 1 / -1 !important;
    }

    .footer-description {
        font-size: 12px !important;
    }

    .footer-title {
        font-size: 16px !important;
    }

    .footer-link {
        font-size: 12px !important;
    }

    .footer-bottom-container {
        width: calc(100% - 32px) !important;
        min-height: auto !important;
        padding: 20px 0 !important;
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
    }
}
