/* WATranslate v4.4 — interface language switch */

.desktop-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ui-language-select,
.mobile-language-select {
  border: 1px solid rgba(255,255,255,.09);
  outline: 0;
  background: #2a3942;
  color: #e9edef;
  font: inherit;
  cursor: pointer;
}

.desktop-language-select {
  min-width: 105px;
  height: 36px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.login-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.login-heading-row h1 {
  margin-bottom: 4px;
}

.login-language-select {
  flex: 0 0 auto;
  max-width: 118px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12px;
}

.mobile-language-select {
  display: none;
}

@media (max-width: 760px) {
  .desktop-header-actions {
    display: none;
  }

  .mobile-language-select {
    display: block;
    flex: 0 0 52px;
    width: 52px;
    height: 38px;
    margin-right: 2px;
    padding: 0 5px;
    border-radius: 19px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-align-last: center;
    -webkit-appearance: none;
    appearance: none;
  }

  .mobile-language-select:active {
    background: #32444e;
  }

  .mobile-title-block {
    min-width: 0;
  }

  .mobile-title-block strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .login-heading-row {
    align-items: center;
  }

  .login-language-select {
    max-width: 108px;
  }
}

@media (max-width: 350px) {
  .mobile-language-select {
    flex-basis: 46px;
    width: 46px;
  }

  .mobile-app-menu-button {
    width: 38px;
  }
}


/* v4.4.2 — Desktop/web application menu
   Use the same three-dot menu behavior already used on mobile.
*/

@media (min-width: 761px) {
  /* Keep the language switch visible, but remove the separate Logout button. */
  .desktop-header-actions #logoutButton {
    display: none;
  }

  .desktop-header-actions {
    margin-left: auto;
  }

  /* The existing mobile menu component is reused on desktop. */
  .mobile-app-menu-wrap {
    position: relative;
    display: block;
    flex: 0 0 auto;
    margin-left: 2px;
  }

  .mobile-app-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 8px;
    background: #2a3942;
    color: #dfe7ea;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-app-menu-button:hover,
  .mobile-app-menu-button:focus-visible {
    background: #34444d;
  }

  .mobile-app-menu {
    position: absolute;
    z-index: 500;
    top: 42px;
    right: 0;
    display: none;
    min-width: 145px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: #233138;
    box-shadow: 0 10px 28px rgba(0,0,0,.40);
  }

  .mobile-app-menu.open {
    display: block;
  }

  .mobile-app-menu button {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #e9edef;
    text-align: left;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }

  .mobile-app-menu button:hover,
  .mobile-app-menu button:focus-visible {
    background: rgba(255,255,255,.08);
  }

  /* Add-to-Home-Screen help is a mobile feature.
     Desktop menu contains Logout only for now. */
  .mobile-app-menu #installHelpButton {
    display: none !important;
  }
}


/* v4.5.1 — Desktop language selector moved inside the three-dot menu */

.desktop-menu-language-group {
  display: none;
}

@media (min-width: 761px) {
  /* No standalone language control in the desktop header. */
  .desktop-language-select {
    display: none !important;
  }

  .desktop-header-actions {
    display: none;
  }

  /* Room for Settings + language selector + Logout. */
  .mobile-app-menu {
    min-width: 205px;
  }

  .desktop-menu-language-group {
    display: grid;
    gap: 6px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  .desktop-menu-language-group label {
    color: #9fb0b8;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
  }

  .desktop-menu-language-select {
    box-sizing: border-box;
    width: 100%;
    height: 36px;
    padding: 0 30px 0 10px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    outline: 0;
    background: #2a3942;
    color: #e9edef;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }

  .desktop-menu-language-select:focus {
    border-color: #00a884;
  }
}

@media (max-width: 760px) {
  /* Mobile keeps its existing compact language selector in the header. */
  .desktop-menu-language-group {
    display: none !important;
  }
}
