/* ============================================================
   chatbot.css — Admission Chatbot Page
   ============================================================ */

.chatbot-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  max-width: 1200px;
  margin-inline: auto;
  padding: calc(88px + var(--space-8)) var(--space-6) var(--space-10);
  min-height: 100vh;
  align-items: start;
}

/* Chat Window */
.chat-window {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 2px solid var(--col-primary);
  box-shadow: var(--shadow-block);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--col-primary);
  flex-shrink: 0;
}
.chat-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-avatar svg { width: 22px; height: 22px; color: var(--col-accent-soft); }
.chat-header-info { flex: 1; }
.chat-header-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}
.chat-header-status {
  font-size: .8125rem;
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--col-success);
  box-shadow: 0 0 6px var(--col-success);
}
.chat-header-title {
  font-size: .8125rem;
  color: rgba(255,255,255,.4);
}

/* Chat body */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  background: var(--col-surface-low);
}
.chat-body::-webkit-scrollbar { width: 5px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: var(--col-outline); border-radius: 3px; }

/* Messages */
.msg {
  display: flex;
  gap: var(--space-3);
  max-width: 78%;
  animation: msg-in .2s ease;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-ai { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }

.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--col-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.msg-avatar svg { width: 16px; height: 16px; color: var(--col-accent-soft); }

.msg-bubble {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: .9375rem;
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
.msg-ai .msg-bubble {
  background: #fff;
  color: var(--col-on-surface);
  border-radius: var(--radius-sm) var(--radius-lg) var(--radius-lg) var(--radius-lg);
}
.msg-user .msg-bubble {
  background: var(--col-primary);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-sm) var(--radius-lg) var(--radius-lg);
}
.msg-time {
  font-size: .75rem;
  color: var(--col-on-muted);
  margin-top: var(--space-1);
  padding-inline: var(--space-2);
}
.msg-user .msg-time { text-align: right; }

/* Resources list */
.msg-resources {
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--col-surface-low);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--col-secondary);
}
.msg-resources-title {
  font-size: .8125rem;
  font-weight: 700;
  color: var(--col-secondary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.msg-resources-title svg { width: 14px; height: 14px; }
.msg-resources ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.msg-resources li a {
  font-size: .8125rem;
  color: var(--col-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.msg-resources li a:hover { color: var(--col-secondary-dim); }
.msg-resources li a svg { width: 12px; height: 12px; }

/* Typing indicator */
.msg-typing .msg-bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: var(--space-4) var(--space-5);
}
.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--col-outline);
  animation: typing-bounce .9s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: .15s; }
.typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); background: var(--col-outline); }
  40% { transform: translateY(-6px); background: var(--col-secondary); }
}

/* Disclaimer */
.chat-disclaimer {
  text-align: center;
  font-size: .75rem;
  color: var(--col-on-muted);
  padding: var(--space-3);
  background: #fff;
  border-top: 1px solid var(--col-outline);
  flex-shrink: 0;
}

/* Chat input area */
.chat-input-area {
  padding: var(--space-4) var(--space-6);
  background: #fff;
  border-top: 1px solid var(--col-outline);
  flex-shrink: 0;
}
.chat-input-wrap {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}
.chat-textarea {
  flex: 1;
  resize: none;
  max-height: 130px;
  min-height: 44px;
  padding: .75rem 1rem;
  background: var(--col-surface-low);
  border: 1.5px solid transparent;
  border-radius: var(--radius-lg);
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--col-on-surface);
  outline: none;
  transition: all var(--trs-base);
  overflow-y: auto;
  font-family: var(--font-body);
}
.chat-textarea:focus {
  background: #fff;
  border-color: var(--col-secondary);
  box-shadow: 0 0 0 3px rgba(0,96,172,.1);
}
.chat-textarea::placeholder { color: var(--col-outline); }
.chat-send {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--col-primary);
  color: #fff;
  border: 2px solid var(--col-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--trs-base);
}
.chat-send:hover {
  background: #fff;
  color: var(--col-primary);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-block);
}
.chat-send svg { width: 18px; height: 18px; }

/* Quick-reply chips */
.chat-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) var(--space-6) 0;
  background: #fff;
}
.chip {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: .8125rem;
  font-weight: 500;
  background: var(--col-surface-low);
  color: var(--col-on-muted);
  border: 1px solid var(--col-outline);
  cursor: pointer;
  transition: all var(--trs-fast);
  white-space: nowrap;
}
.chip:hover {
  background: var(--col-primary);
  color: #fff;
  border-color: var(--col-primary);
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0px var(--col-primary);
}

/* SIDEBAR */
.chat-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: sticky;
  top: 104px;
}
.sidebar-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  border: 2px solid var(--col-primary);
  box-shadow: var(--shadow-block);
}
.sidebar-card-title {
  font-family: var(--font-head);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--col-on-muted);
  margin-bottom: var(--space-4);
}
.sidebar-info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--col-surface-low);
}
.sidebar-info-item:last-child { border-bottom: none; padding-bottom: 0; }
.sii-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--col-surface-low);
  color: var(--col-secondary);
}
.sii-icon svg { width: 16px; height: 16px; }
.sii-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--col-on-surface);
  margin-bottom: 2px;
}
.sii-value {
  font-size: .8125rem;
  color: var(--col-on-muted);
  line-height: 1.4;
}

.chatbot-page body { background: var(--col-surface-low); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .chatbot-layout { grid-template-columns: 1fr; }
  .chat-sidebar { position: static; }
  .chat-window { min-height: 60vh; }
}
