/* Global Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #0d9488; /* Teal */
  --primary-hover: #0f766e;
  --bg-gradient: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 50%, #f5f3ff 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --border-color: rgba(226, 232, 240, 0.8);
  --text-dark: #0f172a;
  --text-muted: #475569;
  --cynthia-accent: #eab308; /* Ghana Gold */
  --beatrice-accent: #ef4444; /* First Aid Red */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-dark);
  line-height: 1.6;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 15px;
}

.main-container {
  width: min(100%, 1150px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* App Header styling */
.app-header {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand h1 {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0d9488, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

.pulse-icon {
  font-size: 1.8rem;
  background: linear-gradient(135deg, #0d9488, #06b6d4);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  animation: pulse 2.5s infinite;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Dashboard Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 20px;
}

/* Sidebar & Assistant Selection styling */
.sidebar-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.assistant-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.assistant-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.assistant-item:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.assistant-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.bg-cynthia {
  background: linear-gradient(135deg, #0284c7, #0d9488);
}

.bg-beatrice {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
}

.assistant-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.assistant-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assistant-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-dark);
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-ghana {
  background-color: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
}

.badge-medical {
  background-color: #ffe4e6;
  color: #9f1239;
  border: 1px solid #fecdd3;
}

.assistant-role {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--primary-color);
  margin-top: 2px;
}

.assistant-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Active State for Assistant Selector */
.assistant-item.active {
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.assistant-item#btn-cynthia.active {
  border-color: rgba(13, 148, 136, 0.4);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.12);
}

.assistant-item#btn-beatrice.active {
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1);
}

/* Medical Disclaimer Panel */
.medical-disclaimer {
  background: rgba(254, 243, 199, 0.5);
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 14px;
  font-size: 0.76rem;
  color: #78350f;
  margin-top: auto;
}

.medical-disclaimer strong {
  display: block;
  font-weight: 700;
}

/* Chat Container styling */
.chat-container {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 600px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.active-assistant-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: background 0.3s ease;
}

.chat-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
}

.active-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: statusPulse 1.8s infinite;
}

@keyframes statusPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Messages area styling */
.messages {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 16px;
}

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

.messages::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 10px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.2);
}

/* Message Rows */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  animation: messageAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.message-row.user {
  justify-content: flex-end;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2px;
}

.user-avatar {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
}

.bot-avatar {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* Chat bubble styling */
.message-bubble {
  max-width: 72%;
  padding: 12px 18px;
  border-radius: 20px;
  font-size: 0.92rem;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
}

.message-row.bot .message-bubble {
  background: #ffffff;
  color: var(--text-dark);
  border: 1px solid #f1f5f9;
  border-bottom-left-radius: 4px;
}

.message-row.user .message-bubble {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* Inside message styling (Lists, bullet points, linebreaks) */
.message-bubble ul, .message-bubble ol {
  margin: 8px 0 8px 20px;
  padding-left: 0;
}

.message-bubble li {
  margin-bottom: 6px;
}

.message-bubble li:last-child {
  margin-bottom: 0;
}

/* Typing Indicator animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 2px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
  animation: typing 1.4s infinite ease-in-out both;
  opacity: 0.6;
}

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

@keyframes typing {
  0%, 80%, 100% { transform: scale(0.6); }
  40% { transform: scale(1); }
}

/* Suggestion Chips */
.suggestion-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.suggestion-chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.suggestion-chip:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.15);
}

/* Form and Input field styling */
.chat-form {
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 4px 4px 4px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.input-wrapper .form-control {
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.92rem;
  color: var(--text-dark);
  border-radius: 0;
}

.input-wrapper .form-control:focus {
  outline: none;
  box-shadow: none;
}

.btn-send {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-send i {
  font-size: 0.95rem;
  margin-left: 2px;
}

/* Responsive styles */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .chat-container {
    height: 520px;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 10px;
  }
  
  .app-header {
    padding: 12px 16px;
  }
  
  .sidebar-card {
    padding: 16px;
  }
  
  .chat-container {
    padding: 16px;
    height: 480px;
  }
  
  .message-bubble {
    max-width: 85%;
    font-size: 0.88rem;
  }
}
