/* WhatsApp-style dark theme */

body {
  background-color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #fff;
  margin: 0;
}

/* Phone-style frame */
#phone-frame {
  background-color: #0d1418;
  border-radius: 25px;
  width: 380px;
  height: 720px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.6);
  border: 2px solid #222;
}

/* Header */
#chat-header {
  background-color: #202c33;
  color: #e9edef;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 0.9em;
}

#chat-header button {
  background-color: #128C7E;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.8em;
  cursor: pointer;
  transition: background 0.3s ease;
}

#chat-header button:hover {
  background-color: #075E54;
}

/* Message area */
#messages {
  flex-grow: 1;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.message {
  max-width: 80%;
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.4em;
  font-size: 0.9em;
  white-space: pre-wrap;
}

.message.player {
  align-self: flex-end;
  background-color: #005C4B;
  color: #fff;
}

.message.narrator {
  align-self: flex-start;
  background-color: #202C33;
  color: #E9EDEF;
}

/* Typing indicator */
#typing-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 15px;
  margin-left: 10px;
}

.dot {
  height: 8px;
  width: 8px;
  background-color: #aaa;
  border-radius: 50%;
  margin-right: 5px;
  animation: blink 1.4s infinite both;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.hidden {
  display: none;
}

/* Input area */
#input-area {
  display: flex;
  background-color: #202C33;
  padding: 10px;
  align-items: center;
}

#user-input {
  flex: 1;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  background-color: #2A3942;
  color: #fff;
  outline: none;
}

#send-btn {
  background-color: #128C7E;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  margin-left: 8px;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
}

#send-btn:hover {
  background-color: #075E54;
}

/* Scrollbar styling */
#messages::-webkit-scrollbar {
  width: 6px;
}
#messages::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 3px;
}
/* Force-hide elements when marked as .hidden */
.hidden {
  display: none !important;
}
/* Message timestamps */
.timestamp {
  font-size: 0.7em;
  color: #999;
  text-align: right;
  margin-top: 4px;
}

.msg-text {
  white-space: pre-wrap;
}
