/* ==========================================================================
   TSH REBORN — GLOBAL PAGE TRANSLATION WIDGET & GOOGLE TRANSLATE CLEANUP
   ========================================================================== */

/* Hide legacy Google Translate top bar & highlight overlays without breaking widget execution */
iframe.goog-te-banner-frame,
.goog-te-banner-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
#goog-gt-tt,
.goog-te-balloon-frame,
body > .skiptranslate {
  display: none !important;
  visibility: hidden !important;
}

body {
  top: 0 !important;
  position: relative !important;
}

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

.tsh-gt-hidden-host {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Translate Control Container & Trigger Button */
.site-translate-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  font-family: 'Chakra Petch', sans-serif;
}

.tsh-translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid rgba(34, 211, 238, 0.38);
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.16s ease;
}

.tsh-translate-btn:hover,
.tsh-translate-btn[aria-expanded="true"] {
  border-color: #22d3ee;
  background: rgba(6, 182, 212, 0.18);
  color: #ffffff;
}

.tsh-translate-btn.is-active {
  border-color: rgba(255, 220, 53, 0.6);
  background: rgba(255, 220, 53, 0.14);
  color: #fde047;
}

.tsh-translate-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #22d3ee;
}

.tsh-translate-btn.is-active .tsh-translate-icon {
  color: #fde047;
}

.tsh-translate-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tsh-translate-btn.is-active .tsh-translate-badge {
  background: rgba(255, 220, 53, 0.22);
  color: #fef08a;
}

/* Popover Dropdown Menu */
.tsh-translate-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(8, 12, 24, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.85), 0 0 24px rgba(6, 182, 212, 0.18);
  z-index: 120;
  color: #f1f5f9;
  backdrop-filter: blur(14px);
}

.tsh-translate-menu[hidden] {
  display: none !important;
}

.tsh-translate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #94a3b8;
  text-transform: uppercase;
}

.tsh-translate-browser-tag {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-size: 9.5px;
}

.tsh-translate-quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.tsh-translate-auto,
.tsh-translate-reset {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  text-align: center;
  transition: filter 0.16s ease, transform 0.14s ease;
}

.tsh-translate-auto {
  border: 1px solid rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(59, 130, 246, 0.28));
  color: #e0f2fe;
}

.tsh-translate-reset {
  border: 1px solid rgba(255, 220, 53, 0.45);
  background: rgba(255, 220, 53, 0.12);
  color: #fde047;
}

.tsh-translate-auto:hover,
.tsh-translate-reset:hover {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

.tsh-translate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 211, 238, 0.4) transparent;
}

.tsh-lang-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tsh-lang-opt:hover {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(6, 182, 212, 0.12);
  color: #ffffff;
}

.tsh-lang-opt.is-selected {
  border-color: #22d3ee;
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
}

.tsh-lang-opt-code {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  opacity: 0.78;
  text-transform: uppercase;
}

.tsh-translate-status {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  line-height: 1.45;
  color: #94a3b8;
}

.tsh-translate-status a {
  color: #22d3ee;
  font-weight: 600;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .tsh-translate-btn {
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .tsh-translate-label {
    display: none;
  }
}
