/* =========================
   THEME VARIABLES
========================= */
:root {
  --primary: #331E36;
  --secondary: #41337A; /* violet */
  --accent: #6EA4BF;
  --background-light: #ECFEE8;
  --background-mint: #C2EFEB;
  --text: #41337A; /* was #333, now violet */
  --border-radius: 16px;
  --max-width: 600px;
  --drawer-w: 85vw;                 /* single source of truth for drawer width */
}

/* =========================
   BASE
========================= */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}
/* lock background scroll while menu open (toggle via JS) */
body.no-scroll { overflow: hidden; }

/* Header bar */
header {
  background-color: #fff;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* border-bottom: 1px solid #C2EFEB; */

  border-bottom: 2px solid var(--secondary); /* violet line */

  position: sticky;
  top: 0;
  z-index: 1500; /* below drawer (3000) and overlay (2000), above page */
  gap: 1rem;
  flex-wrap: wrap; /* Needed for mobile wrapping */
}

.logo-img { height: 75px; }

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Desktop nav list */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  text-decoration: none;
  color: #333;
  font-weight: 400;
  transition: font-weight 0.2s;
}

.nav-links li a:hover,
.nav-links li a:focus { font-weight: 600; }

/* Buttons */
.login-btn {
  padding: 0.75rem 2rem;
  background-color: #6EA4BF;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}

#myProfile-btn {
  padding: 0.75rem 2rem;
  background-color: #41337A; /* violet */
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
}

#myProfile-btn:hover { background-color: #2f2861; }

/* Burger hidden on desktop */
.burger {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  position: relative;
  z-index: 3100;
}

.close-btn { display: none; }

/* =========================
   OVERLAY (GLOBAL)
========================= */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.40);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 2000; /* below drawer (3000), above page/header (1500) */
}
.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 767px) {
  header { padding: 0.5rem 1rem; }         /* reduced padding on mobile */
  .logo-img { height: 60px; }              /* smaller logo */
  .nav { position: relative; }

  /* Drawer: fixed right, consistent width everywhere */
  #nav-links {
    position: fixed;
    top: 0;
    right: -100%;                          /* hidden off-canvas (closed) */
    left: auto;                            /* guard against page CSS anchoring left */
    height: 100vh;
    width: min(420px, var(--drawer-w));    /* cap width for tablets */
    padding: 2rem;
    padding-top: 4rem;                     /* room for the ✕ */
    background: #fff;
    box-shadow: -2px 0 8px rgba(0,0,0,.1);
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;

    transform: none;                       /* neutralize stray transforms */
    transition: right .3s ease;
    z-index: 3000;                         /* ABOVE overlay */
    will-change: right;
  }
  /* Drawer open */
  #nav-links.active { right: 0; }

  /* Show burger on mobile */
  .burger { display: block; }

  /* Big, comfy close button — top-left */
  .close-btn {
    display: block;
    position: absolute;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: #333;
    font-size: 24px;
    line-height: 44px;                     /* centers the ✕ */
    text-align: center;
    cursor: pointer;
    z-index: 3100;                         /* above drawer content */
    -webkit-tap-highlight-color: transparent;
  }
  .close-btn:active { opacity: .7; }

  /* Keep items visible (no flicker on reopen) */
  .nav-links li {
    opacity: 1;
    transform: none;
    transition: opacity .2s ease, transform .2s ease;
  }

  /* Comfy link taps */
  #nav-links a {
    display: block;
    padding: 10px 4px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Slight extra space for the login button stack */
  .login-btn { margin-top: 1rem; }
}

/* =========================
   VERIFY BANNER
========================= */
#verify-banner {
  background-color: rgba(110, 164, 191, 0.15); /* light transparent blue */
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
  white-space: nowrap;
  flex-shrink: 0;

  /* Always render above overlay/drawer */
  position: relative;
  z-index: 4000;
}

#verify-banner button {
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 0.8rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#verify-banner button:hover { background-color: var(--secondary); }

@media (max-width: 767px) {
  #verify-banner {
    order: 2;
    font-size: 0.75rem;
    padding: 4px 8px;
    margin-top: 0.25rem;
  }
  .burger { order: 3; }
}
.lang-switch {
  position: relative;      /* needed so the absolute dropdown anchors here */
  display: flex;
  align-items: center;
  height: 100%;
}

/* Clean button: no border, no background, no padding */
.lang-toggle {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;   /* avoids extra vertical space */
  border-radius: 0; /* no rounded box */
}

/* Exact flag size (same as your inline SVG attributes) */
.lang-toggle .flag {
  width: 18px;
  height: 12px;
  display: block;
}

.lang-toggle:focus { outline: none; }
.lang-toggle:focus-visible {
  outline: 2px solid var(--secondary); /* or any color you like */
  outline-offset: 2px;
}


.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: .3rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  list-style: none;
  display: none;
  z-index: 3200;
  min-width: 110px;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: .5rem .75rem;
  background: none;
  cursor: pointer;
}
.lang-menu button:hover { background: #f5f5f5; }

@media (max-width: 767px) {
  .lang-switch { 
    order: 2; 
    margin-left: auto;      /* pushes flag to the right next to burger */
  }
  .burger { order: 3; }
}

@media (max-width: 767px) {
  .lang-toggle .flag {
    width: 18px;
    height: 12px;
    display: inline-block;
    vertical-align: middle;   /* line up with burger glyph */
  }

  .burger {
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
  }
}