/* =====================================================================
   AI Chat Hero — înlocuiește hero-ul vechi de pe homepage.
   Stil: full-bleed background image, overlay centrat, input + chips.
   ===================================================================== */

/* Ascundem hero-ul vechi (slider, rotating words, etc) când chat-ul e activ */
.create-page.chat-hero-active .hero-split-layout,
.create-page.chat-hero-active .hero-content-wrapper,
.create-page.chat-hero-active .hero-mobile-banner,
.create-page.chat-hero-active .hero-mobile-slideshow,
.create-page.chat-hero-active .hero-desktop-slideshow,
.create-page.chat-hero-active .hero-mobile-title,
.create-page.chat-hero-active .hero-brands-row,
.create-page.chat-hero-active .hero-split-brands-logos {
  display: none !important;
}

/* === Hero wrapper === */
.ai-hero {
  position: relative;
  width: 100%;
  min-height: 580px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  margin-bottom: 32px;
}

.ai-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url('/assets/slide11-800w.webp');
  background-size: cover;
  background-position: center;
  filter: brightness(0.65);
  transition: filter .6s ease;
}
.ai-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 70%, rgba(0,0,0,0.6) 100%);
}

/* === Inner stack === */
.ai-hero__inner {
  position: relative;
  width: min(720px, 92%);
  text-align: center;
  color: #fff;
  padding: 60px 0;
}

.ai-hero__pill {
  display: inline-block;
  background: #b22aa6;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ai-hero__title {
  font-family: "Inter", sans-serif;
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 200;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0 0 28px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* === Input box === */
.ai-hero__form {
  background: #fff;
  border-radius: 22px;
  padding: 14px 16px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  margin: 0 auto 22px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  align-items: end;
}
.ai-hero__textarea {
  grid-column: 1 / -1;
  border: 0 !important;
  outline: 0 !important;
  resize: none;
  min-height: 28px;
  max-height: 200px;
  padding: 6px 4px !important;
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: #1a1a1a;
  background: transparent;
  width: 100%;
  line-height: 1.5;
}
.ai-hero__textarea::placeholder { color: #9a9a9a; font-weight: 300; }

.ai-hero__form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Attachment preview chip în input box */
.ai-hero__attachment {
  grid-column: 1 / -1;
  position: relative;
  width: 84px; height: 84px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 4px;
  background: #f0f0f0;
  border: 1px solid #e5e5e5;
}
.ai-hero__attachment[hidden] { display: none; }
.ai-hero__attachment-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ai-hero__attachment-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-hero__attachment-remove:hover { background: #000; }

/* Image inside user message bubble */
.ai-msg__img {
  display: block;
  max-width: 280px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 12px;
  margin-top: 4px;
  background: #f5f5f5;
}
.ai-hero__icon-btn {
  width: 36px; height: 36px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: #666;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ai-hero__icon-btn:hover { background: #f0f0f0; color: #1a1a1a; }

.ai-hero__send {
  width: 38px; height: 38px;
  background: #1a1a1a;
  color: #fff;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s, opacity .15s, background .15s;
}
.ai-hero__send:hover { transform: translateY(-1px); }
.ai-hero__send:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* === Chips === */
.ai-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.ai-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.95);
  color: #1a1a1a;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s;
  backdrop-filter: blur(8px);
}
.ai-hero__chip:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* === Conversation thread (apare după primul mesaj) === */
.ai-hero.is-chatting {
  min-height: 700px;
  align-items: flex-start;
  padding-top: 80px;
}
.ai-hero.is-chatting .ai-hero__bg { filter: brightness(0.4) blur(6px); transform: scale(1.05); }
.ai-hero.is-chatting .ai-hero__title { display: none; }
.ai-hero.is-chatting .ai-hero__pill { display: none; }

.ai-hero__thread {
  display: none;
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  padding: 24px;
  margin: 0 auto 22px;
  max-height: 50vh;
  overflow-y: auto;
  text-align: left;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.ai-hero.is-chatting .ai-hero__thread { display: block; }

.ai-msg {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: #1a1a1a;
  font-weight: 300;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-msg:last-child { margin-bottom: 0; }
.ai-msg__role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
  color: #666;
}
.ai-msg--user .ai-msg__role { color: #b22aa6; }
.ai-msg--ai .ai-msg__role { color: #1a1a1a; }
.ai-msg__text {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ai-msg__text strong { font-weight: 500; }
.ai-msg__cta {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  width: fit-content;
}
.ai-msg__cta:hover { opacity: 0.9; }

.ai-msg__typing {
  display: inline-flex; gap: 4px; align-items: center;
  height: 20px;
}
.ai-msg__typing span {
  width: 6px; height: 6px;
  background: #999;
  border-radius: 999px;
  animation: ai-typing-bounce 1.2s infinite ease-in-out;
}
.ai-msg__typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-msg__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-typing-bounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.1); opacity: 1; }
}

.ai-hero__error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin: 0 0 12px;
  display: none;
}
.ai-hero__error.is-visible { display: block; }

/* =====================================================================
   Override-uri specifice homepage-ului
   (chat-hero.css se încarcă DOAR pe homepage, deci totul aici afectează doar acolo)
   ===================================================================== */

/* Scot linia gri de sub header (doar pe home) */
.id-header.id-header--v2 { border-bottom-color: transparent !important; }

/* Lipesc hero-ul de header — fără gap între ele */
.id-main { padding-top: 0 !important; }
.ai-hero { margin-bottom: 32px; margin-top: 0; }

/* Ridic conținutul în interiorul hero-ului — input-ul mai sus */
.ai-hero__inner { padding: 36px 0 60px; }
.ai-hero { min-height: 480px; }

/* === Responsive === */
@media (max-width: 640px) {
  .ai-hero { min-height: 380px; }
  .ai-hero__inner { padding: 24px 0 40px; }
  .ai-hero__title { margin-bottom: 20px; }
  .ai-hero__form { padding: 12px; border-radius: 18px; }
  .ai-hero__textarea { font-size: 15px; }
  .ai-hero.is-chatting .ai-hero__thread { max-height: 60vh; }
}
