/* Luxus Umzug floating chat widget — scoped under #luxus-chat-root */

#luxus-chat-root {
  --lux-navy: #0c2340;
  --lux-navy-deep: #081a30;
  --lux-anthracite: #132840;
  --lux-gold: #c9a227;
  --lux-gold-light: #e0c36a;
  --lux-white: #ffffff;
  --lux-muted: rgba(255, 255, 255, 0.72);
  --lux-radius: 18px;
  --lux-shadow: 0 18px 50px rgb(8 26 48 / 0.45);
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99990;
  font-family: var(--font-sans), ui-sans-serif, system-ui, sans-serif;
  color: var(--lux-white);
  line-height: 1.45;
}

#luxus-chat-root *,
#luxus-chat-root *::before,
#luxus-chat-root *::after {
  box-sizing: border-box;
}

#luxus-chat-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 18px 0 14px;
  border: 1px solid rgb(201 162 39 / 0.55);
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(12 35 64 / 0.98), #0c2340 55%, #081a30);
  color: var(--lux-gold-light);
  box-shadow:
    0 12px 30px rgb(8 26 48 / 0.4),
    0 0 0 1px rgb(255 255 255 / 0.06) inset;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#luxus-chat-trigger:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 34px rgb(8 26 48 / 0.5);
}

#luxus-chat-trigger:focus-visible {
  outline: 2px solid var(--lux-gold);
  outline-offset: 3px;
}

#luxus-chat-trigger .luxus-chat-trigger-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgb(201 162 39 / 0.18);
  color: var(--lux-gold);
}

#luxus-chat-trigger .luxus-chat-trigger-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

#luxus-chat-box {
  display: none;
  flex-direction: column;
  width: min(100vw - 28px, 380px);
  height: min(72vh, 560px);
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgb(201 162 39 / 0.35);
  border-radius: var(--lux-radius);
  background:
    linear-gradient(165deg, rgb(19 40 64 / 0.92), rgb(8 26 48 / 0.96)),
    rgb(8 26 48 / 0.88);
  box-shadow: var(--lux-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

#luxus-chat-root.is-open #luxus-chat-box {
  display: flex;
  animation: luxus-chat-rise 0.28s ease both;
}

#luxus-chat-root.is-open #luxus-chat-trigger {
  display: none;
}

.luxus-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  background: linear-gradient(90deg, rgb(201 162 39 / 0.14), transparent 70%);
}

.luxus-chat-header-copy {
  min-width: 0;
}

.luxus-chat-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--lux-gold-light);
}

.luxus-chat-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--lux-muted);
}

.luxus-chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #3ecf8e;
  box-shadow: 0 0 0 4px rgb(62 207 142 / 0.18);
}

.luxus-chat-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.04);
  color: var(--lux-white);
  cursor: pointer;
}

.luxus-chat-close:hover {
  border-color: rgb(201 162 39 / 0.45);
  color: var(--lux-gold-light);
}

.luxus-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.luxus-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.luxus-chat-bubble.is-bot {
  align-self: flex-start;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.06);
  color: rgb(255 255 255 / 0.94);
  border-bottom-left-radius: 4px;
}

.luxus-chat-bubble.is-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #c9a227, #a8841a);
  color: #0c2340;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

.luxus-chat-bubble a {
  color: var(--lux-gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.luxus-chat-bubble.is-user a {
  color: #0c2340;
}

.luxus-chat-typing {
  display: none;
  align-self: flex-start;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(255 255 255 / 0.06);
}

.luxus-chat-typing.is-visible {
  display: inline-flex;
}

.luxus-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--lux-gold);
  opacity: 0.45;
  animation: luxus-chat-dot 1.1s ease-in-out infinite;
}

.luxus-chat-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.luxus-chat-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

.luxus-chat-quick-wrap {
  flex-shrink: 0;
  padding: 0 14px 10px;
  border-top: 1px solid rgb(255 255 255 / 0.06);
}

.luxus-chat-quick-label {
  margin: 8px 2px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(224 195 106 / 0.75);
}

.luxus-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 96px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.luxus-chat-quick button {
  border: 1px solid rgb(201 162 39 / 0.4);
  border-radius: 999px;
  background: rgb(201 162 39 / 0.08);
  color: var(--lux-gold-light);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
  touch-action: manipulation;
}

.luxus-chat-quick button:hover {
  background: rgb(201 162 39 / 0.18);
  border-color: rgb(201 162 39 / 0.7);
}

.luxus-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(0 0 0 / 0.18);
}

.luxus-chat-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.05);
  color: var(--lux-white);
  padding: 0 12px;
  font-size: 16px;
  outline: none;
}

.luxus-chat-form input::placeholder {
  color: rgb(255 255 255 / 0.45);
}

.luxus-chat-form input:focus {
  border-color: rgb(201 162 39 / 0.55);
  box-shadow: 0 0 0 3px rgb(201 162 39 / 0.15);
}

.luxus-chat-form button[type='submit'] {
  flex-shrink: 0;
  height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0c36a, #c9a227);
  color: #0c2340;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.luxus-chat-form button[type='submit']:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.luxus-chat-footnote {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 10px;
  color: rgb(255 255 255 / 0.42);
}

@keyframes luxus-chat-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes luxus-chat-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 480px) {
  #luxus-chat-root {
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    left: auto;
  }

  #luxus-chat-box {
    width: min(100vw - 20px, 100%);
    height: min(82dvh, 640px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    margin-bottom: 10px;
  }

  #luxus-chat-trigger .luxus-chat-trigger-label {
    display: inline;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    max-width: none;
    text-align: left;
  }

  #luxus-chat-trigger {
    width: auto;
    min-width: 0;
    min-height: 64px;
    height: auto;
    gap: 10px;
    padding: 10px 16px 10px 12px;
  }

  #luxus-chat-trigger .luxus-chat-trigger-icon {
    width: 38px;
    height: 38px;
  }

  .luxus-chat-quick {
    max-height: 110px;
  }

  .luxus-chat-quick button {
    width: 100%;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .luxus-chat-bubble {
    max-width: 94%;
    font-size: 14px;
  }
}

html.luxus-chat-open,
html.luxus-chat-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

@media (min-width: 481px) {
  html.luxus-chat-open,
  html.luxus-chat-open body {
    overflow: auto;
    overscroll-behavior: auto;
  }
}
