/*
 * Site header (top bar + sidebar drawer + language dropdown + overlay).
 *
 * Injected into the page by /assets/js/header.js — this CSS file is loaded at
 * runtime by the same script so every page that uses the header gets it
 * automatically (no per-page <link> needed).
 *
 * Class prefix: .mfh-  (Mo & Fe Header)  to avoid clashing with page styles.
 */

/* ========== Universal box-sizing for header + sidebar ========== */
#professional-header *,
#professional-header *::before,
#professional-header *::after,
#sidebarMenu *,
#sidebarMenu *::before,
#sidebarMenu *::after {
  box-sizing: border-box !important;
}

/* ========== Slide-in animation for the top bar ========== */
@keyframes mfh-slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========== Fixed top bar ========== */
.mfh-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #000000 100%);
  border-bottom: 2px solid rgba(201, 165, 92, 0.3);
  padding: 12px 16px;
  z-index: 9998;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  animation: mfh-slide-down 0.5s ease-out;
  box-sizing: border-box;
}

.mfh-bar__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
}

.mfh-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.mfh-side--start {
  justify-content: flex-start;
}
.mfh-side--end {
  justify-content: flex-end;
  position: relative;
}

.mfh-center {
  flex: 1 1 auto;
  text-align: center;
  padding: 0 8px;
  min-width: 0;
  overflow: hidden;
}

/* ========== Menu toggle + language toggle (shared look) ========== */
.mfh-icon-btn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(201, 165, 92, 0.08);
  border: 1.5px solid rgba(201, 165, 92, 0.5);
  border-radius: 12px;
  width: 60px;
  height: 38px;
  min-width: 48px;
  flex-shrink: 0;
  padding: 0;
  color: #c9a55c;
  cursor: pointer;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.mfh-icon-btn--lang {
  font-size: 13px;
  font-weight: 600;
}
.mfh-icon-btn:hover {
  background: rgba(201, 165, 92, 0.18) !important;
  border-color: #c9a55c !important;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(201, 165, 92, 0.35);
}
.mfh-icon-btn svg,
.mfh-icon-btn > span {
  flex-shrink: 0;
}

/* ========== Brand title (gradient text) ========== */
.mfh-brand {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  color: #c9a55c;
  font-size: clamp(14px, 3.8vw, 26px);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #c9a55c 0%, #f4e4c1 50%, #c9a55c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  line-height: 1.2;
}

/* ========== Language dropdown ========== */
.mfh-lang-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #1a1a1a;
  border: 2px solid rgba(201, 165, 92, 0.3);
  border-radius: 10px;
  min-width: 180px;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 10000;
}
.mfh-lang-dropdown .lang-option {
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: #ccc;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  letter-spacing: 0.3px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(201, 165, 92, 0.1);
}
.mfh-lang-dropdown .lang-option:last-child {
  border-bottom: none;
}
.mfh-lang-dropdown .lang-option span {
  font-family: inherit;
  font-weight: 500;
}
.lang-option:hover,
.menu-item:hover {
  background: rgba(201, 165, 92, 0.1) !important;
  color: #c9a55c !important;
  padding-left: 30px !important;
}

/* ========== Fixed-header spacer ==========
 * Applied as body padding-top via the preloaded header.css so content starts
 * below the fixed header from first paint (before header.js injects the DOM).
 * The .mfh-spacer div injected by header.js is kept at height 0 so the spacing
 * doesn't double up. !important so page-specific CSS resets (e.g. `padding: 0`
 * in homepage.css / booking-ui.css) don't wipe it out. */
body {
  padding-top: 76px !important;
}
.mfh-spacer {
  height: 0;
}

/* ========== Sidebar drawer ========== */
.mfh-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  right: auto;
  width: 100%;
  max-width: 350px;
  height: calc(var(--vh, 1vh) * 100);
  background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-sizing: border-box;
}

.mfh-sidebar__head {
  padding: 20px;
  border-bottom: 2px solid rgba(201, 165, 92, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.mfh-sidebar__title {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  color: #c9a55c;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 1.5px;
}

.mfh-close-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: rgba(201, 165, 92, 0.1);
  border: 2px solid rgba(201, 165, 92, 0.3);
  border-radius: 8px;
  padding: 8px;
  color: #c9a55c;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.mfh-close-btn:hover {
  background: rgba(201, 165, 92, 0.2) !important;
  border-color: #c9a55c !important;
  transform: rotate(90deg);
}

/* Logged-in user info at the top of the sidebar */
.mfh-user-info {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(201, 165, 92, 0.2);
  background: rgba(201, 165, 92, 0.06);
}
.mfh-user-info__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: #c9a55c;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  word-break: break-word;
}
.mfh-user-info__email {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: #b7bec8;
  word-break: break-all;
}
.mfh-user-info[hidden] {
  display: none !important;
}

.mfh-menu {
  padding: 20px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  color: #ccc;
  text-decoration: none;
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

button.menu-item {
  width: 100%;
  background: transparent;
  border: none;
  border-left: 4px solid transparent;
  text-align: left;
  cursor: pointer;
}

.menu-item--logout {
  color: #e74c3c;
}

.mfh-divider {
  height: 1px;
  background: rgba(201, 165, 92, 0.2);
  margin: 16px 24px;
}

/* Hide the divider above the role-gated section when dashboard/settings are
 * both hidden (i.e., the user isn't staff). Otherwise two dividers collapse
 * visually adjacent and look like a doubled line. */
.mfh-divider:has(+ #menuDashboard[hidden]) {
  display: none;
}

.mfh-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  background: rgba(0, 0, 0, 0.7);
  z-index: 9997;
  display: none;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ========== Force-hide menu items with the [hidden] attribute ========== */
#menuDashboard[hidden],
#menuSettings[hidden],
#menuLogin[hidden],
#menuSignup[hidden],
#menuLogout[hidden] {
  display: none !important;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .mfh-brand {
    font-size: 18px !important;
    letter-spacing: 0.5px !important;
  }
  #menuToggleBtn,
  #langToggleBtn {
    width: 48px !important;
    height: 36px !important;
  }
}

@media (max-width: 400px) {
  .mfh-brand {
    font-size: 15px !important;
    letter-spacing: 0 !important;
  }
  #menuToggleBtn,
  #langToggleBtn {
    width: 42px !important;
    height: 34px !important;
  }
}
