/* 主題切換按鈕容器 - 右上角固定 */
.theme-toggle-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 10px;
  flex-direction: column;
}

/* 按鈕基礎樣式 */
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #dddddd;
  background-color: #ffffff;
  color: #333333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hover 效果 */
.theme-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: #aaaaaa;
}

/* Focus 狀態 */
.theme-toggle-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.5);
}

/* Active 狀態 */
.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* 深色模式下的按鈕樣式 */
body[data-dark-theme="true"] .theme-toggle-btn {
  background-color: #2d2d2d;
  color: #f0f0f0;
  border-color: #555555;
}

body[data-dark-theme="true"] .theme-toggle-btn:hover {
  border-color: #888888;
  background-color: #3d3d3d;
}

/* 藍色主題下的按鈕樣式 */
body[data-theme="blue"] .theme-toggle-btn {
  border-color: #007bff;
}

body[data-theme="blue"] .theme-toggle-btn:hover {
  background-color: #e7f3ff;
  border-color: #0056b3;
}

body[data-dark-theme="true"][data-theme="blue"] .theme-toggle-btn:hover {
  background-color: #1a3a5c;
}

/* 綠色主題下的按鈕樣式 */
body[data-theme="green"] .theme-toggle-btn {
  border-color: #28a745;
}

body[data-theme="green"] .theme-toggle-btn:hover {
  background-color: #e6f9e6;
  border-color: #1e7e34;
}

body[data-dark-theme="true"][data-theme="green"] .theme-toggle-btn:hover {
  background-color: #1a4d2e;
}

/* 響應式設計 - 平板 */
@media (max-width: 768px) {
  .theme-toggle-container {
    top: 15px;
    right: 15px;
    gap: 8px;
  }

  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* 響應式設計 - 手機 */
@media (max-width: 480px) {
  .theme-toggle-container {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
}

/* 平滑過渡動畫 */
/* 重要: html 和 body 必須同步,避免切換時出現白色橫列 */
html,
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* 避免影響某些元素的過渡 */
img, video, iframe {
  transition: none;
}
