/* === extra.css — AI, Live, Gamification === */

:root {
  --vnpt-blue: #005baa;
  --vnpt-deep: #071a33;
  --vnpt-gold: #ffd700;
  --glass-bg: rgba(7, 26, 51, 0.95);
  --vnpt-grad: linear-gradient(135deg, rgba(7, 26, 51, 0.98), rgba(0, 91, 170, 0.92));
}

/* 1. AI CHAT WINDOW */
.ai-chat-window {
  position: fixed;
  bottom: 120px;
  left: 20px;
  width: 340px;
  height: 480px;
  background: var(--vnpt-grad);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(0, 91, 170, 0.4);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.ai-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ai-chat-title {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-status-dot {
  width: 8px;
  height: 8px;
  background: #00ff00;
  border-radius: 50%;
  box-shadow: 0 0 10px #00ff00;
}
.ai-chat-close { color: rgba(255,255,255,0.6); cursor: pointer; }

.ai-chat-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-msg {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 85%;
}
.ai-msg-bot {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.ai-msg-user {
  background: var(--vnpt-blue);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.ai-chat-footer {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 10px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}
.ai-chat-footer input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  padding: 8px 16px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.ai-chat-footer button {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
}

/* 2. LIVE GROUP PANEL */
.live-group-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  width: 380px;
  background: var(--vnpt-grad);
  border: 1px solid rgba(0, 91, 170, 0.4);
  border-radius: 24px;
  z-index: 11000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}
.live-group-panel.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }

.live-header { display: flex; justify-content: space-between; font-weight: 800; color: var(--vnpt-gold); letter-spacing: 1px; font-size: 13px; margin-bottom: 15px; }
.live-info-box { background: rgba(0,0,0,0.3); padding: 12px; border-radius: 12px; margin-bottom: 20px; }
.live-guide { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 13px; }
.live-guide img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--vnpt-gold); }

.live-avatar-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.1); }
.live-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; border: 1.5px solid rgba(255,255,255,0.2); transition: all 0.3s; }
.live-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-more { background: rgba(255,255,255,0.1); display: flex; justify-content: center; align-items: center; font-size: 10px; color: #fff; font-weight: 700; width: 40px !important; border-radius: 10px !important; }

/* 3. GAMIFICATION PANEL */
.gamification-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  width: 420px;
  background: var(--vnpt-grad);
  border: 1.5px solid var(--vnpt-gold); /* Huy hiệu thì viền vàng mạnh hơn */
  border-radius: 24px;
  z-index: 11000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.2);
}
.gamification-panel.active { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }

.game-header { color: #fff; font-weight: 800; letter-spacing: 2px; text-align: center; margin-bottom: 25px; font-size: 14px; position: relative; }
.badge-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px; }
.badge-item { background: rgba(0,0,0,0.3); padding: 15px 10px; border-radius: 16px; text-align: center; border: 1px solid rgba(255,255,255,0.05); }
.badge-item.active { background: rgba(255, 215, 0, 0.1); border-color: var(--vnpt-gold); }
.badge-icon { font-size: 24px; margin-bottom: 8px; }
.badge-txt { color: #fff; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.badge-item.locked { opacity: 0.5; filter: grayscale(1); }

.quiz-card { background: rgba(0,0,0,0.3); padding: 16px; border-radius: 12px; color: #fff; font-size: 13px; line-height: 1.6; margin-top: 10px; }
.quiz-title { color: var(--vnpt-gold); font-weight: 800; font-size: 11px; text-transform: uppercase; }
.quiz-opts { display: flex; gap: 10px; margin-top: 12px; }
.quiz-opt { flex: 1; padding: 8px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; border-radius: 8px; cursor: pointer; transition: 0.3s; }
.quiz-opt:hover { background: var(--vnpt-blue); border-color: #fff; }

/* MISC */
.live-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff0000;
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  padding: 2px 4px;
  border-radius: 4px;
  box-shadow: 0 0 10px #ff0000;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .ai-chat-window, .live-group-panel, .gamification-panel { width: 92vw; left: 4vw; border-radius: 16px; }
  .ai-chat-window { height: 75vh; bottom: 80px; }
}

/* 4. GUIDE VIDEO POPUP (Video hướng dẫn di chuyển) */
.guide-video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  z-index: 9999999;
  display: flex;
  justify-content: center;
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.guide-video-overlay.active {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  visibility: visible;
  opacity: 1;
}

.guide-video-container {
  width: min(90%, 900px);
  background: #ffffff;
  border: none;
  border-radius: 18px;
  overflow: hidden;
  transform: translateY(40px) scale(0.96);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.guide-video-overlay.active .guide-video-container {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.guide-video-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.guide-video-title {
  color: #111111;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1.5px;
}

.guide-video-close {
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.25s ease;
}
.guide-video-close:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.08);
}

.guide-video-player {
  display: block;
  width: 100%;
  max-height: 78vh;
  background: #000;
}

@media (max-width: 480px) {
  .guide-video-container { width: 94vw; border-radius: 14px; }
  .guide-video-player { max-height: 55vh; }
}
