* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background: #f4f6f9;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 100;
}

.logo {
  font-weight: bold;
  font-size: 20px;
}

#status {
  font-weight: bold;
  color: #555;
}

.main {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 60px; 
  right: 0;
  display: flex;
}

.ai-stage {
  position: relative;
  flex: 2;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ai-stage video {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  transition: opacity 0.25s ease;
}

#video-idle    { opacity: 1; }
#video-talking { opacity: 0; }
#video-thinking2{ opacity: 0; }

#video-thinking1{ opacity: 0; }
.chat-container {
  flex: 1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #ddd;
  min-width: 320px;
  overflow: hidden;
}

#chat-box {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
}

.message {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
}

.message.user { background: #e3f2fd; }
.message.ai   { background: #f1f8e9; }

.input-area {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  gap: 5px;
  flex-shrink: 0;
}

#user-input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

button {
  padding: 8px 12px;
  border: none;
  cursor: pointer;
  border-radius: 5px;
}

#send-btn { background: #4caf50; color: white; }
#mic-btn.recording { background: red; color: white; }

#clear-chat {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53935;
  color: white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#clear-chat:hover { background: #c62828; }

#teacher-toggle {
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}

#teacher-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: white;
  box-shadow: -4px 0 15px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  padding: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#teacher-panel.open { right: 0; }

#teacher-panel h2 { margin: 0; }

#teacher-panel textarea {
  width: 100%;
  height: 200px;
  resize: vertical;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#close-teacher {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

#teacher-play {
  background: #1976d2;
  color: white;
  padding: 10px;
  border-radius: 6px;
  font-size: 15px;
}
#bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: white;
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}
#teacher-play:hover { background: #1565c0; }