/* Tydie AI Assistant — Luxury Revamp */

.tydie-ai-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  border: 1px solid rgba(143, 174, 209, 0.32);
  background: rgba(255, 255, 255, 0.92);
  color: #4F7DAE;
  font-size: 24px;
  box-shadow:
    0 18px 44px rgba(63, 58, 54, 0.13),
    0 8px 22px rgba(111, 149, 191, 0.12);
  backdrop-filter: blur(18px);
  cursor: pointer;
  z-index: 99999;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tydie-ai-button span {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.tydie-ai-button:hover {
  transform: translateY(-3px);
  border-color: rgba(111, 149, 191, 0.5);
  box-shadow:
    0 24px 58px rgba(63, 58, 54, 0.16),
    0 12px 30px rgba(111, 149, 191, 0.18);
}

.tydie-ai-button:hover span {
  transform: translateY(-1px) rotate(12deg) scale(1.08);
}

.tydie-ai-panel {
  position: fixed;
  right: 24px;
  bottom: 104px;
  width: min(410px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 130px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(214, 227, 241, 0.9);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.94)),
    radial-gradient(circle at top right, rgba(143,174,209,.24), transparent 35%);
  box-shadow:
    0 34px 90px rgba(63, 58, 54, 0.18),
    0 10px 28px rgba(111, 149, 191, 0.14);
  backdrop-filter: blur(22px);
  z-index: 99999;
}

.tydie-ai-panel.open {
  display: flex;
}

.tydie-ai-header {
  position: relative;
  padding: 24px 24px 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.9), transparent 34%),
    linear-gradient(135deg, #eef6ff 0%, #ffffff 52%, #e7f0fa 100%);
  border-bottom: 1px solid rgba(143, 174, 209, 0.22);
}

.tydie-ai-header::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 22px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #8fd1a5;
  box-shadow: 0 0 0 6px rgba(143, 209, 165, 0.16);
}

.tydie-ai-header h3 {
  margin: 0 0 8px 22px;
  color: #2f2b28;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.tydie-ai-header p {
  margin: 0;
  color: #6f685f;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 310px;
}

.tydie-ai-messages {
  flex: 1;
  padding: 18px 18px 10px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(143,174,209,.12), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.35), rgba(248,251,255,.75));
}

.tydie-ai-messages::-webkit-scrollbar {
  width: 6px;
}

.tydie-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(143, 174, 209, 0.45);
  border-radius: 999px;
}

.tydie-ai-message {
  max-width: 86%;
  margin-bottom: 12px;
  padding: 13px 15px;
  border-radius: 22px;
  font-size: 13.5px;
  line-height: 1.5;
  animation: tydieMessageIn .22s ease both;
}

.tydie-ai-message.bot {
  color: #3f3a36;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(214, 227, 241, 0.9);
  border-top-left-radius: 8px;
  box-shadow: 0 10px 26px rgba(63, 58, 54, 0.06);
}

.tydie-ai-message.user {
  margin-left: auto;
  color: #fff;
  background:
    linear-gradient(135deg, #9dbbe0 0%, #6f95bf 100%);
  border-top-right-radius: 8px;
  box-shadow: 0 12px 28px rgba(111, 149, 191, 0.28);
}

.tydie-ai-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 18px 14px;
  background: rgba(248, 251, 255, 0.88);
  border-top: 1px solid rgba(214, 227, 241, 0.55);
}

.tydie-ai-quick-actions button {
  border: 1px solid rgba(143, 174, 209, 0.34);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(246,250,255,.94));
  color: #5f86ad;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(111,149,191,.08);
  transition: all .2s ease;
}

.tydie-ai-quick-actions button:hover {
  transform: translateY(-1px);
  color: #4f7dae;
  border-color: rgba(111, 149, 191, 0.55);
  box-shadow: 0 8px 18px rgba(111,149,191,.14);
}

.tydie-ai-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px 18px;
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(214, 227, 241, 0.65);
}

.tydie-ai-form input {
  flex: 1;
  min-width: 0;
  height: 45px;
  border: 1px solid rgba(143, 174, 209, 0.38);
  border-radius: 999px;
  padding: 0 15px;
  background: #fff;
  color: #3f3a36;
  font-family: Poppins, sans-serif;
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}

.tydie-ai-form input:focus {
  border-color: rgba(111, 149, 191, 0.75);
  box-shadow:
    0 0 0 4px rgba(143,174,209,.16),
    inset 0 1px 0 rgba(255,255,255,.9);
}

.tydie-ai-form button {
  height: 45px;
  min-width: 68px;
  border: none;
  border-radius: 999px;
  padding: 0 17px;
  background: linear-gradient(135deg, #8faed1, #5f88b6);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(111,149,191,.25);
}

.tydie-ai-form button:disabled {
  opacity: .65;
  cursor: not-allowed;
  box-shadow: none;
}

@keyframes tydieMessageIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 560px) {
  .tydie-ai-panel {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 110px));
    border-radius: 28px;
  }

  .tydie-ai-button {
    right: 16px;
    bottom: 16px;
    width: 58px;
    height: 58px;
    border-radius: 20px;
  }

  .tydie-ai-header {
    padding: 21px 20px 17px;
  }

  .tydie-ai-header h3 {
    font-size: 18px;
  }
}

/* Tydie AI final polish */

.tydie-ai-header {
  padding: 20px 22px 16px;
}

.tydie-ai-header h3 {
  margin-left: 22px;
  font-size: 20px;
}

.tydie-ai-header p {
  font-size: 12.5px;
}

.tydie-ai-header p span {
  color: #4f9f68;
  font-weight: 800;
}

.tydie-ai-messages {
  padding: 22px;
}

.tydie-ai-message.bot:first-child {
  max-width: 100%;
  border-radius: 22px;
}

.tydie-ai-form button {
  min-width: 48px;
  width: 48px;
  padding: 0;
  font-size: 18px;
}

.tydie-ai-form input {
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .tydie-ai-header {
    padding: 18px 20px 15px;
  }

  .tydie-ai-messages {
    padding: 18px;
  }
}

.tydie-ai-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  color: #6F685F;
  font-size: 14px;
  animation: fadeTyping .2s ease;
}

.tydie-ai-typing .sparkle {
  color: #6F95BF;
  font-size: 18px;
}

.tydie-ai-typing .text {
  font-weight: 500;
}

.tydie-ai-typing .dots {
  display: flex;
  gap: 4px;
  margin-left: 2px;
}

.tydie-ai-typing .dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8FAED1;
  animation: tydieDots 1.4s infinite ease-in-out;
}

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

.tydie-ai-typing .dots span:nth-child(3) {
  animation-delay: .4s;
}

@keyframes tydieDots {
  0%, 80%, 100% {
    opacity: .25;
    transform: scale(.75);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeTyping {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .tydie-ai-button {
    bottom: 98px !important;
    right: 18px !important;
  }

  .tydie-ai-panel {
    bottom: 172px !important;
  }
}