/* ==========================================================================
   Kaddu Glory — Global Website Language Switcher
   Matches target design reference with full dark theme & responsive UI
   ========================================================================== */

/* Trigger Button Container */
.kaddu-lang-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  flex-shrink: 0;
}

/* Trigger Button */
.kaddu-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  padding: 6px 11px;
  color: #f4f4f5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  line-height: 1.2;
}

.kaddu-lang-btn:hover,
.kaddu-lang-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 107, 0, 0.45);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.2);
}

.kaddu-lang-btn-flag {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  display: inline-block;
  flex-shrink: 0;
}

.kaddu-lang-btn-name {
  letter-spacing: -0.1px;
  white-space: nowrap;
}

.kaddu-lang-btn-arrow {
  width: 12px;
  height: 12px;
  color: #a1a1aa;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.kaddu-lang-btn[aria-expanded="true"] .kaddu-lang-btn-arrow {
  transform: rotate(180deg);
}

/* Dropdown Card (Matches Target Reference) */
.kaddu-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  max-width: 90vw;
  background: #141416;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 6px 0 8px 0;
  display: none;
  flex-direction: column;
  z-index: 999999;
  animation: kadduLangPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.kaddu-lang-menu.is-open {
  display: flex;
}

@keyframes kadduLangPop {
  0% { opacity: 0; transform: translateY(-6px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dropdown Title: "Language" */
.kaddu-lang-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  padding: 10px 16px 8px 16px;
  letter-spacing: -0.2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

/* Scrollable Language List */
.kaddu-lang-list {
  max-height: 380px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 6px;
}

.kaddu-lang-list::-webkit-scrollbar {
  width: 6px;
}

.kaddu-lang-list::-webkit-scrollbar-track {
  background: transparent;
}

.kaddu-lang-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.kaddu-lang-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Individual Item in Dropdown */
.kaddu-lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 7px;
  color: #d4d4d8;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.kaddu-lang-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.kaddu-lang-item.is-selected {
  background: rgba(255, 107, 0, 0.14);
  color: #ffffff;
  font-weight: 600;
}

.kaddu-lang-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kaddu-lang-item-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.kaddu-lang-item-name {
  white-space: nowrap;
  letter-spacing: -0.1px;
}

.kaddu-lang-check {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-left: 8px;
  line-height: 1;
}

/* ==========================================================================
   Google Translate Engine Clean Overrides
   Hides Google's top iframe banner, ballons, and tooltip popups completely
   ========================================================================== */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
iframe.VIpgJd-ZVi9od-ORHb-OEVmcd,
iframe.VIpgJd-ZVi9od-ORHb,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-ORHb,
.VIpgJd-yAWNEb-hvhGLc,
iframe[id*=":1.container"],
iframe[id*=":2.container"],
body > .skiptranslate:not(#google_translate_element):not(.kaddu-lang-wrap) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
}

html, body {
  top: 0px !important;
  position: static !important;
  margin-top: 0px !important;
}

#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-menu-frame,
.VIpgJd-ZVi9od-xl07Ob-OEVmcd {
  display: none !important;
  visibility: hidden !important;
}

.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}

.skiptranslate:not(.goog-te-combo):not(.kaddu-lang-wrap):not(.kaddu-lang-btn):not(.kaddu-lang-menu) {
  /* keep layout clean */
}

/* Mobile optimization */
@media (max-width: 640px) {
  .kaddu-lang-btn {
    padding: 5px 8px;
    font-size: 12px;
    gap: 5px;
  }
  .kaddu-lang-btn-name {
    display: none; /* Just show flag + arrow on compact mobile headers */
  }
  .kaddu-lang-menu {
    right: -8px;
    width: 240px;
  }
}

