/* =============================================================
   KSU Theme — Header & Footer styles for OpenedX legacy pages
   Header classes match React header.scss (no prefix).
   Footer classes prefixed with "ksu-" to avoid conflicts.
   ============================================================= */

:root {
  --theme-primary: #0d99ff;
  --theme-footer-bg: #008EC3;
  --theme-footer-link-color: #ffffff;
  --ksu-theme-footer-bg: #008EC3;
  --ksu-theme-footer-link-color: #ffffff;
}

/* ------------------------------------------------------------------ */
/* HEADER  (matches React header.scss — no ksu- prefix)               */
/* ------------------------------------------------------------------ */

.landing-header {
  background: #ffffff;
  position: relative;
  font-family: 'GE Dinar One', 'Inter', system-ui, -apple-system, sans-serif;
}

.landing-header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 24px;
}

.header-center nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-pill {
  padding: 16px 40px;
  border-radius: 999px;
  border: none;
  color: #000000;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  background: transparent;
}

.nav-pill:hover,
.nav-pill.active {
  background: #f0ede7;
  color: var(--theme-primary);
  font-weight: 700;
}

.nav-link-plain {
  padding: 16px 40px;
  border-radius: 999px;
  border: none;
  color: #000000;
  cursor: pointer;
  font-size: 16px;
  background: transparent;
  font-family: inherit;
}

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

/* Buttons */
.btn {
  border-radius: 999px;
  padding: 0 24px;
  height: 48px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--theme-primary);
  color: #ffffff;
}

.header-login-btn {
  padding-inline: 24px;
}

.lang-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer;
}

/* User profile dropdown */
.user-profile-wrapper {
  position: relative;
}

.user-profile-btn {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px 12px;
  background-color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--theme-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  padding: 8px 0;
  z-index: 1000;
  animation: dropdownFadeIn 0.2s ease;
}

[dir="rtl"] .user-dropdown {
  right: auto;
  left: 0;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.dropdown-item:hover { background: #f3f4f6; }

.dropdown-item svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
  flex-shrink: 0;
}

.dropdown-item.logout {
  color: #dc2626;
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
  padding-top: 12px;
}

.dropdown-item.logout svg { color: #dc2626; }
.dropdown-item.logout:hover { background: #fef2f2; }

/* Mobile logo — hidden on desktop */
.header-mobile-logo {
  display: none;
  flex: 1;
}

.header-mobile-logo .brand-logo-img { height: 36px; }

/* Mobile search button — hidden on desktop, only shown <=768px */
.mobile-search-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #374151;
}

/* Mobile menu button — hidden on desktop */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #374151;
}

/* Mobile overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  display: block;
  opacity: 1;
}

/* Mobile slide-in menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  height: 100%;
  background: #ffffff;
  z-index: 999;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
}

[dir="rtl"] .mobile-menu {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

.mobile-menu.open { transform: translateX(0); }
[dir="rtl"] .mobile-menu.open { transform: translateX(0); }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-header .brand-logo-img { height: 36px; }

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #374151;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-link {
  display: block;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s ease;
  border: none;
  background: none;
  text-align: start;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.mobile-menu-link:hover,
.mobile-menu-link.active { background: #f3f4f6; color: var(--theme-primary); }
.mobile-menu-link.logout { color: #dc2626; }
.mobile-menu-link.logout:hover { background: #fef2f2; }

.mobile-menu-user {
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 8px;
}

.mobile-menu-auth { padding: 16px; }
.mobile-menu-auth .btn { width: 100%; justify-content: center; }

.mobile-menu-lang {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

.mobile-menu-link.lang-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-weight: 600;
}

/* Search overlay */
.ksu-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ksu-search-overlay-inner {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 600px;
  position: relative;
}

.ksu-search-overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ksu-search-form { display: flex; gap: 12px; margin-top: 8px; }

.ksu-search-input {
  flex: 1;
  height: 48px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 16px;
  font-family: inherit;
  outline: none;
}

.ksu-search-input:focus { border-color: var(--theme-primary); }

/* ------------------------------------------------------------------ */
/* FOOTER  (ksu- prefixed)                                             */
/* ------------------------------------------------------------------ */

.ksu-landing-footer {
  position: relative;
  overflow: hidden;
  background-color: var(--ksu-theme-footer-bg);
  font-family: 'GE Dinar One', 'Inter', system-ui, -apple-system, sans-serif;
}

.ksu-landing-footer-container {
  position: relative;
  max-width: 1500px;
  margin: 0 auto;
  min-height: 140px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.ksu-footer-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  position: relative;
  z-index: 3;
  flex-shrink: 0;
}

.ksu-landing-footer-content {
  position: relative;
  z-index: 3;
  flex: 1;
  padding: 32px 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.ksu-footer-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.ksu-footer-nav-link {
  color: var(--ksu-theme-footer-link-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.ksu-footer-nav-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ------------------------------------------------------------------ */
/* RESPONSIVE                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
  .mobile-menu-btn    { display: flex; }
  .mobile-search-btn  { display: flex; }
  .mobile-menu        { display: flex; }

  .header-center,
  .header-right { display: none; }

  .header-mobile-logo {
    display: flex;
    width: 100%;
    justify-content: start;
  }

  .landing-header-inner {
    flex-wrap: nowrap;
    gap: 12px;
  }

  /* Dropdown becomes centered modal on mobile */
  .user-dropdown {
    position: fixed;
    top: 70px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 32px);
    max-width: 280px;
  }

  /* Footer */
  .ksu-landing-footer-container {
    flex-direction: column;
    padding-top: 80px;
  }

  .ksu-landing-footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 24px 16px;
  }

  .ksu-footer-nav {
    justify-content: center;
    gap: 16px;
  }
}
