* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --finxpert-blue: #ff8b2c;
  --finxpert-dark: #171924;
  --finxpert-light: #f7e9d7;
  --finxpert-accent: #e27100;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --border-color: #E0E0E0;
  --shadow: 0 4px 20px rgba(255, 128, 0, 0.1);
}

.chat-wrapper {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-header {
  text-align: center;
  color: var(--finxpert-dark);
  margin-bottom: 10px;
}

.brand-header img {
  width: 250px !important;
  height: 100px;
  object-fit: contain;
}

.brand-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--finxpert-blue);
}

.brand-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

.chat-container {
  width: 100%;
  height: 650px;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.chat-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-header-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.chat-header-text h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.chat-header-text p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.session-info {
  background: var(--finxpert-light);
  padding: 12px 24px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-indicator {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #FAFAFA;
  scroll-behavior: smooth;
}

.messages::-webkit-scrollbar {
  width: 8px;
}

.messages::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.messages::-webkit-scrollbar-thumb {
  background: var(--finxpert-blue);
  border-radius: 4px;
}

.message {
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
  display: flex;
  gap: 12px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.message-user .message-avatar {
  background: linear-gradient(135deg, var(--finxpert-blue) 0%, var(--finxpert-accent) 100%);
  color: white;
}

.message-agent .message-avatar {
  background: var(--finxpert-light);
  color: var(--finxpert-blue);
}

.message-content {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: 16px;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 15px;
}

.message-user .message-bubble {
  background: linear-gradient(135deg, var(--finxpert-blue) 0%, var(--finxpert-accent) 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-agent .message-bubble {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.message-time {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0 4px;
}

.message-user .message-time {
  text-align: right;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 16px;
  background: white;
  border-radius: 16px;
  width: fit-content;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--finxpert-blue);
  animation: typingDot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingDot {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }

  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.input-area {
  padding: 20px 24px;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: center;
}

#messageInput {
  flex: 1;
  padding: 14px 20px;
  border: 2px solid var(--border-color);
  border-radius: 24px;
  font-size: 15px;
  outline: none;
  transition: all 0.3s;
  font-family: inherit;
}

#messageInput:focus {
  border-color: var(--finxpert-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

#sendButton {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--finxpert-blue) 0%, var(--finxpert-dark) 100%);
  color: white;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

#sendButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

#sendButton:active {
  transform: translateY(0);
}

#sendButton:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.status {
  padding: 12px 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

.status.success {
  background: #D1FAE5;
  color: #065F46;
  border-top: 2px solid #10B981;
}

.status.error {
  background: #FEE2E2;
  color: #991B1B;
  border-top: 2px solid #EF4444;
}

.footer-info {
  text-align: center;
  padding: 16px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-info strong {
  color: var(--finxpert-blue);
}

/* Responsive */
@media (max-width: 768px) {
  .chat-container {
    height: calc(100vh - 140px);
    min-height: 500px;
  }

  .brand-header h1 {
    font-size: 24px;
  }

  .message-content {
    max-width: 80%;
  }

  .chat-header {
    padding: 20px;
  }

  .messages {
    padding: 16px;
  }

  .input-area {
    padding: 16px;
  }
}

/* Welcome message style */
.welcome-message {
  background: linear-gradient(135deg, var(--finxpert-light) 0%, white 100%);
  border: 2px solid var(--finxpert-blue);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.welcome-message h3 {
  color: var(--finxpert-blue);
  margin-bottom: 12px;
  font-size: 18px;
}

.welcome-message p {
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.welcome-message ul {
  margin-left: 20px;
  margin-top: 8px;
  color: var(--text-secondary);
}

.welcome-message li {
  margin-bottom: 4px;
}