* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #4285f4 0%, #34a853 50%, #fbbc05 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

ul {
  margin-bottom: 0px;
}

.chat-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 850px;
  height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: white;
  padding: 8px;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.api-key-section {
  background: #f8f9fa;
  padding: 15px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
  align-items: center;
}

.api-key-input {
  flex: 1;
  padding: 10px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.api-key-input:focus {
  outline: none;
  border-color: #4285f4;
}

.save-key-btn {
  background: #34a853;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.save-key-btn:hover {
  background: #2d8e47;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ea4335;
  display: inline-block;
  margin-left: 10px;
  transition: background 0.3s ease;
}

.status-indicator.connected {
  background: #34a853;
}

.chat-messages {
  flex: 1;
  padding: 20px;
  padding-top: 20px;
  padding-bottom: 20px;
  padding-left: 10px;
  padding-right: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  animation: slideIn 0.3s ease;
}

.message.user {
  background: linear-gradient(135deg, #4285f4, #1a73e8);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.message.assistant {
  background: #f1f3f4;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.message.system {
  background: #fff3cd;
  color: #856404;
  align-self: center;
  font-size: 12px;
  max-width: 100%;
  text-align: center;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #f1f3f4;
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  max-width: 80px;
  align-self: flex-start;
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.chat-input-container {
  padding: 20px;
  background: white;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 10px;
  margin: 0;
  justify-content: center;
}

.chat-input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid #e9ecef;
  border-radius: 25px;
  font-size: 14px;
  resize: none;
  max-height: 100px;
  transition: border-color 0.3s ease;
  margin-bottom: 5px;
}

.chat-input:focus {
  outline: none;
  border-color: #4285f4;
}

.send-btn {
  background: linear-gradient(135deg, #4285f4, #1a73e8);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.3s ease;
  min-width: 80px;
}

.send-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.info-section {
  background: #e8f0fe;
  padding: 5px 10px;
  font-size: 12px;
  color: #1967d2;
  text-align: center;
  border-bottom: 1px solid #e9ecef;
}

.info-section a {
  color: #1967d2;
  text-decoration: none;
  font-weight: 600;
}

.info-section a:hover {
  text-decoration: underline;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-10px);
  }
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.agent-selector {
  display: flex;
  flex-direction: column;
  margin-bottom: 5px;
}

.agent-selector > select {
  background: #e8f0fe;
  border: none;
  padding: 10px 10px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.3s ease;
  min-width: 80px;
}
