/* ==========================================================================
   Wicarita AI — Embedded Homepage Chat Hero (Duck.ai Style)
   ========================================================================== */

.wicarita-embedded-hero-section {
  width: 100%;
  padding: 30px 0 40px;
  background: transparent;
  font-family: 'Sanchez', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wicarita-hero-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  text-align: center;
}

/* 1. Header: Emblem & Title */
.wicarita-hero-emblem-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #FFA387;
  padding: 10px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px -4px rgba(70, 3, 114, 0.15), 0 4px 12px rgba(255, 163, 135, 0.25);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wicarita-hero-emblem-container:hover {
  transform: scale(1.06) rotate(3deg);
}

.wicarita-hero-emblem-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wicarita-hero-sparkle {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #FFA387 0%, #ff8360 100%);
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 10px;
  box-shadow: 0 2px 6px rgba(255, 163, 135, 0.6);
}

.wicarita-hero-title {
  font-family: 'Port Lligat Slab', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #1c022e;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wicarita-hero-title .brand-accent {
  color: #460372;
}

.wicarita-hero-title .brand-sub {
  font-size: 15px;
  color: #836d94;
  font-weight: 400;
  font-family: 'Sanchez', sans-serif;
}

/* 2. Main Search / Chat Input Box (Card) */
.wicarita-hero-card {
  background: #ffffff;
  border-radius: 24px;
  border: 1.5px solid #eadcf5;
  box-shadow: 0 12px 36px -8px rgba(70, 3, 114, 0.08), 0 4px 16px rgba(0, 0, 0, 0.03);
  padding: 16px 20px 14px;
  text-align: left;
  margin-top: 18px;
  transition: all 0.25s ease;
  position: relative;
}

.wicarita-hero-card:focus-within {
  border-color: #460372;
  box-shadow: 0 16px 40px -8px rgba(70, 3, 114, 0.16), 0 0 0 4px rgba(70, 3, 114, 0.08);
}

.wicarita-hero-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wicarita-hero-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Sanchez', sans-serif;
  font-size: 15.5px;
  color: #1c022e;
  outline: none;
  padding: 4px 0;
  line-height: 1.4;
}

.wicarita-hero-input::placeholder {
  color: #9f8ba8;
  font-weight: 400;
}

.wicarita-hero-mic-btn {
  background: none;
  border: none;
  color: #8c769d;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.wicarita-hero-mic-btn:hover {
  color: #460372;
  background-color: #f6eefc;
}

/* Card Bottom Toolbar */
.wicarita-hero-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f6f0fb;
  flex-wrap: wrap;
  gap: 10px;
}

.wicarita-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wicarita-card-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 9999px;
  background: #faf6fd;
  border: 1px solid #eadcf5;
  color: #460372;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.wicarita-card-tool-btn:hover {
  background: #f1e4f9;
  border-color: #460372;
  color: #460372;
  text-decoration: none;
}

.wicarita-card-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wicarita-speed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #5c436f;
  background: transparent;
  padding: 2px 4px;
}

.wicarita-speed-badge svg {
  color: #FFA387;
}

.wicarita-model-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #eadcf5;
  color: #2b1238;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wicarita-model-select-btn:hover {
  border-color: #460372;
  background: #faf7fd;
}

.wicarita-btn-ask {
  padding: 7px 18px;
  border-radius: 9999px;
  background: #460372;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(70, 3, 114, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wicarita-btn-ask:hover:not(:disabled) {
  background: #5c006a;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(70, 3, 114, 0.35);
}

.wicarita-btn-ask:disabled {
  background: #e5dceb;
  color: #9f8ba8;
  box-shadow: none;
  cursor: not-allowed;
}

/* 3. Disclaimer / Privacy Row */
.wicarita-hero-disclaimer {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  color: #7b688a;
  margin-top: 12px;
  margin-bottom: 2px;
  padding: 0 16px;
  line-height: 1.55;
  text-align: center;
  box-sizing: border-box;
}

.wicarita-disclaimer-content {
  display: inline;
}

.wicarita-disclaimer-icon {
  color: #FFA387;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  flex-shrink: 0;
}

.wicarita-hero-disclaimer a {
  color: #460372;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.wicarita-hero-disclaimer a:hover {
  color: #FFA387;
}

/* Desktop: Single-line guaranteed when screen is wide enough */
@media (min-width: 769px) {
  .wicarita-hero-disclaimer {
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
  .wicarita-disclaimer-content {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .wicarita-disclaimer-icon {
    margin-right: 0;
  }
}

/* 4. Suggestion Action Chips */
.wicarita-hero-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.wicarita-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #eadcf5;
  color: #3b2149;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(70, 3, 114, 0.03);
  user-select: none;
}

.wicarita-hero-chip:hover {
  background: #460372;
  color: #ffffff;
  border-color: #460372;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(70, 3, 114, 0.15);
}

.wicarita-hero-chip span.chip-icon {
  font-size: 13px;
}

/* 5. Embedded Response Result Area */
.wicarita-hero-result {
  display: none;
  margin-top: 24px;
  background: #ffffff;
  border: 1.5px solid #eadcf5;
  border-radius: 20px;
  box-shadow: 0 16px 40px -10px rgba(70, 3, 114, 0.1);
  padding: 22px;
  text-align: left;
  animation: wicarita-fade-down 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.wicarita-hero-result.is-active {
  display: block;
}

.wicarita-result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3e8f8;
  margin-bottom: 16px;
  gap: 16px;
}

.wicarita-result-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.wicarita-result-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #fdfaff;
  border: 1px solid #ebdcf5;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.wicarita-result-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wicarita-result-query-wrap {
  flex: 1;
  min-width: 0;
}

.wicarita-result-query-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #1a0426;
  line-height: 1.45;
  word-break: break-word;
  margin: 0;
  letter-spacing: -0.01em;
}

.wicarita-result-status {
  font-size: 11.5px;
  color: #8c769d;
  margin-top: 4px;
  line-height: 1.3;
}

.wicarita-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Minimalist & Elegant Halaman Penuh Button */
.wicarita-btn-goto-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 9999px;
  background: #fdfaff;
  border: 1px solid #e0d0ee;
  color: #4a1372;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.15px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(70, 3, 114, 0.04);
  line-height: 1.2;
}

.wicarita-btn-goto-chat .wicarita-arrow-icon {
  color: #7b5398;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  flex-shrink: 0;
}

.wicarita-btn-goto-chat:hover {
  background: #460372;
  border-color: #460372;
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(70, 3, 114, 0.2);
}

.wicarita-btn-goto-chat:hover .wicarita-arrow-icon {
  color: #ffffff;
  transform: translate(1.5px, -1.5px);
}

/* Matching Minimalist Close Button */
.wicarita-btn-close-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  background: #fdfaff;
  border: 1px solid #e0d0ee;
  color: #7e6790;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
  padding: 0;
}

.wicarita-btn-close-result:hover {
  background: #fbeef2;
  border-color: #f3c0cd;
  color: #c42953;
  transform: translateY(-1px);
}


/* Result Body & Thought */
.wicarita-result-thought {
  margin-bottom: 14px;
  border: 1px solid #eadcf5;
  border-radius: 10px;
  background: #fbf7ff;
  font-size: 12px;
}

.wicarita-result-thought summary {
  padding: 7px 12px;
  cursor: pointer;
  color: #5c436f;
  font-weight: 600;
  outline: none;
  user-select: none;
}

.wicarita-result-thought-body {
  padding: 8px 12px;
  color: #6e587d;
  border-top: 1px dashed #eadcf5;
  font-family: monospace;
  font-size: 11px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  background: #ffffff;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.wicarita-result-markdown {
  font-size: 14px;
  line-height: 1.65;
  color: #1c022e;
}

.wicarita-result-markdown strong {
  color: #350156;
}

.wicarita-result-markdown em {
  color: #5c436f;
}

/* Citations & Reference Cards in Result */
.wicarita-result-references {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1e6f7;
}

.wicarita-result-ref-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #634b75;
  background: #f7f1fc;
  border: 1px solid #ebdcf5;
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 10px;
  letter-spacing: 0.1px;
}

.wicarita-result-ref-heading svg {
  color: #9275a8;
  flex-shrink: 0;
}

.wicarita-result-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.wicarita-result-ref-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #faf6fd;
  border: 1px solid #eadcf5;
  border-radius: 10px;
  text-decoration: none;
  color: #1c022e;
  transition: all 0.2s ease;
}

.wicarita-result-ref-card:hover {
  background: #ffffff;
  border-color: #460372;
  box-shadow: 0 4px 12px rgba(70, 3, 114, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
}

.wicarita-result-ref-card img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.wicarita-result-ref-meta {
  flex: 1;
  min-width: 0;
}

.wicarita-result-ref-title {
  font-size: 12px;
  font-weight: 600;
  color: #350156;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wicarita-result-ref-cat {
  font-size: 10px;
  color: #8c769d;
  margin-top: 1px;
}

/* Citations in AI Response: Clickable Badges */
.wicarita-citation-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #460372;
  background: #f1e2fc;
  border: 1px solid #eadcf5;
  border-radius: 4px;
  padding: 1px 6px;
  margin: 0 2px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  vertical-align: middle;
  line-height: 1.4;
  user-select: none;
}

.wicarita-citation-link:hover {
  background: #460372;
  color: #ffffff;
  border-color: #460372;
  transform: translateY(-1.5px);
  box-shadow: 0 3px 8px rgba(70, 3, 114, 0.28);
  text-decoration: none;
}

.wicarita-citation-link:active {
  transform: translateY(0);
  background: #350156;
}

/* Reference Card Smooth Pulse Highlight Animation */
@keyframes wicarita-card-pulse {
  0% {
    border-color: #FFA387;
    box-shadow: 0 0 0 0 rgba(255, 163, 135, 0.7), 0 6px 16px rgba(70, 3, 114, 0.12);
    background-color: #fff9f6;
  }
  35% {
    border-color: #FFA387;
    box-shadow: 0 0 0 6px rgba(255, 163, 135, 0.4), 0 8px 24px rgba(70, 3, 114, 0.18);
    background-color: #fff6f0;
  }
  70% {
    border-color: #FFA387;
    box-shadow: 0 0 0 2px rgba(255, 163, 135, 0.2), 0 6px 16px rgba(70, 3, 114, 0.12);
    background-color: #fff9f6;
  }
  100% {
    border-color: #eadcf5;
    box-shadow: none;
    background-color: #faf6fd;
  }
}

.wicarita-result-ref-card.wicarita-card-highlight {
  animation: wicarita-card-pulse 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes wicarita-fade-down {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
  #admin_bar {
    min-width: 100% !important;
    width: 100% !important;
  }
  .wicarita-hero-disclaimer {
    white-space: normal;
    display: block;
    text-align: center;
    padding: 0 16px;
    font-size: 11px;
    line-height: 1.55;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .wicarita-disclaimer-content {
    white-space: normal;
    display: inline;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .wicarita-embedded-hero-section {
    padding: 20px 0 30px;
  }
  .wicarita-hero-title {
    font-size: 20px;
  }
  .wicarita-hero-card {
    padding: 14px 16px;
    border-radius: 20px;
  }
  .wicarita-card-left, .wicarita-card-right {
    width: 100%;
    justify-content: space-between;
  }
  .wicarita-btn-ask {
    flex: 1;
    justify-content: center;
  }
  .wicarita-hero-chips {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .wicarita-hero-chips::-webkit-scrollbar {
    display: none;
  }
  .wicarita-hero-chip {
    white-space: nowrap;
  }
}
