/* ===== Global ===== */
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #eef2f7;
  color: #333;
  /* display: flex;
  justify-content: center;
  align-items: center; */
  height: 100vh;
}

/* ===== Container ===== */
.app {
  width: 70%;
  height: 80vh;
  background: #fdfdfd;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
header {
  background: #4b7bec;
  color: white;
  font-size: 1.05em;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .logo {
  font-weight: bold;
  letter-spacing: 0.5px;
}

.header-buttons button {
  background: white;
  color: #4b7bec;
  border: none;
  border-radius: 6px;
  margin-left: 6px;
  padding: 4px 8px;
  font-size: 0.8em;
  cursor: pointer;
  transition: 0.2s;
}

.header-buttons button:hover {
  background: #dfe4ea;
}

/* ===== Chat Messages ===== */
.messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.bubble {
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  max-width: 80%;
  line-height: 1.4em;
  position: relative;
}

.bubble.user {
  background: #4b7bec;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.bubble.bot {
  background: #e9ecef;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* Typing dots */
.typing .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  background: #888;
  border-radius: 50%;
  animation: blink 1s infinite;
}
@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* ===== Form ===== */
#chat-form {
  display: flex;
  border-top: 1px solid #ddd;
  background: #fafafa;
  padding: 10px;
}

#input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 14px;
  resize: none;
  font-size: 15px;
  outline: none;
  background: #fff;
  margin-right: 8px;
  height: 52px;
}

#chat-form button {
  background: #4b7bec;
  color: white;
  border: none;
  padding: 0 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}

#chat-form button:hover {
  background: #3867d6;
}

/* ===== Rating Buttons ===== */
.rating {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}
.rating button {
  background: #f1f1f1;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 14px;
}
.rating button:hover {
  background: #ddd;
}
.rating button.active {
  background: #4b7bec;
  color: #fff;
}

/* ===== Help Popup ===== */
.popup {
  display: none;
  position: fixed;
  z-index: 99;
  left: 0; top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  justify-content: center;
  align-items: center;
}
.popup-content {
  background: white;
  padding: 20px;
  border-radius: 14px;
  width: 320px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  position: relative;
  text-align: left;
  animation: pop 0.3s ease;
}
.popup-content h2 {
  margin-top: 0;
  color: #4b7bec;
}
.popup-content p {
  line-height: 1.5em;
  font-size: 0.95em;
}
#close-popup {
  position: absolute;
  right: 10px;
  top: 6px;
  font-size: 20px;
  color: #555;
  cursor: pointer;
}
#close-popup:hover {
  color: #000;
}
@keyframes pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
