/* ===========================================================
 * lang-switcher.css  —  Mavis
 * Lightweight language switcher. Drop-in. Mobile friendly.
 * Position: right side, under the header banner.
 * =========================================================== */

.lang-switcher-mount {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 0 16px;
  box-sizing: border-box;
  position: relative;
  z-index: 99999;
}

.lang-switcher {
  position: relative;
  font-family: 'Teko', 'Lato', Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* Trigger button */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #00c4de 0%, #1b56ff 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 22px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
  min-width: 130px;
  justify-content: center;
}
.lang-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.lang-btn:active { transform: translateY(0); }
.lang-btn:focus { outline: 2px solid #ffd54a; outline-offset: 2px; }

.lang-current-flag { font-size: 18px; line-height: 1; }
.lang-current-name { white-space: nowrap; }
.lang-caret {
  font-size: 12px;
  transition: transform 0.2s ease;
  margin-left: 2px;
}
.lang-switcher.is-open .lang-caret { transform: rotate(180deg); }

/* Dropdown menu */
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: rgba(20, 24, 50, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  min-width: 200px;
  max-height: 340px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 100000;
}

.lang-menu li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: #f1f1f0;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.lang-menu li:hover { background: rgba(0, 196, 222, 0.18); }
.lang-menu li.is-active {
  background: rgba(0, 196, 222, 0.28);
  color: #ffd54a;
}
.lang-flag { font-size: 18px; line-height: 1; min-width: 22px; text-align: center; }
.lang-name { flex: 1; white-space: nowrap; }
.lang-code {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  font-family: monospace;
  text-transform: uppercase;
}
.lang-menu li.is-active .lang-code { color: #ffd54a; }

/* RTL: align dropdown to the left for Arabic */
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
html[dir="rtl"] .lang-menu li { direction: rtl; }

/* Scrollbar for the dropdown */
.lang-menu::-webkit-scrollbar { width: 6px; }
.lang-menu::-webkit-scrollbar-track { background: transparent; }
.lang-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }

/* Mobile */
@media (max-width: 480px) {
  .lang-btn { min-width: 110px; font-size: 14px; padding: 5px 10px; }
  .lang-menu { min-width: 180px; max-height: 280px; }
  .lang-current-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
}

/* ===========================================================
 * RTL overrides for Arabic (html[dir="rtl"])
 * =========================================================== */

/* Reward item cards: flip image to right, text to left */
html[dir="rtl"] .item-content-name {
  text-align: right;
}
html[dir="rtl"] .item-content-description,
html[dir="rtl"] .item-content-description-red,
html[dir="rtl"] .item-content-description-ungu,
html[dir="rtl"] .item-content-description-biru {
  float: right;
  border-left: none;
  border-right: 2px solid #FBDA4D; /* default yellow */
  background-image: linear-gradient(to left, #FBDA4D, transparent);
}
html[dir="rtl"] .item-content-description-red {
  border-right-color: #BE120E;
  background-image: linear-gradient(to left, #740404, transparent);
}
html[dir="rtl"] .item-content-description-ungu {
  border-right-color: #8A1680;
  background-image: linear-gradient(to left, #7C1464, transparent);
}
html[dir="rtl"] .item-content-description-biru {
  border-right-color: #0D47A1;
  background-image: linear-gradient(to left, #1565C0, transparent);
}

/* Banner / alert text alignment */
html[dir="rtl"] .banner-text,
html[dir="rtl"] .banner-alert,
html[dir="rtl"] [data-i18n="bannerAlert"] {
  direction: rtl;
  text-align: right;
}

/* Nav items */
html[dir="rtl"] .nav-items,
html[dir="rtl"] .nav-links {
  direction: rtl;
}

/* Buttons in item cards */
html[dir="rtl"] .BtnRedeemAfterLoginPlayid {
  float: left;
}



/* ===========================================================
 * Full RTL card flip for Arabic
 * LTR layout: [button(right)][img(left)][badge(left)]
 * RTL layout: [button(left)][img(right)][badge(right)]
 * =========================================================== */

/* Image: move from left to right */
html[dir="rtl"] .item-content img {
  float: right !important;
  margin-right: 0 !important;
  margin-left: 10px !important;
}

/* Price button: move from right to left */
html[dir="rtl"] .BtnRedeemAfterLoginPlayid,
html[dir="rtl"] .item-content > button {
  float: left !important;
  margin-left: 0 !important;
  margin-right: auto !important;
  /* Keep the vertical pull-up but adjust for RTL */
}

/* Description badge: flip from left to right, flip gradient and border */
html[dir="rtl"] .item-content-description,
html[dir="rtl"] .item-content-description-red,
html[dir="rtl"] .item-content-description-ungu,
html[dir="rtl"] .item-content-description-biru {
  float: right !important;
  clear: right;
  border-left: none !important;
  /* gradient: to left (transparent on right side) */
}

/* Yellow badge - original: to right, green border-left */
html[dir="rtl"] .item-content-description {
  border-right: 2px solid #FBDA4D;
  background: linear-gradient(to left, #FBDA4D, #66000000) !important;
  background-image: linear-gradient(to left, #FBDA4D, #66000000) !important;
}

/* Red badge */
html[dir="rtl"] .item-content-description-red {
  border-right: 2px solid #BE120E;
  background: linear-gradient(to left, #740404, #66000000) !important;
  background-image: linear-gradient(to left, #740404, #66000000) !important;
}

/* Purple badge */
html[dir="rtl"] .item-content-description-ungu {
  border-right: 2px solid #B12D99;
  background: linear-gradient(to left, #7C1464, #66000000) !important;
  background-image: linear-gradient(to left, #7C1464, #66000000) !important;
}

/* Blue badge */
html[dir="rtl"] .item-content-description-biru {
  border-right: 2px solid #6A2AAC;
  background: linear-gradient(to left, #491D77, #66000000) !important;
  background-image: linear-gradient(to left, #491D77, #66000000) !important;
}

/* Item name text: right-align for Arabic */
html[dir="rtl"] .item-content-name {
  text-align: right;
  direction: rtl;
}

/* Banner text */
html[dir="rtl"] .banner-text,
html[dir="rtl"] [data-i18n="bannerAlert"],
html[dir="rtl"] [data-i18n="spinTitle"],
html[dir="rtl"] [data-i18n="spinSubtitle"] {
  direction: rtl;
  text-align: right;
}

/* Language switcher: keep it accessible on the side */
html[dir="rtl"] .lang-switcher-mount {
  justify-content: flex-start;
}
html[dir="rtl"] .lang-btn {
  direction: ltr;
}
