/* =========================================================
   TEKTON ELEVATORS
   PREMIUM GOLD AI ASSISTANT
   ========================================================= */

.ai-elevator-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family:
    "Montserrat",
    Arial,
    sans-serif;
}

/* =========================================================
   GOLD BUTTON
   ========================================================= */

.ai-fab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  min-width: 190px;
  height: 54px;
  padding: 0 24px;

  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #fff7c2 0%,
      #f5d66f 18%,
      #d4a62a 48%,
      #f1ce61 72%,
      #fff2ab 100%
    );

  color: #081b36;

  font-family:
    "Montserrat",
    Arial,
    sans-serif;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;

  cursor: pointer;

  box-shadow:
    0 8px 25px rgba(198,155,43,.35),
    0 0 0 1px rgba(255,215,100,.15),
    inset 0 1px 0 rgba(255,255,255,.75),
    inset 0 -2px 5px rgba(109,73,7,.2);

  transition:
    transform .25s ease,
    box-shadow .25s ease,
    filter .25s ease;
}

.ai-fab-btn::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;

  background:
    linear-gradient(
      120deg,
      transparent 0%,
      rgba(255,255,255,.55) 45%,
      transparent 58%
    );

  opacity: .45;
  pointer-events: none;
}

.ai-fab-btn:hover {
  transform: translateY(-3px);

  filter: brightness(1.08);

  box-shadow:
    0 14px 38px rgba(198,155,43,.48),
    0 0 24px rgba(240,199,77,.28),
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -2px 5px rgba(109,73,7,.18);
}

.ai-fab-btn:active {
  transform: translateY(0) scale(.98);
}

.ai-fab-icon {
  font-size: 18px;
  line-height: 1;
  color: #8e6511;
  position: relative;
  z-index: 1;
}

.ai-fab-text {
  position: relative;
  z-index: 1;
}

/* =========================================================
   MODAL
   ========================================================= */

.ai-lift-modal {
  position: fixed;

  right: 24px;
  bottom: 92px;

  width: min(410px, calc(100vw - 30px));
  height: min(620px, calc(100vh - 130px));

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform:
    translateY(30px)
    scale(.96);

  transition:
    opacity .25s ease,
    transform .25s ease,
    visibility .25s ease;

  z-index: 2147483001;
}

.ai-lift-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform:
    translateY(0)
    scale(1);
}

/* =========================================================
   LIFT SHAFT
   ========================================================= */

.ai-lift-shaft {
  position: relative;

  width: 100%;
  height: 100%;

  overflow: hidden;

  border-radius: 18px;

  background:
    linear-gradient(
      180deg,
      #020812 0%,
      #061427 45%,
      #020812 100%
    );

  border:
    1px solid rgba(226,181,57,.8);

  box-shadow:
    0 25px 70px rgba(0,0,0,.75),
    0 0 50px rgba(212,166,42,.16),
    inset 0 0 0 1px rgba(255,255,255,.04);
}

/* GOLD OUTER FRAME */

.ai-lift-shaft::before {
  content: "";
  position: absolute;
  inset: 7px;

  border:
    1px solid rgba(238,198,77,.45);

  border-radius: 13px;

  pointer-events: none;

  z-index: 30;
}

/* =========================================================
   CABIN INTERIOR
   ========================================================= */

.ai-cabin-interior {
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at 50% 40%,
      rgba(239,194,70,.11),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #0a203d 0%,
      #08182e 50%,
      #030b16 100%
    );

  display: flex;
  flex-direction: column;
}

/* BACK LIGHT */

.ai-cabin-glow {
  position: absolute;

  width: 180px;
  height: 180px;

  top: 105px;
  left: 50%;

  transform: translateX(-50%);

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(229,193,88,.25) 0%,
      rgba(229,193,88,.08) 38%,
      transparent 72%
    );

  filter: blur(8px);

  pointer-events: none;
}

/* =========================================================
   CABIN LOGO
   ========================================================= */

.ai-cabin-logo {
  position: absolute;

  left: 50%;
  top: 48%;

  transform:
    translate(-50%, -50%);

  z-index: 1;

  opacity: 0;

  transition:
    opacity .55s ease .35s;
}

.ai-lift-modal.doors-open .ai-cabin-logo {
  opacity: .9;
}

.ai-cabin-logo img {
  width: 150px;
  height: auto;

  display: block;

  filter:
    drop-shadow(0 0 15px rgba(229,193,88,.3));
}

/* =========================================================
   CHAT CONTENT
   ========================================================= */

.ai-chat-content {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;

  opacity: 0;

  transition:
    opacity .35s ease .45s;

  z-index: 2;
}

.ai-lift-modal.doors-open .ai-chat-content {
  opacity: 1;
}

/* =========================================================
   HEADER
   ========================================================= */

.ai-chat-header {
  min-height: 78px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding:
    0 18px
    0 20px;

  background:
    linear-gradient(
      135deg,
      #081d38 0%,
      #0e294b 55%,
      #08182e 100%
    );

  border-bottom:
    1px solid rgba(229,193,88,.38);

  box-shadow:
    0 4px 18px rgba(0,0,0,.18);

  color: #fff;

  position: relative;
  z-index: 10;
}

.ai-brand-title {
  display: flex;
  flex-direction: column;

  gap: 3px;
}

.ai-brand-title strong {
  font-size: 13px;
  letter-spacing: .13em;
  color: #f7d56d;
}

.ai-brand-title small {
  font-size: 10px;
  letter-spacing: .08em;
  color: rgba(255,255,255,.67);
}

.status-indicator {
  width: 7px;
  height: 7px;

  margin-bottom: 3px;

  border-radius: 50%;

  background: #f0c957;

  box-shadow:
    0 0 7px rgba(240,201,87,.9);
}

.ai-chat-close {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border:
    1px solid rgba(229,193,88,.3);

  border-radius: 50%;

  background:
    rgba(0,0,0,.18);

  color: #f4d36b;

  font-size: 25px;
  line-height: 1;

  cursor: pointer;

  transition:
    background .2s ease,
    transform .2s ease,
    border-color .2s ease;
}

.ai-chat-close:hover {
  transform: rotate(90deg);

  background:
    rgba(229,193,88,.12);

  border-color:
    rgba(229,193,88,.7);
}

/* =========================================================
   CHAT LOG
   ========================================================= */

.ai-chat-log {
  flex: 1;

  min-height: 0;

  overflow-y: auto;

  padding: 18px;

  display: flex;
  flex-direction: column;

  gap: 10px;

  background:
    linear-gradient(
      180deg,
      #f8f3e7 0%,
      #f2ecdd 100%
    );

  scrollbar-width: thin;
  scrollbar-color:
    #d4a52f
    #e9dfc9;
}

.ai-chat-log::-webkit-scrollbar {
  width: 6px;
}

.ai-chat-log::-webkit-scrollbar-track {
  background: #e9dfc9;
}

.ai-chat-log::-webkit-scrollbar-thumb {
  background:
    linear-gradient(
      #f1d56a,
      #b98518
    );

  border-radius: 20px;
}

/* =========================================================
   MESSAGES
   ========================================================= */

.tkmsg {
  display: flex;

  max-width: 88%;

  flex-direction: column;
}

.tkmsg--bot {
  align-self: flex-start;
}

.tkmsg--user {
  align-self: flex-end;
}

.tkmsg__body {
  padding:
    11px 14px;

  border-radius: 12px;

  font-size: 13px;
  line-height: 1.55;
}

/* BOT */

.tkmsg--bot .tkmsg__body {
  background:
    #fffdf8;

  color: #132844;

  border:
    1px solid #e3d5b7;

  border-bottom-left-radius: 4px;

  box-shadow:
    0 4px 12px rgba(76,56,14,.06);
}

/* USER */

.tkmsg--user .tkmsg__body {
  background:
    linear-gradient(
      135deg,
      #0d315d,
      #081e3a
    );

  color: #f8da76;

  border:
    1px solid rgba(229,193,88,.35);

  border-bottom-right-radius: 4px;
}

/* =========================================================
   SUGGESTIONS
   ========================================================= */

.ai-suggestions {
  display: flex;

  gap: 7px;

  padding:
    8px 14px;

  overflow-x: auto;

  background:
    #f4eddf;

  border-top:
    1px solid #e6dbc5;
}

.ai-suggestions button {
  flex: 0 0 auto;

  padding:
    7px 11px;

  border:
    1px solid #d5bd84;

  border-radius: 999px;

  background:
    #fffdf8;

  color:
    #7b5911;

  font-size:
    11px;

  font-weight:
    700;

  cursor: pointer;

  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease;
}

.ai-suggestions button:hover {
  background:
    linear-gradient(
      135deg,
      #f8e59e,
      #d8aa35
    );

  border-color:
    #c59520;

  color:
    #081b36;
}

/* =========================================================
   FORM
   ========================================================= */

.ai-chat-form {
  display: flex;

  gap: 8px;

  padding:
    11px 12px;

  background:
    #081b36;

  border-top:
    1px solid rgba(229,193,88,.38);
}

.ai-chat-form input {
  flex: 1;

  min-width: 0;

  height: 43px;

  padding:
    0 13px;

  border:
    1px solid #cda53f;

  border-radius:
    9px;

  outline: none;

  background:
    #fffdf8;

  color:
    #102745;

  font-size:
    13px;
}

.ai-chat-form input::placeholder {
  color:
    #8c8c83;
}

.ai-chat-form input:focus {
  border-color:
    #f0cd61;

  box-shadow:
    0 0 0 3px rgba(229,193,88,.12);
}

.ai-chat-form button {
  height: 43px;

  padding:
    0 17px;

  border:
    1px solid rgba(255,255,255,.22);

  border-radius:
    9px;

  background:
    linear-gradient(
      135deg,
      #fff1a4 0%,
      #efca5e 35%,
      #c99620 100%
    );

  color:
    #0a1a2d;

  font-size:
    11px;

  font-weight:
    800;

  letter-spacing:
    .08em;

  cursor:
    pointer;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    0 5px 16px rgba(198,155,43,.2);

  transition:
    transform .2s ease,
    filter .2s ease;
}

.ai-chat-form button:hover {
  transform:
    translateY(-1px);

  filter:
    brightness(1.08);
}

.ai-chat-form button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* =========================================================
   LOADING
   ========================================================= */

.ai-loading-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ai-loading-dots {
  display: inline-flex;
  gap: 4px;
}

.ai-loading-dots span {
  width: 5px;
  height: 5px;

  border-radius: 50%;

  background:
    #c79624;

  animation:
    tektonDot 1.2s infinite ease-in-out;
}

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

.ai-loading-dots span:nth-child(3) {
  animation-delay: .30s;
}

@keyframes tektonDot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: .45;
  }

  30% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

/* =========================================================
   LIFT DOORS
   ========================================================= */

.ai-lift-doors {
  position: absolute;
  inset: 0;

  z-index: 20;

  pointer-events: none;
}

.ai-door-pane {
  position: absolute;

  top: 0;
  bottom: 0;

  width: 50%;

  background:
    linear-gradient(
      115deg,
      #0a1c34 0%,
      #102d4f 30%,
      #0a1e38 55%,
      #051327 100%
    );

  border:
    1px solid rgba(225,180,54,.68);

  box-shadow:
    inset 0 0 30px rgba(0,0,0,.32),
    inset 0 0 0 1px rgba(255,255,255,.03);

  transition:
    transform
    .85s
    cubic-bezier(.76,0,.18,1);

  overflow: hidden;
}

.ai-door-pane::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      90deg,
      transparent 0%,
      rgba(229,193,88,.08) 48%,
      transparent 100%
    );

  opacity: .9;
}

.ai-door-pane::after {
  content: "";

  position: absolute;
  top: 0;
  bottom: 0;

  width: 1px;

  background:
    linear-gradient(
      transparent,
      rgba(246,209,96,.8),
      transparent
    );

  box-shadow:
    0 0 10px rgba(229,193,88,.22);
}

.ai-door-left {
  left: 0;

  border-right:
    1px solid rgba(229,193,88,.85);
}

.ai-door-left::after {
  right: 0;
}

.ai-door-right {
  right: 0;

  border-left:
    1px solid rgba(229,193,88,.85);
}

.ai-door-right::after {
  left: 0;
}

/* OPEN */

.ai-lift-modal.doors-open .ai-door-left {
  transform:
    translateX(-102%);
}

.ai-lift-modal.doors-open .ai-door-right {
  transform:
    translateX(102%);
}

/* =========================================================
   DOOR LOGO
   ========================================================= */

.ai-door-logo {
  position: absolute;

  left: 50%;
  top: 50%;

  transform:
    translate(-50%, -50%);

  z-index: 25;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 190px;
  height: 110px;

  pointer-events: none;

  transition:
    opacity .25s ease,
    transform .85s ease;
}

.ai-door-logo img {
  width: 150px;
  max-width: 80%;

  height: auto;

  filter:
    drop-shadow(0 0 10px rgba(229,193,88,.28));
}

.ai-lift-modal.doors-open .ai-door-logo {
  opacity: 0;

  transform:
    translate(-50%, -50%)
    scale(.92);
}

/* =========================================================
   CENTER GOLD LINE
   ========================================================= */

.ai-door-center-line {
  position: absolute;

  top: 0;
  bottom: 0;

  left: 50%;

  width: 2px;

  transform:
    translateX(-50%);

  background:
    linear-gradient(
      transparent 0%,
      #f0ca57 20%,
      #fff0a2 50%,
      #d7aa32 80%,
      transparent 100%
    );

  box-shadow:
    0 0 12px rgba(229,193,88,.55);

  transition:
    opacity .35s ease;
}

.ai-lift-modal.doors-open .ai-door-center-line {
  opacity: 0;
}

/* =========================================================
   DESKTOP GOLD FRAME
   ========================================================= */

.ai-lift-shaft::after {
  content: "";

  position: absolute;
  inset: 0;

  border:
    3px solid transparent;

  border-radius:
    18px;

  background:
    linear-gradient(
      135deg,
      rgba(255,240,165,.35),
      transparent 28%,
      transparent 70%,
      rgba(216,169,48,.3)
    )
    border-box;

  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);

  -webkit-mask-composite:
    xor;

  mask-composite:
    exclude;

  pointer-events:
    none;

  z-index:
    50;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

  .ai-elevator-widget {
    right: 14px;
    bottom: 14px;
  }

  .ai-fab-btn {
    min-width: 58px;
    width: 58px;
    height: 58px;

    padding: 0;

    border-radius: 50%;
  }

  .ai-fab-icon {
    font-size: 21px;
  }

  .ai-fab-text {
    display: none;
  }

  .ai-lift-modal {
    right: 10px;
    left: 10px;

    bottom: 84px;

    width: auto;

    height:
      min(600px, calc(100vh - 110px));
  }

  .ai-chat-header {
    min-height: 70px;
  }

  .ai-chat-log {
    padding: 14px;
  }

  .ai-cabin-logo img {
    width: 120px;
  }

  .ai-door-logo img {
    width: 125px;
  }
}

/* =========================================================
   TEKTON AI — FINAL OVERRIDES
   ========================================================= */

.ai-elevator-widget,
.ai-elevator-widget * {
  box-sizing: border-box;
}

.ai-elevator-widget {
  isolation: isolate;
  pointer-events: auto !important;
}

.ai-fab-btn {
  -webkit-appearance: none;
  appearance: none;
  position: relative !important;
  z-index: 2147483002 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
}

.ai-lift-modal {
  pointer-events: none;
}

.ai-lift-modal.is-active {
  pointer-events: auto !important;
}

.ai-door-pane {
  backface-visibility: hidden;
  will-change: transform;
}

.ai-door-logo {
  backface-visibility: hidden;
  will-change: opacity, transform;
}

.ai-chat-content,
.ai-chat-header,
.ai-chat-log,
.ai-chat-form {
  pointer-events: auto;
}

.ai-chat-header,
.ai-chat-log,
.ai-chat-form {
  position: relative;
  z-index: 60;
}

.ai-chat-close,
.ai-chat-form input,
.ai-chat-form button {
  pointer-events: auto !important;
}
