/* ==========================================================================
   Ishingiro AI - additions on top of the Celestial template.
   Colours are taken from scss/common/light/_variables.scss and
   scss/vertical-layout-light/_variables.scss so the app matches the template.
   ========================================================================== */
:root {
  --ish-primary: #f2125e;
  --ish-primary-dark: #c90d4c;
  --ish-secondary: #392ccd;
  --ish-info: #2b80ff;
  --ish-success: #17c964;
  --ish-warning: #ff8300;
  --ish-dark: #1b1b29;
  --ish-dark-2: #414147;
  --ish-content-bg: #e8eff9;
  --ish-text: #001737;
  --ish-muted: #76838f;
  --ish-border: #e7eaed;
  --ish-gradient: linear-gradient(230deg, #759bff, #843cf6);
}

/* ---------- Landing / login split screen ---------- */
.ish-landing {
  min-height: 100vh;
  background: var(--ish-content-bg);
}
.ish-landing .ish-chat-col {
  padding: 24px;
  display: flex;
}
.ish-landing .ish-auth-col {
  background: #fff;
  display: flex;
  align-items: center;
  padding: 40px 24px;
}
.ish-landing .ish-auth-col .auth-form-light {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.ish-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.ish-brand img { height: 130px; width: auto; }

/* Navbar brand: emblem + name */
.navbar .navbar-brand-wrapper .ish-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.navbar .navbar-brand-wrapper .ish-navbar-brand img { height: 40px; width: auto; }
.ish-navbar-brand span { font-weight: 700; font-size: 1.15rem; color: var(--ish-text); white-space: nowrap; }
.ish-navbar-brand span b { color: var(--ish-primary); font-weight: 700; }
.navbar .navbar-brand-wrapper .brand-logo-mini img { height: 40px; width: auto; }

.ish-bot-avatar { object-fit: contain; }
.ish-error-logo { height: 120px; width: auto; margin-bottom: 1.5rem; }
.ish-feature-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.ish-feature-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ish-muted);
  font-size: .85rem;
  margin-bottom: .6rem;
}
.ish-feature-list i { color: var(--ish-primary); font-size: 1.1rem; line-height: 1; }

@media (min-width: 992px) {
  .ish-landing .ish-chat-col { height: 100vh; position: sticky; top: 0; }
}

/* ---------- Chat panel ---------- */
.ish-chat {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 560px;
  background: #fff;
  border: 1px solid var(--ish-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(27, 27, 41, .08);
}
.ish-landing .ish-chat { height: calc(100vh - 48px); }
.ish-chat-page .ish-chat { height: calc(100vh - 63px - 2.5rem - 50px); min-height: 480px; }

.ish-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--ish-dark);
  color: #fff;
}
.ish-chat-header .ish-bot-avatar { width: 42px; height: 42px; }
.ish-chat-header h5 { margin: 0; font-size: 1rem; font-weight: 600; color: #fff; }
.ish-chat-header small { color: #bfccda; display: flex; align-items: center; gap: 6px; }
.ish-online-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ish-success);
  box-shadow: 0 0 0 3px rgba(23, 201, 100, .25);
}
.ish-chat-header .ish-header-actions { margin-left: auto; display: flex; gap: 8px; }
.ish-chat-header .btn-ish-ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  background: transparent;
  font-size: .8rem;
  padding: .4rem .8rem;
  border-radius: 6px;
}
.ish-chat-header .btn-ish-ghost:hover { background: var(--ish-dark-2); color: #fff; }

.ish-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  background: var(--ish-content-bg);
  scroll-behavior: smooth;
}

.ish-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  max-width: 85%;
  animation: ish-pop .18s ease-out;
}
.ish-msg.user { margin-left: auto; flex-direction: row-reverse; }
.ish-msg .ish-bot-avatar { width: 32px; height: 32px; flex-shrink: 0; }
.ish-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .9rem;
  line-height: 1.55;
  word-wrap: break-word;
  color: var(--ish-text);
  background: #fff;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 23, 55, .06);
}
.ish-bubble p:last-child, .ish-bubble ul:last-child, .ish-bubble ol:last-child { margin-bottom: 0; }
.ish-bubble ul, .ish-bubble ol { padding-left: 1.2rem; margin-bottom: .5rem; }
.ish-msg.user .ish-bubble {
  background: var(--ish-primary);
  color: #fff;
  border-top-left-radius: 14px;
  border-top-right-radius: 4px;
}
.ish-msg .ish-time { display: block; font-size: .7rem; color: var(--ish-muted); margin-top: 4px; }
.ish-msg.user .ish-time { text-align: right; }

.ish-crisis {
  display: flex;
  gap: 10px;
  margin: 0 0 16px 42px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff4e6;
  border-left: 4px solid var(--ish-warning);
  font-size: .85rem;
  color: #7a3e00;
}
.ish-crisis i { font-size: 1.2rem; color: var(--ish-warning); }
.ish-error-note { margin-left: 42px; font-size: .75rem; color: var(--ish-primary); margin-top: -10px; margin-bottom: 14px; }

.ish-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.ish-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ish-secondary);
  opacity: .4;
  animation: ish-blink 1.2s infinite;
}
.ish-typing span:nth-child(2) { animation-delay: .2s; }
.ish-typing span:nth-child(3) { animation-delay: .4s; }

.ish-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px 42px; }
.ish-suggestions button {
  border: 1px solid var(--ish-secondary);
  color: var(--ish-secondary);
  background: #fff;
  border-radius: 20px;
  font-size: .8rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: all .15s;
}
.ish-suggestions button:hover { background: var(--ish-secondary); color: #fff; }

.ish-chat-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--ish-border);
  background: #fff;
}
.ish-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--ish-content-bg);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
}
.ish-composer textarea {
  flex: 1;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: .9rem;
  color: var(--ish-text);
  max-height: 140px;
  padding: 8px 0;
  font-family: inherit;
}
.ish-composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ish-send {
  width: 42px; height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--ish-primary);
  color: #fff;
  font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.ish-send:hover { background: var(--ish-primary-dark); }
.ish-send:disabled { background: #aab2bd; cursor: not-allowed; }
.ish-disclaimer { font-size: .7rem; color: var(--ish-muted); text-align: center; margin: 8px 0 0; }

@keyframes ish-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes ish-pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Signed-in chat page: history list ---------- */
.ish-history { list-style: none; padding: 0; margin: 0; max-height: calc(100vh - 260px); overflow-y: auto; }
.ish-history li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--ish-text);
}
.ish-history li:hover { background: var(--ish-content-bg); }
.ish-history li.active { background: var(--ish-content-bg); border-left: 3px solid var(--ish-primary); }
.ish-history li .ish-h-title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ish-history li .ish-h-del { color: var(--ish-muted); visibility: hidden; }
.ish-history li:hover .ish-h-del { visibility: visible; }
.ish-history li .ish-h-del:hover { color: var(--ish-primary); }

/* ---------- Admin ---------- */
.ish-stat {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ish-stat .ish-stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
}
.ish-stat h3 { margin: 0; font-weight: 700; }
.ish-stat p { margin: 0; color: var(--ish-muted); font-size: .85rem; }
.bg-ish-primary { background: var(--ish-primary); }
.bg-ish-secondary { background: var(--ish-secondary); }
.bg-ish-info { background: var(--ish-info); }
.bg-ish-warning { background: var(--ish-warning); }
.bg-ish-gradient { background: var(--ish-gradient); }
.ish-table-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.ish-transcript { background: var(--ish-content-bg); border-radius: 10px; padding: 18px; max-height: 70vh; overflow-y: auto; }
.ish-transcript .ish-msg { max-width: 90%; }
.ish-prompt-editor { font-family: Consolas, Monaco, monospace; font-size: .85rem; line-height: 1.5; }
.ish-banner {
  background: var(--ish-gradient);
  color: #fff;
  border-radius: 8px;
  padding: 24px;
}
.ish-banner h3, .ish-banner p { color: #fff; }

@media (max-width: 991px) {
  .ish-landing .ish-chat { height: 78vh; }
  .ish-msg { max-width: 95%; }
}

/* ---------- Voice ---------- */
.ish-mic {
  width: 42px; height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--ish-secondary);
  color: #fff;
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background .15s;
}
.ish-mic:hover { background: #2a1fa8; }
.ish-mic:disabled { background: #aab2bd; cursor: not-allowed; }
.ish-mic.live { background: var(--ish-primary); }
.ish-mic.listening::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 14px;
  border: 2px solid var(--ish-primary);
  animation: ish-ring 1.2s ease-out infinite;
}
@keyframes ish-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.25); } }

.ish-voice-status {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--ish-secondary);
  margin: 0 0 8px 4px;
}
.ish-voice-status.show { display: flex; }
.ish-voice-status::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  animation: ish-blink 1.2s infinite;
}
.ish-voice-status.listening { color: var(--ish-primary); }
.ish-voice-status.speaking { color: var(--ish-success); }

.ish-voice-controls { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ish-voice-controls + .ish-header-actions { margin-left: 8px; }
.ish-voice-toggle { font-size: 1rem !important; line-height: 1; }
.ish-voice-toggle.active { background: var(--ish-primary) !important; border-color: var(--ish-primary) !important; }

.ish-listen {
  border: 0;
  background: transparent;
  color: var(--ish-muted);
  padding: 0 0 0 6px;
  cursor: pointer;
  font-size: .85rem;
  vertical-align: middle;
}
.ish-listen:hover { color: var(--ish-primary); }

.ish-chat { min-width: 0; }

@media (max-width: 575px) {
  .ish-landing .ish-chat-col { padding: 12px; }
  .ish-chat-header { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .ish-chat-header > div:nth-child(2) { flex: 1; min-width: 0; }
  .ish-chat-header h5, .ish-chat-header small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ish-chat-header .ish-header-actions { margin-left: 0; }
  .ish-voice-controls { order: 3; width: 100%; margin-left: 0; justify-content: flex-end; }
  .ish-voice-controls + .ish-header-actions { margin-left: 0; }
  .ish-chat-body { padding: 14px 10px; }
  .ish-suggestions, .ish-crisis, .ish-error-note { margin-left: 0; }
}
