/* ==================================
   Main Website Styles
   ================================== */

:root {
  --navy:         #00024a;
  --primary:      #2d308f;
  --accent:       #3d42c8;
  --accent-light: #cfd1ff;
  --gold:         #daad4c;
  --gold-sep:     #987935;
  --cream:        #fffbfb;
  --bg-cards:     #f8f7f2;
  --text-gray:    #555555;
  --text-light:   #b7b2b2;
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Rubik', sans-serif;
  font-weight: 400;
  background: var(--bg-cards);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a {
  text-decoration: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: transparent; 
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--navy);
  border-radius: 10px;
  border: 2px solid var(--accent-light); 
  transition: 0.3s;
}

::-webkit-scrollbar-thumb:hover {
  background-color: navy;
}
/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */
.navbar {
  height: 70px;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  /* box-shadow: 0 1px 30px rgba(0,0,0,0.4); */
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between; /* first=RIGHT (logo), last=LEFT (btn) */
  padding: 0 48px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

/* Logo group: image RIGHT, text LEFT */
.nav-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
  /* RTL: logo img (first=right), text div (second=left) */
}

.nav-logo-img {
  height: 55px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* RTL flex-start = right side → labels aligned right */
}

.nav-uni-name {
  font-weight: 600;
  color: var(--primary);
  font-size: 15px;
  line-height: 1.4;
  margin: 0;
}

.nav-uni-sub {
  font-weight: 400;
  color: rgba(45, 48, 143, 0.5);
  font-size: 12px;
  margin: 0;
}

/* Login button */
.btn-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 10px;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 0.15s;
  /* RTL: text (first=right), icon (last=left) */
}
.btn-login:hover { background-color: #1e2070; }

.btn-login-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════ */
.hero-section {
  background: linear-gradient(to bottom, #000269 0%, #000136 100%);
  overflow-x: clip;
}

/* CSS Grid: in RTL, first col = right, second col = left */
.hero-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 48px;
  align-items: center;
  padding: 54px 80px 64px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ── RIGHT cell: text, search, filters ── */
.hero-text-cell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-label {
  font-weight: 400;
  color: var(--gold);
  font-size: 12px;
  margin: 0;
  text-align: right; /* ensure right-aligned even inside flex col */
}

.hero-heading {
  font-weight: 700;
  color: #ffffff;
  font-size: 30px;
  line-height: 1.4;
  margin: 0;
  text-align: right;
}

/* Search bar: placeholder RIGHT, button LEFT */
.search-bar {
  background: var(--cream);
  border-radius: 25px;
  height: 41px;
  padding: 4px 6px 4px 6px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  /* RTL: placeholder (first=right), btn (last=left) */
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-weight: 400;
  color: #1e1e1e;
  font-size: 11px;
  text-align: right;
  padding: 0 8px;
}

.search-input::placeholder {
  color: #9c9c9c;
}

.search-btn {
  background-color: var(--primary);
  border: none;
  border-radius: 50%;
  width: 29px;
  height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.15s;
  padding: 0;
}
.search-btn:hover { background-color: var(--accent); }

.search-icon-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Filters row: 3 buttons */
.filters-row {
  display: flex;
  gap: 10px;
  /* RTL: filters flow from right to left */
}

/* Wrapper gives each filter slot flex:1 and anchors the dropdown */
.filter-btn-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.filter-btn {
  transition: background-color 0.3s !important;
}

.filter-btn:hover {
  background-color: #f1f1fa;
}

/* Dropdown panel */
.filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
  border: 1px solid rgba(61,66,200,0.1);
  overflow: hidden;
  z-index: 500;
}

.filter-dropdown.open { display: block; }

.dropdown-item {
  font-weight: 400;
  color: #313030;
  font-size: 12px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: right;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.12s, color 0.12s;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #f0f0ff; color: #3d42c8; }

/* Filter button: icon RIGHT, label MIDDLE, chevron LEFT */
.filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #fffefe;
  border-radius: 5px;
  height: 31px;
  padding: 0 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.12);
  cursor: pointer;
  width: 100%; /* fills the .filter-btn-wrap */
  transition: box-shadow 0.15s;
  /* RTL: icon (first=right), label (middle), chevron (last=left) */
}
.filter-btn:hover { box-shadow: 0 3px 8px rgba(0,0,0,0.18); }

.filter-icon {
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
  /* first child → visual RIGHT in RTL */
}

.filter-label {
  font-weight: 600;
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: right;
  margin-right: 5px;
}

.filter-chevron {
  width: 13px;
  height: 13px;
  object-fit: contain;
  flex-shrink: 0;
  /* last child → visual LEFT in RTL */
}

/* ── LEFT cell: hero image ── */
.hero-img-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* in RTL, flex-end = visual LEFT → push image toward left edge */
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── Hero carousel ── */
.hero-carousel {
  position: relative;
  width: 100%;
  max-width: 620px;
  height: 334px;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.3s linear, box-shadow 0.3s linear;
  transform: perspective(1000px);
}

.hero-carousel:hover {
  transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
  box-shadow: 0px 7px 50px rgba(241, 241, 250, 0.4);
}

.carousel-track {
  display: flex;
  height: 100%;
  direction: ltr; /* always LTR so translateX slides correctly */
  transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  pointer-events: none;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

/* Colour placeholder slides */
.carousel-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-ph--blue { background: linear-gradient(135deg, #001f6b 0%, #0038a8 100%); }
.carousel-ph--teal { background: linear-gradient(135deg, #005f73 0%, #0a9396 100%); }
.carousel-ph--gold { background: linear-gradient(135deg, #7d5a00 0%, #c9960c 100%); }

.carousel-ph-label {
  font-weight: 600;
  font-size: 22px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.03em;
}

/* Dot indicators — slightly above the bottom border */
.carousel-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 10;
  background-color: rgba(30, 30, 30, 0.7);
  padding: 5px 10px;
  border-radius: 10px;
  min-width: fit-content;
  display: flex;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.42);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, width 0.3s ease, border-radius 0.3s ease;
}

.carousel-dot.active {
  background: #ffffff;
  width: 22px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   CARDS SECTION
   ═══════════════════════════════════════════════════════════ */
.cards-section {
  background-color: var(--bg-cards);
  padding: 32px 0 48px;
  overflow-x: clip;
}

.cards-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
}

/* Toolbar: results RIGHT, sort LEFT */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  /* RTL: toolbar-right (first=visual right), toolbar-left (last=visual left) */
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  /* RTL: view-icon-btn (first=right), results text (second=left) */
}

.view-icon-btn {
  background: #ffffff;
  border-radius: 7px;
  width: 31px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.results-count {
  font-weight: 400;
  color: var(--accent);
  font-size: 12px;
  margin: 0;
}
.results-count strong { font-weight: 700; }

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  /* RTL: sort-by-label (first=right within this group), sort-btn (last=left) */
}

.sort-by-label {
  font-weight: 400;
  color: #313030;
  font-size: 12px;
  white-space: nowrap;
}

/* Sort dropdown: label RIGHT, chevron LEFT */
.sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #ffffff;
  border-radius: 5px;
  height: 31px;
  padding: 0 8px;
  min-width: 110px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: background-color 0.3s;
  /* RTL: label (first=right), chevron (last=left) */
}

.sort-btn:hover {
  background-color: #f1f1fa;
}

.sort-btn-label {
  font-weight: 600;
  color: var(--accent);
  font-size: 10px;
  white-space: nowrap;
  flex: 1;
  text-align: right;
}

/* Cards grid: 4 columns, RTL → first card = top-right */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

/* .mc-empty-slot {
   empty placeholder to keep grid shape 
} */

/* ── Faculty card ── */
.member-card {
  background: var(--cream);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.22);
  padding: 14px 20px 14px 14px;
  /* height: 200px; */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: 0.3s linear;
}

.member-card:hover {
  transform: translateY(-10px);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

.mc-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card header: photo RIGHT (first in RTL), titles LEFT (second) */
.mc-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mc-photo {
  width: 68px;
  height: 68px;
  border-radius: 32px;
  object-fit: cover;
  flex-shrink: 0;
}

.mc-titles {
  flex: 1;
  min-width: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 5px;
  justify-content: center;
}

.mc-name {
  font-weight: 600;
  color: var(--navy);
  font-size: 15px;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  /* text-overflow: ; */
  text-wrap: wrap;
}

.mc-role {
  font-weight: 600;
  color: rgba(45, 48, 143, 0.5);
  font-size: 11px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  /* text-overflow: ellipsis; */
  text-wrap: wrap;
}

/* College row: icon RIGHT (first in RTL), text LEFT */
.mc-college-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mc-college {
  font-weight: 600;
  color: var(--text-light);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-wrap: wrap;
  /* text-overflow: ellipsis; */
}

/* ── Masked icon (CSS mask-image technique) ── */
.mc-icon-wrap {
  display: inline-grid;
  place-items: start;
  width: 27px;
  height: 23px;
  flex-shrink: 0;
}

.mc-icon-mask {
  background-color: #3d42c8;
  width: 27px;
  height: 23px;
  -webkit-mask-size: 15px 15px;
  mask-size: 15px 15px;
  -webkit-mask-position: 6px 2px;
  mask-position: 6px 2px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
}

.mc-college-icon {
  -webkit-mask-image: url('../assets/icons/university.png');
  mask-image: url('../assets/icons/university.png');
}

.mc-research-icon {
  -webkit-mask-image: url('../assets/icons/microscope.png');
  mask-image: url('../assets/icons/microscope.png');
}

/* ── Research interests section ── */
.mc-interests {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  width: 100%;
}

/* Label row: aligned right, icon first=RIGHT, label text LEFT */
.mc-interests-label {
  display: flex;
  align-items: center;
  gap: 0px;
  align-self: flex-start;
}

.mc-label {
  font-weight: 600;
  color: var(--primary);
  font-size: 10px;
  white-space: nowrap;
}

/* Badges: RTL default flex → items start from visual right */
.mc-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.mc-badge {
  background-color: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
  font-size: 10px;
  border-radius: 4px;
  padding: 4px 15px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.mc-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 5px;
}

.mc-divider {
  border: none;
  border-top: 1px solid rgba(0,0,0,0.07);
  margin: 0;
}

/* Card footer: email RIGHT (first in RTL), CTA LEFT (last) */
.mc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Email box: icon RIGHT (first in RTL), text LEFT */
.mc-email-box {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mc-email-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  flex-shrink: 0;
}

.mc-email-text {
  font-weight: 400;
  color: var(--text-gray);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
}

/* CTA: text RIGHT (first), arrow LEFT (last) in RTL */
.mc-cta {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--accent) !important;
  font-size: 10px;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  gap: 2px;
  transition: color 0.15s, background-color 0.3s;
  padding: 0 5px;
  border-radius: 7px;
}
.mc-cta:hover, .mc-cta:focus { 
  color: #1d22a0 !important;
  background-color: #f1f1fa;
}

.mc-cta-arrow {
  font-size: 20px;
  line-height: 1;
}
/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.footer {
  background-color: var(--navy);
  border-radius: 7px 7px 0 0;
  margin-top: auto;
}

.footer-sep {
  height: 1.5px;
  background: linear-gradient(to left, var(--gold-sep) 0%, rgba(152,121,53,0.3) 100%);
  border-radius: 7px 7px 0 0;
}

/* Footer grid: 3 cols, RTL → brand RIGHT, links MIDDLE, contact LEFT */
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.5fr;
  gap: 48px;
  padding: 36px 80px 0px;
  max-width: 1440px;
  margin: 0 auto;
}

.footer-col {
  border-left: 1px solid rgba(152,121,53,0.4);
}
/* ── Brand col (RIGHT) ── */
.footer-col-brand .footer-brand-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  /* RTL: logo (first=right), text (second=left) */
}

.footer-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.footer-brand-text {
  text-align: right;
}

.footer-uni-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 15px;
  margin: 0 0 4px;
}

.footer-motto {
  font-weight: 400;
  color: rgba(217, 217, 217, 0.85);
  font-size: 11px;
  margin: 0;
}

/* Social icons row */
.footer-socials {
  display: flex;
  gap: 10px;
  /* RTL: first icon = visual right */
}

.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  font-size: 15px;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.footer-social-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(218,173,76,0.1);
}

/* ── Links col (MIDDLE) ── */
.footer-col-links {
  text-align: right;
}

.footer-section-title {
  font-weight: 600;
  color: #ffffff;
  font-size: 13px;
  margin: 0 0 14px;
}

.footer-section-title--gold {
  color: var(--gold);
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-item {
  font-weight: 400;
  color: rgba(217,217,217,0.8);
  font-size: 11px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.15s;
}
.footer-link-item::before {
  content: '•';
  color: var(--gold-sep);
  font-size: 10px;
  flex-shrink: 0;
  /* In RTL, ::before appears on the visual RIGHT of the text */
}
.footer-link-item:hover { color: #ffffff; }

/* ── Contact col (LEFT) ── */
.footer-col-contact {
  text-align: right;
}

/* Contact row: icon RIGHT (first in RTL), text LEFT */
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-contact-icon {
  color: var(--gold);
  font-size: 14px;
  flex-shrink: 0;
}

.footer-contact-text {
  font-weight: 400;
  color: rgba(217,217,217,0.85);
  font-size: 11px;
}

/* ── Copyright bar ── */
.footer-copyright-bar {
  border-top: 1px solid rgba(152,121,53,0.4);
  padding: 14px 80px;
  text-align: center;
}

.footer-copyright-text {
  font-weight: 400;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .navbar { padding: 0 32px; }
  .hero-grid { padding: 44px 48px 54px; gap: 32px; }
  .cards-container { padding: 0 48px; }
  .footer-inner { padding: 30px 48px 0px; gap: 32px; }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    padding: 40px 40px 50px;
    gap: 32px;
  }
  /* On mobile, show image above text */
  .hero-img-cell { order: -1; }
  .hero-img { height: inherit; max-width: 100%; }
  .hero-img-cell { justify-content: center; }
  .hero-heading { font-size: 24px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .cards-container { padding: 0 24px; }
  .footer-inner { padding: 24px 24px 0px; gap: 15px; }
  .footer-col-contact { grid-column: 1 / -1; }
}

@media (max-width: 576px) {
  .hero-grid { padding: 32px 20px 40px; }
  .hero-heading { font-size: 20px; }
  .filters-row { flex-wrap: wrap; }
  .filter-label { font-size: 9px; }
  .cards-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-col { 
    border-left: none;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(152,121,53,0.4);
  }
  .footer-col-contact {
    border: none;
  }
  .nav-logo-img {
    height: 40px;
  }
  .nav-uni-name {
    font-size: 12px;
  }
  .nav-uni-sub {
    font-size: 9px;
  }
  .btn-login {
    font-size: 8px;
  }
  .btn-login-icon {
    width: 15px;
    height: 15px;
  }
  .results-count {
    font-size: 10px;
  }
  .sort-by-label {
    font-size: 10px;
  }
}

@media (max-width: 320px) {
  .results-count {
    font-size: 9px;
  }
  .sort-by-label {
    font-size: 9px;
  }
}