/* Split from website/static/css/pages.css and 12-chat-composer-footer.css. Keep selector order compatible with the original cascade. */

/* Home screen */
#welcome {
  position: relative;
}

#welcome .top-bar {
  gap: 8px;
}

#welcome .top-bar .title {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  color: rgba(242, 243, 247, 0.78);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 18px;
  text-transform: uppercase;
}

.home-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

.home-screen > * {
  position: relative;
  z-index: 1;
}

.home-search {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 4px 8px;
  gap: 8px;
  width: 100%;
  height: 48px;
  margin-right: 16px;
  background: rgba(25, 27, 35, 0.3);
  background-blend-mode: soft-light;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  flex: 1 1 auto;
  align-self: stretch;
}

.home-search-icon {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 10px;
  width: 40px;
  height: 40px;
  flex: none;
}

.home-search-icon svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-search-input {
  width: 145px;
  height: 17px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #dadada;
  font-size: 14px;
  line-height: 17px;
  letter-spacing: 0.25px;
  text-align: justify;
  padding: 0;
  flex: none;
}

.home-search-input::placeholder {
  color: #dadada;
}

.home-search-input:focus {
  outline: none;
}

.home-ai-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-ai-strip::-webkit-scrollbar {
  display: none;
}

.home-ai-card {
  --home-ai-tint: rgba(52, 49, 110, 0.26);
  --home-ai-shimmer: rgba(121, 106, 224, 0.22);
  --home-ai-shimmer-duration: 13.4s;
  --home-ai-shimmer-delay: -2s;
  position: relative;
  flex: 0 0 150px;
  min-height: 180px;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(118% 86% at 50% -4%, var(--home-ai-tint) 0%, rgba(25, 27, 35, 0) 58%),
    linear-gradient(180deg, rgba(27, 29, 38, 0.98) 0%, rgba(25, 27, 35, 0.99) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-clip: padding-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 19px;
  overflow: hidden;
  scroll-snap-align: start;
  isolation: isolate;
}

.home-ai-card::before {
  content: "";
  position: absolute;
  inset: -14% -10% 42% -10%;
  background:
    radial-gradient(96% 92% at 50% 12%, var(--home-ai-shimmer) 0%, rgba(25, 27, 35, 0) 70%),
    radial-gradient(72% 72% at 18% 8%, rgba(255, 255, 255, 0) 0%, rgba(25, 27, 35, 0) 100%);
  opacity: 0.74;
  transform: translate3d(-4%, -8%, 0);
  animation: home-ai-card-top-glow var(--home-ai-shimmer-duration) ease-in-out infinite;
  animation-delay: var(--home-ai-shimmer-delay);
  pointer-events: none;
  z-index: 0;
}

.home-ai-card--mid {
  --home-ai-tint: rgba(15, 59, 142, 0.24);
  --home-ai-shimmer: rgba(84, 136, 228, 0.2);
  --home-ai-shimmer-duration: 14.6s;
  --home-ai-shimmer-delay: -5s;
}

.home-ai-card--voice {
  --home-ai-tint: rgba(29, 85, 78, 0.24);
  --home-ai-shimmer: rgba(79, 170, 151, 0.19);
  --home-ai-shimmer-duration: 12.7s;
  --home-ai-shimmer-delay: -7s;
}

.home-ai-card--bytedance {
  --home-ai-tint: rgba(90, 64, 18, 0.24);
  --home-ai-shimmer: rgba(170, 128, 66, 0.18);
  --home-ai-shimmer-duration: 13.2s;
  --home-ai-shimmer-delay: -3.5s;
}
.home-ai-card > * {
  position: relative;
  z-index: 1;
}

@keyframes home-ai-card-top-glow {
  0% {
    transform: translate3d(-4%, -8%, 0);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(4%, -1%, 0);
    opacity: 0.84;
  }
  100% {
    transform: translate3d(-4%, -8%, 0);
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-ai-card::before {
    animation: none;
    transform: none;
    opacity: 0.72;
  }
}

.home-ai-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-ai-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.home-ai-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  flex: none;
}

.home-ai-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 19px;
  color: #ffffff;
}

.home-ai-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 22px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  align-self: flex-start;
  cursor: pointer;
}

.home-start-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.home-start-chat svg {
  width: 20px;
  height: 20px;
}

.home-start-chat:hover {
  background: #f2f2f2;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  transform: scale(0.99);
  opacity: 0.95;
}

.home-start-chat:active {
  background: #e9e9e9;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.28);
  transform: scale(0.97);
}

.home-favorites {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #24262e;
  border-radius: 12px;
}

.home-favorites-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 19px;
  color: #fefefe;
}

.home-favorites-link {
  background: none;
  border: none;
  color: rgba(194, 180, 255, 0.92);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.home-favorites-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 351px;
  overflow-y: auto;
  padding: 0;
}

.home-favorite-card {
  display: grid;
  grid-template-columns: var(--ui-chat-icon-button-size) minmax(0, 1fr) var(--ui-chat-icon-button-size);
  align-items: center;
  justify-content: stretch;
  gap: 8px;
  min-height: var(--ui-chat-row-min-height);
  padding: 8px 10px;
  border-radius: var(--ui-chat-card-radius);
  background: linear-gradient(180deg, rgba(28, 31, 40, 0.98), rgba(22, 25, 33, 0.98));
  color: #ffffff;
  text-align: left;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.035);
  overflow: hidden;
  flex-shrink: 0;
}

.home-favorite-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding-bottom: 1px;
  border-radius: var(--ui-chat-card-radius);
  background: linear-gradient(-84deg, rgba(77, 50, 156, 0.42) 0%, rgba(40, 127, 117, 0.3) 41%, rgba(42, 100, 126, 0.28) 73%, rgba(25, 72, 117, 0.34) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.home-favorite-card > * {
  position: relative;
  z-index: 1;
}

.home-favorite-left {
  display: contents;
}

.home-favorite-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.home-favorite-icon img {
  width: 16px;
  height: 16px;
}

.home-favorite-icon svg {
  display: block;
}

.home-favorite-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 19px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-favorite-star {
  width: 24px;
  height: 24px;
  border: none;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: transform 0.16s ease;
}

.home-favorite-star svg {
  width: 24px;
  height: 24px;
  display: block;
  transition: opacity 0.18s ease;
}

.home-favorite-star[data-bookmark-state="default"] svg {
  opacity: 0.68;
}

.home-favorite-star[data-bookmark-state="filled"] svg {
  opacity: 1;
}

.home-favorite-star[data-bookmark-state="default"]:hover svg,
.home-favorite-star[data-bookmark-state="default"]:focus-visible svg {
  opacity: 0.84;
}

.home-favorite-star[data-bookmark-state="default"]:active svg,
.home-favorite-star[data-bookmark-state="filled"]:active svg {
  opacity: 1;
}

.home-favorite-star:active {
  transform: scale(0.96);
}

.home-favorite-empty {
  font-size: 13px;
  color: #a8b2d1;
  padding: 10px 4px;
  text-align: center;
}

.home-ai-link:focus-visible,
.home-start-chat:focus-visible,
.home-favorite-card:focus-visible,
.home-favorites-link:focus-visible {
  outline: 2px solid rgba(88, 205, 231, 0.6);
  outline-offset: 2px;
}
