:root {
  --accent-color: #007bff;
  --header-bg: #2c2c2c;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color: #121212;
  font-family: Arial, sans-serif;
  transition: background-color 0.3s ease;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 600px;
  max-width: 100%;
  background-color: #1f1f1f;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.chat-header {
  background-color: var(--header-bg);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trash-icon {
  cursor: pointer;
  font-size: 18px;
  color: #bbb;
  transition: color 0.2s;
}

.trash-icon:hover {
  color: #fff;
}

.header-title {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
}

.theme-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Tombol untuk membuka panel pilihan theme */
.theme-toggle-btn {
  width: 24px;
  height: 24px;
  border: none;
  background-color: var(--accent-color);
  border-radius: 40%;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.3s;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  opacity: 0.9;
}

/* Panel pilihan theme */
.theme-options {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 8px;
  z-index: 9999;
  box-shadow: 0px 0px 8px rgba(0,0,0,0.2);
}

.theme-options button {
  width: 25px;
  height: 25px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  margin: 4px;
  transition: transform 0.2s, opacity 0.3s;
}

.theme-options button:hover {
  transform: scale(1.2);
  opacity: 1;
}

/* Dropdown Server */
.server-label {
  position: relative; 
  cursor: pointer;
  color: #ccc;
  margin-right: 10px;
  display: inline-block;
}

#server-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  color: #000;
  border: 1px solid #ccc;
  padding: 5px;
  margin-top: 5px;
  z-index: 9999;
  min-width: 100px;
}

#server-dropdown ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

#server-dropdown li {
  padding: 5px;
  cursor: pointer;
}

#server-dropdown li:hover {
  background: #eee;
}
    
/* Chat Body */
.chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 10px;
  background-color: #1f1f1f;
}

.messages-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.message {
  max-width: 80%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  color: #fff;
  word-wrap: break-word;
}

.user-message {
  background-color: var(--accent-color);
  align-self: flex-end;
}

.bot-message {
  background-color: #333;
  align-self: flex-start;
}

.chat-footer {
  background-color: #121212;
  padding: 10px;
  border-top: 1px solid #333;
}

.chat-footer form {
  display: flex;
  align-items: center;
  width: 100%;
  background-color: #2c2c2c;
  border-radius: 25px;
  padding: 5px 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  margin: 0;
}

.chat-footer input[type="text"] {
  flex: 1;
  border: none;
  background-color: transparent;
  padding: 10px;
  font-size: 14px;
  color: #fff;
  outline: none;
}

.chat-footer input[type="text"]::placeholder {
  color: #999;
}

.chat-footer button {
  background-color: var(--accent-color);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  transition: background-color 0.3s ease;
}

.chat-footer button:hover {
  filter: brightness(90%);
}

.chat-footer button svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
}

.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--accent-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

.message-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 5px;
  border-radius: 10px;
  border: 0.2px solid yellow;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
