* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  font-family: "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif, serif;
  background-image:
    radial-gradient(73% 147%, #eadfdf 59%, #ece2df 100%),
    radial-gradient(
      91% 146%,
      rgba(255, 255, 255, 0.5) 47%,
      rgba(0, 0, 0, 0.5) 100%
    );
  background-blend-mode: screen;
  background-size: cover;
  height: 100vh;
  /* overflow: hidden; */
}

.container {
  max-width: 1400px;
  width: 95%;
  margin: 0 auto;
  /* height: 100vh; */
  display: flex;
  flex-direction: column;
}

/* 註冊與登入畫面 */
.wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.member-title {
  color: #333;
  text-align: center;
  margin-bottom: 20px;
}
.member {
  color: #333;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.member-box {
  border: none;
  border-radius: 50px;
  padding: 10px;
  margin: 10px;
}
.member-btn {
  width: 150px;
  border: none;
  border-radius: 50px;
  padding: 10px;
  margin-top: 20px;
  background: #4de6a7;
  cursor: pointer;
}
.member > p > input {
  border: none;
  outline: none;
}

.member-choose > a {
  color: #333;
}
/* 導覽列 */
.navbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.navbar img {
  width: 180px;
}

.nav-items {
  display: flex;
  list-style: none;
}

.nav-items a {
  text-decoration: none;
  padding: 10px 20px;
  color: #333;
  font-weight: bold;
}

/* 主內容區塊左右並排 */
.main-content {
  flex: 1;
  display: flex;
  gap: 30px;
  padding-bottom: 20px;
  overflow: hidden;
}

/* 左側影片區 */
.video-side {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.main-video-player {
  background: #fff;
  padding-bottom: 15px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.iframe-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.current-video-title {
  color: #444;
  font-size: 18px;
  margin-top: 10px;
  margin-left: 10px;
}

/* 影片按鈕區 */
.video-controls {
  border-radius: 15px;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.v-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.v-btn.active {
  background: #4ce6a5;
  color: white;
}

.v-btn:hover {
  background: #eef1f5;
}

/* 右側代理人區 */
.teacher-side {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.teacher-container {
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 10px;
}

.teacher-profile {
  display: none;
  text-align: center;
  width: 100%;
}
.teacher-profile.active {
  display: block;
}

.teacher-circle,
.camera-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.teacher-circle img,
.video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video {
  transform: scaleX(-1);
}

.teacher-select {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #ccc;
}

/* ChatGPT */
.chatAI-icon {
  position: fixed;
  bottom: 30px;
  right: 70px;
  width: 70px;
  height: 70px;
  cursor: pointer;
  z-index: 100; /* 確保在最上層 */
  transition: transform 0.2s;
}

.chatAI-icon:hover {
  transform: scale(1.1);
}

.chatAI-icon img {
  width: 100%;
  height: 100%;
}

/* 聊天視窗本體 */
.chatAI {
  display: none; /* 預設隱藏 */
  position: fixed; /* 關鍵：使用 fixed 定位，才不會被影片擠壓 */
  right: 70px;
  bottom: 130px; /* 位於圖示上方 */
  width: 350px;
  height: 500px;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 9998;
  overflow: hidden; /* 確保圓角效果 */
  flex-direction: column;
}

/* 當 JS 切換 .open 類別時顯示 */
.chatAI.open {
  display: flex;
}

.chatAI-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.chatAI-header {
  background-color: #4ce6a5;
  padding: 15px;
  color: white;
  text-align: center;
}

.chatAI-title {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}
.chat-widget-area {
  display: block;
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 100;
}
.chatAI-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #f9f9f9;
  overflow: hidden;
}

.chatAI-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 訊息對話框樣式 */
.chatAI-msg {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatAI-msg.bot {
  background-color: #e6e9f0;
  align-self: flex-start;
  color: #333;
}

.chatAI-msg.user {
  background-color: #4ce6a5;
  color: white;
  align-self: flex-end;
}

/* 表單區塊 */
.chatAI-form {
  display: flex;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #eee;
  gap: 10px;
}

.chatAI-form input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 15px;
  outline: none;
}

.chatAI-btn {
  background-color: #4ce6a5;
  color: white;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 推薦區塊 */
.recommend-box {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #74aa9c;
  border-radius: 15px;
  padding: 20px;
  margin-top: 15px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.RTitle {
  font-size: 16px;
  font-weight: bold;
  color: #4ce6a5;
  margin-bottom: 10px;
}

/* 影片內入彈出視窗 */
.video-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.7);

  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px); /* 背景模糊 */
}
.recommend-card {
  background: #fff;
  width: 80%;
  max-width: 400px;
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.4s ease-out; /* 彈出動畫 */
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.card-header {
  font-size: 16px;
  color: #4ce6a5;
  font-weight: bold;
  margin-bottom: 15px;
}

.card-body p {
  color: #555;
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-btn {
  font-weight: bold;
  margin: 5px;
  padding: 10px 25px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: 0.3s;
}

.modal-btn.confirm {
  color: #fff;
  background: #4ce6a5;
}
.modal-btn.retry {
  color: #666;
  background: #eee;
}

.modal-btn:hover {
  opacity: 0.8;
  transform: scale(1.05);
}
.modal-btn.recommend {
  background: #9b59b6;
  color: white;
}

/* 已完成的按鈕樣式 */
.v-btn.completed {
  border-left: 5px solid #4ce6a5; /* 左側綠色條 */
  background-color: #f8fff9;
}

/* 單元標題樣式 */
.unit-header {
  width: 100%;
  padding: 12px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  text-align: left;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s;
}

.unit-header:hover {
  background: #e9ecef;
}

/* 漢堡選單按鈕 */
.menu-toggle {
  position: fixed;
  left: 0;
  top: 100px;
  z-index: 1001;
  writing-mode: vertical-lr;
  padding: 20px 10px;
  background: #333;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 0 8px 8px 0;
  font-size: 16px;
  letter-spacing: 2px;
}

/* 側邊欄本體 */
.video-controls.sidebar {
  position: fixed;
  left: -450px;
  top: 0;
  width: 450px;
  height: 100%;
  background: #fff;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
  overflow-y: auto;
}
.video-controls.sidebar.open {
  left: 0;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}
.close-sidebar {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* 遮罩層 */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* 課程清單樣式 */
.unit-content {
  display: none;
  padding: 5px;
  border: 1px solid #ddd;
  border-top: none;
}
.unit-content.active {
  display: block;
}

.course-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.course-item {
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
  color: #666;
  font-size: 14px;
}
.course-item.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

/* 讓影片區域在選單關閉時能自動填滿 (根據原本佈局調整) */
.video-side {
  width: 100%; /* 既然選單收起來了，影片可以給 100% */
}
