/* Full-page AI chat — KT India branding, Claude/ChatGPT-style layout under site header */

:root {
  --kti-red: #eb373f;
  --kti-red-dark: #d62830;
  --kti-ink: #1a1a1a;
  --kti-muted: #6b6b66;
  --kti-line: #e6e6e2;
  --kti-bg: #f3f3f1;
  --kti-surface: #ffffff;
  --kti-shadow: 0 8px 28px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  --kti-radius: 22px;
  --kti-max: 720px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body.kti-ai-page {
  min-height: 100%;
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, sans-serif;
  color: var(--kti-ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(235, 55, 63, 0.07), transparent 55%),
    linear-gradient(180deg, #fafaf8 0%, var(--kti-bg) 40%, #eeeeeb 100%);
  -webkit-font-smoothing: antialiased;
}

/* Keep site header; hide the marketing footer block (scripts stay for floating panel) */
body.kti-ai-page > .footer > .container,
body.kti-ai-page > .footer > .footer_bottom {
  display: none !important;
}

/* No floating bubble on the full-page AI experience */
body.kti-ai-page #chat-toggle-button {
  display: none !important;
}

/* Light page: force readable dark nav (default site nav is white for dark heroes) */
body.kti-ai-page .topbar_menu {
  background: #fff !important;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 200;
}

body.kti-ai-page .nav-item > .nav-link,
body.kti-ai-page .nav-item > .nav-link-about,
body.kti-ai-page .navbar a {
  color: #111 !important;
}

body.kti-ai-page .nav-item > .nav-link:hover,
body.kti-ai-page .nav-item > .nav-link-about:hover,
body.kti-ai-page .navbar a:hover {
  color: #eb373f !important;
}

/* Active chat: lock page scroll; only the message list scrolls */
body.kti-ai-has-chat {
  overflow: hidden;
}

body.kti-ai-has-chat .kti-ai-shell {
  height: calc(100vh - 200px);
  height: calc(100dvh - 200px);
  min-height: 360px;
  overflow: hidden;
}

body.kti-ai-has-chat .kti-ai-center {
  min-height: 0;
  overflow: hidden;
  padding-bottom: 12px;
}

.kti-ai-shell a {
  color: var(--kti-red);
  text-decoration: none;
}

.kti-ai-shell a:hover {
  text-decoration: underline;
}

/* ——— Shell (below site header) ——— */
.kti-ai-shell {
  min-height: calc(100vh - 200px);
  min-height: calc(100dvh - 200px);
  display: flex;
  flex-direction: column;
  position: relative;
}

.kti-ai-toolbar {
  max-width: var(--kti-max);
  width: 100%;
  margin: 0 auto;
  padding: 10px 16px 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.kti-ai-minimize,
.kti-ai-newchat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--kti-line);
  background: var(--kti-surface);
  color: var(--kti-ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.kti-ai-minimize {
  margin-right: auto;
  padding-left: 6px;
}

.kti-ai-minimize-svg {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 50%;
  flex-shrink: 0;
}

.kti-ai-minimize:hover,
.kti-ai-newchat:hover {
  background: #f7f7f5;
  border-color: #d8d8d4;
}

.kti-ai-center {
  width: 100%;
  max-width: var(--kti-max);
  margin: 0 auto;
  padding: 0 16px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

body:not(.kti-ai-has-chat) .kti-ai-center {
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 48px;
}

.kti-ai-empty {
  text-align: center;
  margin-bottom: 28px;
  animation: kti-ai-fade-up 0.45s ease both;
}

.kti-ai-hero-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(235, 55, 63, 0.22);
  margin-bottom: 18px;
}

.kti-ai-greeting {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--kti-ink);
}

.kti-ai-sub {
  margin: 0;
  font-size: 1.05rem;
  color: var(--kti-muted);
  font-weight: 400;
}

body.kti-ai-has-chat .kti-ai-empty,
body.kti-ai-has-chat .kti-ai-suggestions {
  display: none !important;
}

.kti-ai-thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

.kti-ai-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 2px 20px;
  scroll-behavior: smooth;
}

.kti-ai-msg {
  max-width: 92%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: kti-ai-fade-up 0.28s ease both;
}

.kti-ai-msg.user {
  align-self: flex-end;
  background: linear-gradient(180deg, var(--kti-red) 0%, var(--kti-red-dark) 100%);
  color: #fff;
  border-bottom-right-radius: 5px;
  white-space: pre-wrap;
}

.kti-ai-msg.bot {
  align-self: flex-start;
  max-width: 100%;
  background: var(--kti-surface);
  border: 1px solid var(--kti-line);
  color: #333;
  border-bottom-left-radius: 5px;
  white-space: normal;
}

.kti-ai-msg.bot.thinking {
  color: var(--kti-muted);
}

.kti-ai-msg img {
  max-width: 200px;
  border-radius: 10px;
  margin-bottom: 6px;
  display: block;
}

.kti-ai-thinking {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.kti-ai-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
}

.kti-ai-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--kti-red);
  animation: kti-ai-bounce 1.2s ease-in-out infinite;
}

.kti-ai-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.kti-ai-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.kti-ai-retry {
  display: block;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--kti-red);
  background: #fff;
  color: var(--kti-red);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.kti-ai-retry:hover {
  background: #fff5f5;
}

.kti-ai-composer-wrap {
  flex-shrink: 0;
  padding-top: 4px;
  animation: kti-ai-fade-up 0.5s ease 0.08s both;
}

body.kti-ai-has-chat .kti-ai-composer-wrap {
  flex-shrink: 0;
  padding: 10px 0 4px;
  background: transparent;
}

.kti-ai-composer {
  background: var(--kti-surface);
  border: 1px solid var(--kti-line);
  border-radius: var(--kti-radius);
  box-shadow: var(--kti-shadow);
  padding: 14px 14px 10px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.kti-ai-composer:focus-within {
  border-color: rgba(235, 55, 63, 0.45);
  box-shadow: 0 10px 32px rgba(235, 55, 63, 0.1), 0 2px 10px rgba(0, 0, 0, 0.05);
}

.kti-ai-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--kti-ink);
  background: transparent;
  min-height: 28px;
  max-height: 160px;
  padding: 2px 4px 10px;
}

.kti-ai-input::placeholder {
  color: #9a9a94;
}

.kti-ai-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kti-ai-attach {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--kti-line);
  background: #f7f7f5;
  color: #555;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
}

.kti-ai-attach:hover {
  background: #eee;
}

.kti-ai-send {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--kti-red) 0%, var(--kti-red-dark) 100%);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s, transform 0.12s, opacity 0.15s;
  margin-left: auto;
}

.kti-ai-send:hover:not(:disabled) {
  filter: brightness(1.06);
}

.kti-ai-send:active:not(:disabled) {
  transform: scale(0.96);
}

.kti-ai-send:disabled {
  opacity: 0.35;
  cursor: default;
}

.kti-ai-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 4px 10px;
}

.kti-ai-preview:not([hidden]) {
  display: flex;
}

.kti-ai-preview[hidden] {
  display: none !important;
}

.kti-ai-preview img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--kti-line);
}

.kti-ai-file-chip {
  padding: 4px 10px;
  background: #f0f0ee;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
}

.kti-ai-preview-rm {
  margin-left: auto;
  border: none;
  background: none;
  color: #999;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}

.kti-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.kti-ai-chip {
  border: 1px solid var(--kti-line);
  background: rgba(255, 255, 255, 0.85);
  color: #444;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.kti-ai-chip:hover {
  background: #fff;
  border-color: rgba(235, 55, 63, 0.4);
  color: var(--kti-red);
  transform: translateY(-1px);
}

.kti-ai-disclaimer {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: #8a8a84;
  line-height: 1.4;
}

body.kti-ai-has-chat .kti-ai-disclaimer {
  margin-top: 8px;
}

.kti-ai-msg.bot .adk-v-comparison-scroll {
  max-width: 100%;
}

@keyframes kti-ai-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kti-ai-bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

@media (max-width: 991px) {
  body.kti-ai-has-chat .kti-ai-shell,
  .kti-ai-shell {
    min-height: calc(100vh - 160px);
    min-height: calc(100dvh - 160px);
  }

  body.kti-ai-has-chat .kti-ai-shell {
    height: calc(100vh - 160px);
    height: calc(100dvh - 160px);
  }
}

@media (max-width: 640px) {
  .kti-ai-greeting {
    font-size: 1.55rem;
  }

  .kti-ai-chip {
    font-size: 12px;
    padding: 7px 12px;
  }

  .kti-ai-composer {
    border-radius: 18px;
  }

  .kti-ai-toolbar {
    padding: 8px 12px 0;
  }
}
