body { 
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4f7fa;
  color: #1f2d3d;
}

.container {
  max-width: 820px;
  margin: 20px auto;
  background: white;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

/* ===== Top Bar ===== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: 24px;
  color: #00667D;
  letter-spacing: 0.4px;
  font-weight: 700;
}

.lang-wrap select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #d8dee6;
  background: #fff;
  font-size: 13px;
  min-width: 150px;
  transition: all 0.2s ease;
}

.lang-wrap select:hover {
  border-color: #00667D;
}

/* ===== Clear Chat Button ===== */

.clear-btn {
  background: transparent;
  border: 1px solid #d8dee6;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #475467;
}

.clear-btn:hover {
  background: #f4f7fa;
  border-color: #00667D;
  color: #00667D;
}

/* ===== Chat Window ===== */

.chat-window {
  height: 380px;
  overflow-y: auto;
  border: 1px solid #e8edf2;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  background: #ffffff;
  scroll-behavior: smooth;
}

/* ===== Messages ===== */

.message {
  margin-bottom: 16px;
}

.user {
  font-weight: 800;
  margin-bottom: 6px;
  color: #334e68;
}

/* Wrapper allows copy button positioning */
.copilot-wrapper {
  position: relative;
}

/* Response bubble */
.copilot {
  background: #f2f8fa;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14.5px;
  border-left: 4px solid #00667D;
  animation: fadeIn 0.2s ease-in;
  white-space: normal;
}

/* ===== Copy Button ===== */

.copy-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
  color: #5f6c7b;
}

.copilot-wrapper:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  transform: scale(1.1);
  color: #00667D;
}

/* ===== Mode Badge ===== */

.mode-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.mode-badge.evidence {
  background: #e6f6f9;
  color: #00667D;
}

.mode-badge.ticket {
  background: #fff4e5;
  color: #b46900;
}

.mode-badge.general {
  background: #f0f0f0;
  color: #555;
}

/* ===== References ===== */

.metadata {
  font-size: 11.5px;
  color: #667;
  margin-top: 8px;
}

.metadata a {
  color: #00667D;
  font-weight: 600;
  text-decoration: none;
}

.metadata a:hover {
  text-decoration: underline;
}

.ref-sim {
  color: #999;
  font-size: 11px;
}

/* ===== Input Area ===== */

.input-area {
  display: flex;
  gap: 10px;
}

#userInput {
  flex: 1;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid #d8dee6;
  font-size: 14px;
  transition: all 0.2s ease;
}

#userInput:focus {
  outline: none;
  border-color: #00667D;
  box-shadow: 0 0 0 2px rgba(0, 102, 125, 0.1);
}

#sendBtn {
  padding: 12px 18px;
  background: #00667D;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  min-width: 100px;
  transition: all 0.2s ease;
}

#sendBtn:hover {
  background: #005463;
  transform: translateY(-1px);
}

#sendBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== Hint Text ===== */

.hint {
  margin-top: 10px;
  font-size: 11px;
  color: #7a8899;
  text-align: center;
}

/* ===== Loading Animation ===== */

.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}

.loader {
  display: flex;
  gap: 6px;
}

.loader span {
  width: 8px;
  height: 8px;
  background: #00667D;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.loader span:nth-child(2) {
  animation-delay: 0.2s;
}

.loader span:nth-child(3) {
  animation-delay: 0.4s;
}

.thinking-text {
  font-size: 12px;
  color: #667085;
  margin-top: 6px;
}

/* ===== Animations ===== */

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}