/* 基礎重置 */
* {
  box-sizing: border-box;
}

.goog-te-combo {
  display: none !important;
}

/* 翻譯容器（自定義下拉）外層位置 */
.translate-container {
  position: relative;
  z-index: 9999;
  font-family: inherit;
  left: 20px;
}

/* 自定義下拉選單樣式 */
.custom-select {
  position: relative;
  display: inline-block;
  min-width: 200px;
}
.select-trigger {
  background: linear-gradient(135deg, rgb(241, 90, 36) 0%, rgb(237, 28, 35) 100%);
 
  color: white;
  padding: 12px 40px 12px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.select-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.select-trigger::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.select-trigger:hover::before {
  opacity: 1;
}

.select-trigger::after {
  content: '▼';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: transform 0.3s ease;
}

.custom-select.active .select-trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

/* 下拉選項容器 */
.select-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 8px;
}

.custom-select.active .select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 分組標題 */
.option-group {
  border-bottom: 1px solid #f0f0f0;
}

.option-group:last-child {
  border-bottom: none;
}

.group-title {
  padding: 12px 16px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8f9fa;
  margin: 0;
  border-bottom: 1px solid #e9ecef;
}

/* 選項樣式 */
.select-option {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.select-option:hover {
  background: #f8f9fa;
  border-left-color: #667eea;
  color: #667eea;
}

.select-option.selected {
  background: #e3f2fd;
  color: #1976d2;
  border-left-color: #1976d2;
  font-weight: 500;
}

/* 搜尋框 */
.search-box {
  padding: 12px 16px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: #667eea;
}

/* 隱藏原生 select */
#custom_translate_select {
  display: none;
}

/* 隱藏 Google Translate 元素 */
#google_translate_element {
  display: none !important;
}


/* 響應式設計 */
@media (max-width: 768px) {
  .translate-container {
    position: relative;
    top: 0px;
    left: 0px;
    /* right: 10px; */
  }

  .custom-select {
    min-width: 140px;
  }

  .select-trigger {
    padding: 10px 35px 10px 14px;
    font-size: 13px;
  }
}
@media (max-width: 500px) {
  .translate-container {
    left: 5px;
  }
}
/* 載入動畫 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 示例內容區域 */
.demo-content {
  max-width: 800px;
  margin: 100px auto 0;
  padding: 40px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.demo-content h1 {
  color: #333;
  margin-bottom: 20px;
}

.demo-content p {
  line-height: 1.6;
  color: #666;
  margin-bottom: 16px;
}

/* 當偵測到翻譯橫幅或 body 被推下時，將 header_div 往下移 15px */
.header_div.has-translate {
  top: 35px !important;
}

.main_div.has-translate {
  margin-top: 175px !important;
}


