/* =========================================================
   SEO, AEO & GEO PAGE: "Getting Layla found"
   1. Search results: Layla climbs from #9 to #1   (SEO)
   2. An answer box at the top                      (AEO)
   3. An AI assistant recommends Layla              (GEO)
   ========================================================= */

.seo-search {
  padding: 16px 18px;
}

.seo-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid #dddde5;
  border-radius: 99px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.seo-glass {
  font-size: 13px;
}

/* The "Search" button the mouse clicks */
.seo-go {
  margin-left: auto;
  padding: 4px 14px;
  border-radius: 99px;
  background: #6c5ce7;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.seo-caret {
  width: 1px;
  height: 16px;
  margin-left: -8px;
  background: #333333;
  animation: seo-blink 1s steps(1) infinite;
}

@keyframes seo-blink {
  50% { opacity: 0; }
}

/* AEO: the answer box (hidden until the end of the SEO scene) */
.seo-answer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 0 14px;
  border-radius: 12px;
  background: #f4f1ff;
  border-left: 4px solid #6c5ce7;
  transition: max-height 0.6s, opacity 0.6s, margin 0.6s, padding 0.6s;
}

.show-answer .seo-answer {
  max-height: 140px;
  opacity: 1;
  margin-top: 12px;
  padding: 12px 14px;
}

.seo-answer-label {
  font-size: 11px;
  font-weight: 700;
  color: #6c5ce7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.seo-answer p {
  margin: 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #222222;
}

.seo-source,
.seo-cite {
  display: inline-block;
  font-size: 11px;
  color: #1a7f4b;
}

/* SEO: the results list. Each result has a fixed height so it can slide */
.seo-results {
  position: relative;
  height: 290px;
  margin-top: 12px;
  opacity: 0;
  transition: opacity 0.5s;
}

/* Results appear after the mouse clicks "Search" */
.searched .seo-results {
  opacity: 1;
}

.seo-result {
  position: absolute;
  left: 0;
  right: 0;
  height: 58px;
  padding: 5px 10px;
  border-radius: 10px;
  box-sizing: border-box;
  transition: top 0.7s cubic-bezier(0.45, 0, 0.25, 1), background 0.4s, box-shadow 0.4s;
}

.seo-result span,
.seo-result strong {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.seo-url {
  font-size: 11px;
  color: #1a7f4b;
}

.seo-result strong {
  font-size: 14px;
  color: #3b37b8;
}

.seo-snip {
  font-size: 12px;
  color: #777777;
}

/* Layla's result stands out a little, with its position number */
.is-layla {
  z-index: 2;
  background: #fff4ec;
}

.is-layla.top {
  background: #ffe9db;
  box-shadow: 0 6px 18px rgba(232, 67, 147, 0.2);
}

.seo-result .seo-rank {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 99px;
  background: #e84393;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* The SEO checklist card, bottom right */
.seo-checklist {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 175px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #15151c;
  color: #c8c8d4;
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.5s, transform 0.5s;
}

.seo-checklist strong {
  color: #ffffff;
  font-size: 13px;
}

.seo-checklist span::before {
  content: '○ ';
  color: #6b6b7b;
}

.seo-checklist span.done {
  color: #ffffff;
}

.seo-checklist span.done::before {
  content: '✓ ';
  color: #55efc4;
}

.checks-done .seo-checklist {
  opacity: 0;
  transform: translateY(20px);
}

/* GEO: the AI assistant chat, covers the search page */
.seo-chat {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: #fafafe;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s, visibility 0.6s;
}

.show-chat .seo-chat {
  opacity: 1;
  visibility: visible;
}

.seo-chat-head {
  font-size: 13px;
  font-weight: 700;
  color: #6c5ce7;
}

.seo-bubble {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.seo-bubble.from-user {
  align-self: flex-end;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s, transform 0.4s;
  background: #6c5ce7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.asked .seo-bubble.from-user {
  opacity: 1;
  transform: none;
}

.seo-bubble.from-ai {
  align-self: flex-start;
  opacity: 0;
  transition: opacity 0.4s;
  min-height: 20px;
  background: #ffffff;
  border: 1px solid #e6e6ef;
  border-bottom-left-radius: 4px;
}

.answering .seo-bubble.from-ai {
  opacity: 1;
}

/* The box at the bottom of the chat where the question is typed */
.seo-ask {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 10px 14px;
  border: 1px solid #dddde5;
  border-radius: 99px;
  background: #ffffff;
  font-size: 13px;
  color: #999999;
}

.seo-ask.typing {
  border-color: #6c5ce7;
  color: #222222;
}

.seo-send {
  margin-left: auto;
  color: #6c5ce7;
  font-size: 14px;
}

.seo-cite {
  display: block;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.4s;
}

.ai-done .seo-cite {
  opacity: 1;
}

@media (max-width: 600px) {
  .seo-search {
    padding: 12px;
  }

  .seo-checklist {
    width: 160px;
    font-size: 11px;
    padding: 10px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seo-result,
  .seo-answer,
  .seo-checklist,
  .seo-chat {
    transition: none;
  }

  .seo-caret {
    animation: none;
  }
}
