/* AidEM AI Agent Chat Drawer Styling */

.agent-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #0b57d0;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(11, 87, 208, 0.35);
  transition: all 0.2s ease;
  z-index: 100;
}

.agent-drawer-toggle:hover {
  background: #0842a0;
  transform: translateY(-1px);
}

.agent-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 450px;
  max-width: 92vw;
  background: #ffffff;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: Inter, system-ui, sans-serif;
}

.agent-drawer.open {
  transform: translateX(0);
}

.agent-drawer-header {
  padding: 16px 20px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agent-drawer-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-drawer-header .close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
}

.agent-drawer-header .close-btn:hover {
  color: #ffffff;
}

.agent-drawer-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  scroll-behavior: smooth;
}

/* Empty State / Welcome Screen */
.agent-drawer.empty-chat .agent-drawer-messages {
  justify-content: center;
  align-items: center;
}

.agent-welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px;
  max-width: 360px;
  margin: auto;
}

.agent-welcome-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.agent-welcome-card h4 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.agent-welcome-card p {
  margin: 0;
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.5;
}

.agent-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 95%;
  font-size: 13.5px;
  line-height: 1.5;
  scroll-margin-top: 16px;
}

.agent-msg.user {
  align-self: flex-end;
  background: #0b57d0;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 12px 12px 2px 12px;
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.2);
}

.agent-msg.assistant {
  align-self: flex-start;
  background: #ffffff;
  color: #1e293b;
  padding: 14px 16px;
  border-radius: 12px 12px 12px 2px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.agent-msg.assistant table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}

.agent-msg.assistant th,
.agent-msg.assistant td {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
}

.agent-msg.assistant th {
  background: #f1f5f9;
}

/* Suggestion Chips Section */
.agent-chips {
  padding: 10px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.agent-chips-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.agent-chips-title {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agent-chips-toggle-btn {
  background: none;
  border: none;
  padding: 2px 6px;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}

.agent-chips-toggle-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.agent-chips-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.agent-chips-body.collapsed {
  display: none;
}

.agent-chips-body.fading {
  opacity: 0.15;
  transform: translateY(2px);
}

/* Clean Light Grey Suggestion Chips */
.agent-chip {
  padding: 8px 12px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.agent-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.agent-chip .chip-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.agent-chip .chip-text {
  flex: 1;
}

.agent-drawer-input-row {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.agent-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.agent-input:focus {
  border-color: #0b57d0;
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.15);
}

.agent-send-btn {
  padding: 0 16px;
  height: 38px;
  background: #0b57d0;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.agent-send-btn:hover {
  background: #0842a0;
}

.agent-send-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}
