/* ===================================================
   ICS AI Chatbot — Styles v2.0
   Brand: Navy Blue (#0a1628), Pastel Green (#7ec8a0), White
   =================================================== */
:root {
  --ics-navy:       #0a1628;
  --ics-navy-mid:   #112240;
  --ics-green:      #7ec8a0;
  --ics-green-dark: #5aaa82;
  --ics-white:      #ffffff;
  --ics-gray-light: #f4f6f9;
  --ics-gray:       #8a9bb0;
  --ics-shadow:     0 8px 40px rgba(10,22,40,.22);
  --ics-radius:     16px;
  --ics-font-ui:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#ics-chat-root {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 999999;
  font-family: var(--ics-font-ui);
}

/* ── Launcher ──────────────────────────────────────── */
#ics-chat-launcher {
  display: flex; align-items: center; gap: 8px;
  background: var(--ics-navy);
  color: var(--ics-white);
  border: 2px solid var(--ics-green);
  border-radius: 50px;
  padding: 12px 20px 12px 16px;
  cursor: pointer;
  box-shadow: var(--ics-shadow);
  font-size: 14px; font-weight: 600; letter-spacing: .04em;
  transition: transform .2s, box-shadow .2s;
}
#ics-chat-launcher svg { width: 20px; height: 20px; fill: var(--ics-green); }
#ics-chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 48px rgba(10,22,40,.32); }
#ics-chat-launcher.ics-open { display: none; }

/* ── Chat Window ───────────────────────────────────── */
#ics-chat-window {
  display: none; flex-direction: column;
  width: 360px; height: 560px;
  background: var(--ics-white);
  border-radius: var(--ics-radius);
  box-shadow: var(--ics-shadow);
  overflow: hidden;
  border: 1px solid rgba(10,22,40,.10);
  animation: ics-slide-up .25s ease;
}
#ics-chat-window.ics-active { display: flex; }
@keyframes ics-slide-up {
  from { opacity:0; transform: translateY(20px) scale(.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

/* ── Header ────────────────────────────────────────── */
#ics-chat-header {
  background: linear-gradient(135deg, var(--ics-navy) 0%, var(--ics-navy-mid) 100%);
  color: var(--ics-white);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.ics-header-left { display: flex; align-items: center; gap: 10px; }
.ics-avatar {
  width: 38px; height: 38px;
  background: var(--ics-green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ics-avatar svg { width: 22px; height: 22px; fill: var(--ics-navy); }
.ics-header-info strong { display: block; font-size: 14px; letter-spacing: .02em; }
.ics-status { font-size: 11px; color: var(--ics-green); letter-spacing: .04em; }
#ics-chat-close {
  background: none; border: none; color: var(--ics-white);
  cursor: pointer; padding: 6px; border-radius: 6px; opacity: .7;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
#ics-chat-close:hover { opacity: 1; }

/* ── Intro Form ────────────────────────────────────── */
#ics-intro-form {
  flex: 1; display: flex; flex-direction: column;
  padding: 20px 18px; gap: 10px;
  background: var(--ics-gray-light);
  overflow-y: auto;
}
.ics-intro-header {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; margin-bottom: 6px;
}
.ics-intro-header p {
  font-size: 13px; color: #4a5568; line-height: 1.5; margin: 0;
}
#ics-intro-form input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid #d0dae8; border-radius: 10px;
  padding: 10px 13px; font-size: 13.5px; font-family: var(--ics-font-ui);
  outline: none; background: var(--ics-white);
  transition: border-color .15s, box-shadow .15s;
}
#ics-intro-form input:focus {
  border-color: var(--ics-green);
  box-shadow: 0 0 0 3px rgba(126,200,160,.15);
}
#ics-intro-submit {
  width: 100%; background: var(--ics-navy); color: var(--ics-white);
  border: none; border-radius: 10px; padding: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  margin-top: 4px; letter-spacing: .02em;
  transition: background .2s, transform .1s;
}
#ics-intro-submit:hover { background: var(--ics-green-dark); transform: translateY(-1px); }
#ics-intro-submit:disabled { opacity: .6; cursor: default; transform: none; }

/* ── Messages ──────────────────────────────────────── */
#ics-chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px; flex-direction: column; gap: 10px;
  background: var(--ics-gray-light);
}
#ics-chat-messages::-webkit-scrollbar { width: 4px; }
#ics-chat-messages::-webkit-scrollbar-thumb { background: #ccd; border-radius: 4px; }

.ics-msg {
  max-width: 84%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.6; word-break: break-word;
}
.ics-msg.ics-bot {
  background: var(--ics-white); color: var(--ics-navy);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(10,22,40,.08);
  align-self: flex-start;
  display: flex; flex-direction: column; gap: 8px;
}
.ics-msg.ics-user {
  background: var(--ics-navy); color: var(--ics-white);
  border-bottom-right-radius: 4px; align-self: flex-end;
}

/* ── Action Buttons (inside chat messages) ─────────── */
.ics-action-btn {
  display: inline-block;
  background: var(--ics-navy);
  color: var(--ics-white) !important;
  text-decoration: none !important;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  letter-spacing: .02em;
  margin-top: 4px;
  transition: background .2s, transform .1s;
  cursor: pointer;
  border: 2px solid var(--ics-green);
}
.ics-action-btn:hover {
  background: var(--ics-green-dark);
  border-color: var(--ics-green-dark);
  transform: translateY(-1px);
}

/* ── Typing indicator ──────────────────────────────── */
.ics-typing {
  display: flex !important; gap: 5px; align-items: center;
  padding: 12px 16px !important;
}
.ics-typing span {
  width: 7px; height: 7px; background: var(--ics-green);
  border-radius: 50%; animation: ics-bounce 1.1s infinite;
}
.ics-typing span:nth-child(2) { animation-delay: .18s; }
.ics-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes ics-bounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-6px); }
}

/* ── Input Area ────────────────────────────────────── */
#ics-chat-input-area {
  padding: 10px 12px;
  border-top: 1px solid #e0e6ef;
  align-items: flex-end; gap: 8px;
  background: var(--ics-white); flex-shrink: 0;
}
#ics-chat-input {
  flex: 1; border: 1.5px solid #d0dae8; border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; font-family: var(--ics-font-ui);
  resize: none; outline: none; max-height: 100px; overflow-y: auto;
  line-height: 1.4; transition: border-color .15s;
}
#ics-chat-input:focus { border-color: var(--ics-green); }

/* ── Send Button ───────────────────────────────────── */
#ics-chat-send {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px; border: none;
  background: var(--ics-navy); color: var(--ics-white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
  box-shadow: 0 2px 8px rgba(10,22,40,.2);
}
#ics-chat-send svg { width: 18px; height: 18px; stroke: var(--ics-white); }
#ics-chat-send:hover { background: var(--ics-green-dark); transform: scale(1.05); }
#ics-chat-send:disabled { opacity: .5; cursor: default; transform: none; }

/* ── Footer ────────────────────────────────────────── */
#ics-chat-footer {
  text-align: center; font-size: 10.5px; color: var(--ics-gray);
  padding: 6px; background: var(--ics-white); border-top: 1px solid #f0f3f7;
}
#ics-chat-footer a { color: var(--ics-navy); text-decoration: none; font-weight: 600; }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 420px) {
  #ics-chat-root { bottom: 12px; right: 12px; }
  #ics-chat-window { width: calc(100vw - 24px); height: 500px; }
}
