/* 🌙 컬러 변수 설정 (다크 테마 기본) */
:root {
  --color-bg: #111;
  --color-accent: #00ffcc;
  --color-accent-hover: #00ccaa;
  --color-text: #fff;
  --color-user: #000;
  --color-bot: #333;
  --color-border: #444;
  --color-input-bg: #1f1f1f;
}

/* 🌐 공통 기본 스타일 */
body {
  margin: 0;
  padding: 0;
  background: var(--color-bg) url('GYM.png') center center / cover no-repeat;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  color: var(--color-text);
}

/* 💬 채팅 UI 컨테이너 */
.chat-wrapper {
  width: 400px;
  max-width: 90%;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 15px var(--color-accent);
  border: 3px solid var(--color-accent);
  margin-top: 40px;
  margin-bottom: 80px;
}

/* 🏷️ 상단 제목 */
.header {
  text-align: center;
}

h1 {
  color: var(--color-accent);
  font-size: 28px;
  font-weight: 900;
}

/* 🧍‍♂️ 캐릭터 이미지 */
.seabum {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin-bottom: 15px;
  border-radius: 10px;
}

/* 💬 채팅 박스 */
.chat-box {
  height: 30vh;
  max-height: 300px;
  overflow-y: auto;
  background-color: var(--color-bot);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--color-border);
}

/* 🗣️ 메시지 공통 */
.message {
  padding: 10px 12px;
  border-radius: 8px;
  max-width: 80%;
  word-break: break-word;
  font-size: 14px;
}

/* 🙋‍♂️ 사용자 메시지 */
.user {
  align-self: flex-end;
  background-color: var(--color-accent);
  color: var(--color-user);
}

/* 🤖 봇 메시지 */
.bot {
  align-self: flex-start;
  background-color: var(--color-bot);
  border: 1px solid var(--color-accent);
  color: #f1f1f1;
}

/* ⌨️ 입력창 영역 */
.input-group {
  display: flex;
  gap: 10px;
}

input {
  flex-grow: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-input-bg);
  color: var(--color-text);
  font-family: inherit;
}

button {
  padding: 10px 15px;
  border: none;
  background: var(--color-accent);
  color: var(--color-user);
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: var(--color-accent-hover);
}

/* 📢 광고 배너 영역 (선택) */
.ad-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 15px;
  min-width: 320px;
  min-height: 100px;
}

/* 📱 반응형 스타일 */
@media screen and (max-width: 480px) {
  body {
    padding-bottom: 120px; /* 키보드 대비 */
  }

  .chat-wrapper {
    width: 95%;
    padding: 15px;
    margin-bottom: 40px;
  }

  .chat-box {
    height: 30vh;
  }

  .seabum {
    max-height: 200px;
  }

  h1 {
    font-size: 18px;
  }

  h3 {
    font-size: 12px;
  }
}

/* 🔄 로딩 스피너 */
.loader {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: blink 1.2s infinite ease-in-out;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  40% {
    opacity: 1;
    transform: scale(1.5);
  }
}
