/* 
========================================================================
== TỆP: CSS/DICHTHUAT.CSS
== CHỨC NĂNG: Nút dịch đa ngôn ngữ Google góc trên bên phải & Khắc phục Google Translate đẩy top xuống
========================================================================
*/

/* ----------------------------------------------------------------------
   1. KHẮC PHỤC TRIỆT ĐỂ GOOGLE TRANSLATE ĐẨY TOP KHỎI MÀN HÌNH
   ---------------------------------------------------------------------- */
html, body {
  top: 0px !important;
  position: static !important;
  margin-top: 0px !important;
  min-height: 100% !important;
}

/* Ẩn hoàn toàn khung Banner Top và Iframe Tooltip của Google Translate */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Ẩn khoảng trắng do Google tự động tiêm vào đầu trang */
body > .skiptranslate {
  display: none !important;
}

/* Tuỳ chỉnh phần tử Google Translate mặc định */
.goog-logo-link,
.goog-te-gadget span {
  display: none !important;
}

.goog-te-gadget {
  color: transparent !important;
  font-size: 0 !important;
}

.goog-te-gadget .goog-te-combo {
  background-color: rgba(20, 30, 25, 0.85);
  color: #fbf8ec;
  border: 1px solid var(--default-menu-border, #fbf8ec);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.goog-te-gadget .goog-te-combo:hover {
  border-color: #ffffff;
  background-color: rgba(30, 45, 35, 0.95);
}

/* ----------------------------------------------------------------------
   2. NÚT TRÒN NỔI GÓC TRÊN BÊN PHẢI (#dichthuat-btn)
   ---------------------------------------------------------------------- */
#dichthuat-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  z-index: 99999;
  cursor: pointer;
  background-color: var(--default-menu-color, rgba(50, 75, 60, 0.65));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--default-menu-border, #fbf8ec);
  box-shadow: 0 0 15px rgba(251, 248, 236, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  user-select: none;
}

#dichthuat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(251, 248, 236, 0.7), inset 0 0 12px rgba(255, 255, 255, 0.4);
  background-color: rgba(60, 90, 70, 0.85);
}

#dichthuat-btn:active {
  transform: scale(0.95);
}

/* Hiệu ứng viền xoay phát sáng tương tự các nút menu chính */
#dichthuat-btn::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 60%,
    rgba(255, 241, 1, 0.4) 85%,
    #fbf8ec 100%
  );
  z-index: -1;
  animation: dichthuat-border-rotate 4s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
}

@keyframes dichthuat-border-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#dichthuat-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: #fbf8ec;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s ease;
}

#dichthuat-btn:hover svg {
  transform: rotate(15deg) scale(1.1);
}

/* ----------------------------------------------------------------------
   3. MENU DROPDOWN DỊCH NGHĨA (#dichthuat-dropdown)
   ---------------------------------------------------------------------- */
#dichthuat-dropdown {
  position: fixed;
  top: 78px;
  right: 20px;
  width: 260px;
  max-height: 440px;
  background: rgba(22, 33, 27, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--default-menu-border, #fbf8ec);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(251, 248, 236, 0.25);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#dichthuat-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dichthuat-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(251, 248, 236, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fbf8ec;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.dichthuat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dichthuat-close-btn {
  cursor: pointer;
  font-size: 18px;
  color: rgba(251, 248, 236, 0.6);
  line-height: 1;
  transition: color 0.2s ease;
}

.dichthuat-close-btn:hover {
  color: #ffffff;
}

.dichthuat-body {
  padding: 12px;
  overflow-y: auto;
  max-height: 360px;
}

.dichthuat-body::-webkit-scrollbar {
  width: 5px;
}

.dichthuat-body::-webkit-scrollbar-thumb {
  background: rgba(251, 248, 236, 0.3);
  border-radius: 4px;
}

.dichthuat-lang-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.dichthuat-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #eeeeee;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.dichthuat-lang-item:hover {
  background: rgba(251, 248, 236, 0.18);
  border-color: rgba(251, 248, 236, 0.4);
  color: #ffffff;
  transform: translateX(3px);
}

.dichthuat-lang-item.active {
  background: rgba(251, 248, 236, 0.28);
  border-color: #fbf8ec;
  color: #ffffff;
  font-weight: bold;
}

.dichthuat-flag {
  font-size: 16px;
  line-height: 1;
}

.dichthuat-divider {
  height: 1px;
  background: rgba(251, 248, 236, 0.15);
  margin: 10px 0;
}

.dichthuat-other-label {
  font-size: 12px;
  color: rgba(251, 248, 236, 0.7);
  margin-bottom: 6px;
  font-weight: 500;
}

/* ----------------------------------------------------------------------
   4. RESPONSIVE CHO THIẾT BỊ DI ĐỘNG & TABLET
   ---------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  #dichthuat-btn {
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
  }

  #dichthuat-btn svg {
    width: 22px;
    height: 22px;
  }

  #dichthuat-dropdown {
    top: 68px;
    right: 15px;
    width: 235px;
    max-height: 390px;
  }

  .dichthuat-header {
    padding: 10px 14px;
    font-size: 13px;
  }

  .dichthuat-body {
    padding: 10px;
    max-height: 320px;
  }

  .dichthuat-lang-item {
    padding: 7px 10px;
    font-size: 12px;
  }
}
