/* 기본 초기화 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #050505;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

#app {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

/* 최초 오디오 가동 전 오버레이막 */
#audioOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#audioBtn {
  padding: 18px 38px;
  font-size: 18px;
  font-weight: 700;
  background-color: #ffffff;
  color: #000000;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: all 0.2s ease;
}

#audioBtn:hover {
  transform: scale(1.06);
  background-color: #f3f3f3;
}

/* 메인 화면 우측 하단 컨트롤 타워 UI */
#mainControlTower {
  position: absolute;
  bottom: 105px; 
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 1000;
}

.main-ctrl-btn {
  width: 58px;
  height: 58px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font-size: 14px; 
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.main-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  transform: scale(1.08);
}

/* 토글 상태별 활성화 디자인 */
.main-ctrl-btn.active, .main-ctrl-btn.rest-on {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* AI 트리거 토글 버튼 */
#aiBtn {
  position: absolute;
  bottom: 30px;
  right: 30px;
  width: 58px;
  height: 58px;
  background-color: #ffffff;
  color: #000000;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(255,255,255,0.3);
  transition: all 0.2s ease;
}

#aiBtn:hover {
  transform: scale(1.08);
}

/* AI 대화창 프레임 디자인 */
#chatPanel {
  position: absolute;
  bottom: 105px;
  right: 100px;
  width: 370px;
  height: 490px;
  background: rgba(15, 15, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 0 12px 36px rgba(0,0,0,0.7);
  overflow: hidden;
}

#chatHeader {
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}

#chatBody {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#chatBody::-webkit-scrollbar {
  width: 4px;
}
#chatBody::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
}

.msg.user {
  background: #ffffff;
  color: #000000;
  align-self: flex-end;
}

.msg.ai {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  align-self: flex-start;
}

#suggestBox {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.suggest-btn {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.suggest-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

#chatInputArea {
  padding: 12px;
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f0f0f;
}

#chatInput {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 13px;
}

#chatInput:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
}

#chatSend {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 6px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.hidden {
  display: none !important;
}