/* ==========================================================================
   CALIDAPACK · CANLI DESTEK
   Site genelinde açılan AI + yetkili sohbet paneli.
   ========================================================================== */

.support-launcher {
  position: fixed;
  right: 22px;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 78px);
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(111, 227, 255, 0.4);
  border-radius: 999px;
  background:
    radial-gradient(circle at 24% 22%, rgba(111, 227, 255, 0.28), transparent 64%),
    linear-gradient(160deg, rgba(11, 32, 53, 0.98), rgba(4, 11, 21, 0.99));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.48),
    0 0 26px rgba(76, 157, 232, 0.24);
  color: var(--ink);
  transition:
    width 0.3s var(--ease),
    padding 0.3s var(--ease),
    gap 0.3s var(--ease),
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.support-launcher:hover,
.support-launcher:focus-visible {
  width: 198px;
  padding: 0 16px 0 12px;
  gap: 10px;
  transform: translateY(-2px);
  border-color: rgba(155, 220, 255, 0.72);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.52),
    0 0 40px rgba(111, 227, 255, 0.34);
  outline: none;
}

.support-launcher-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid rgba(155, 220, 255, 0.35);
  border-radius: 50%;
  background: rgba(8, 22, 39, 0.9);
  color: var(--ice);
}

.support-launcher-icon .icon {
  width: 17px;
  height: 17px;
}

.support-launcher-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  line-height: 1.05;
  white-space: nowrap;
  transition: width 0.28s var(--ease), max-width 0.28s var(--ease), opacity 0.2s 0.05s;
}

.support-launcher:hover .support-launcher-copy,
.support-launcher:focus-visible .support-launcher-copy {
  width: 126px;
  max-width: 126px;
  opacity: 1;
}

.support-launcher-copy strong {
  font-family: var(--display);
  font-size: 11.5px;
  letter-spacing: 0.06em;
}

.support-launcher-copy small {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.support-launcher-dot {
  position: absolute;
  top: 7px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  animation: supportPulse 2.2s ease-in-out infinite;
}

.support-panel {
  position: fixed;
  right: 22px;
  bottom: calc(max(22px, env(safe-area-inset-bottom)) + 148px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  width: min(384px, calc(100vw - 32px));
  height: min(610px, calc(100vh - 190px));
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    linear-gradient(168deg, rgba(10, 24, 42, 0.99), rgba(3, 8, 16, 0.99)),
    rgba(4, 10, 19, 0.99);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.68),
    0 0 50px rgba(76, 157, 232, 0.16);
  animation: supportIn 0.28s var(--ease);
}

.support-panel[hidden] {
  display: none;
}

.support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(90% 130% at 12% 0%, rgba(76, 157, 232, 0.18), transparent 62%),
    rgba(6, 15, 27, 0.9);
}

.support-head-id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.support-head-ava {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid rgba(155, 220, 255, 0.34);
  border-radius: 12px;
  background: rgba(8, 23, 40, 0.9);
  color: var(--ice);
}

.support-head-ava .icon {
  width: 18px;
  height: 18px;
}

.support-head-id strong {
  display: block;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.support-head-id small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.support-head-id small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
}

.support-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.support-close:hover {
  border-color: rgba(155, 220, 255, 0.45);
  background: rgba(111, 227, 255, 0.07);
  color: var(--ink);
}

.support-close .icon {
  width: 15px;
  height: 15px;
}

.support-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 7px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 11, 21, 0.6);
}

.support-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.support-tab .icon {
  width: 13px;
  height: 13px;
}

.support-tab:hover {
  color: var(--ink-2);
  background: rgba(111, 227, 255, 0.05);
}

.support-tab.is-active {
  border-color: rgba(111, 227, 255, 0.28);
  background: rgba(111, 227, 255, 0.09);
  color: var(--ice);
}

.support-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 227, 255, 0.3) transparent;
}

.support-body::-webkit-scrollbar {
  width: 6px;
}

.support-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(111, 227, 255, 0.25);
}

.support-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 250px;
  padding: 26px 18px;
  text-align: center;
}

.support-empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(111, 227, 255, 0.28);
  border-radius: 16px;
  background: rgba(111, 227, 255, 0.07);
  color: var(--ice);
}

.support-empty-icon .icon {
  width: 24px;
  height: 24px;
}

.support-empty h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.support-empty p {
  max-width: 280px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.support-empty .btn {
  height: 40px;
  padding: 0 18px;
}

.support-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 13px;
}

.support-msg-user {
  flex-direction: row-reverse;
}

.support-msg-ava {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 22, 38, 0.9);
  color: var(--faint);
}

.support-msg-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.support-msg-ava .icon {
  width: 12px;
  height: 12px;
}

.support-bubble-wrap {
  max-width: 82%;
  min-width: 0;
}

.support-bubble-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.06em;
  color: var(--faint);
}

.support-msg-user .support-bubble-meta {
  justify-content: flex-end;
}

.support-bubble-meta em {
  padding: 2px 5px;
  border: 1px solid rgba(111, 227, 255, 0.24);
  border-radius: 4px;
  font-style: normal;
  font-size: 6.5px;
  color: var(--ice);
}

.support-bubble {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  background: rgba(9, 21, 37, 0.92);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.support-msg-user .support-bubble {
  border-color: rgba(111, 227, 255, 0.3);
  border-radius: 12px 12px 4px 12px;
  background: linear-gradient(160deg, rgba(22, 57, 92, 0.95), rgba(10, 29, 50, 0.95));
  color: #e8f6ff;
}

.support-msg-admin .support-bubble {
  border-color: rgba(240, 198, 116, 0.3);
  background: rgba(42, 34, 18, 0.7);
  color: #ffe7bc;
}

.support-msg-assistant .support-bubble {
  border-color: rgba(111, 227, 196, 0.22);
  background: rgba(8, 31, 32, 0.55);
}

.support-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.support-attachments img,
.support-attachments span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 11, 21, 0.8);
  object-fit: cover;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--faint);
}

.support-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(111, 227, 196, 0.22);
  border-radius: 12px 12px 12px 4px;
  background: rgba(8, 31, 32, 0.55);
}

.support-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  animation: supportTyping 1.2s ease-in-out infinite;
}

.support-typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.support-typing i:nth-child(3) {
  animation-delay: 0.3s;
}

.support-quick {
  display: flex;
  gap: 6px;
  padding: 0 14px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.support-quick::-webkit-scrollbar {
  display: none;
}

.support-quick button {
  flex: none;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 20, 35, 0.72);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.support-quick button:hover {
  border-color: rgba(111, 227, 255, 0.4);
  background: rgba(111, 227, 255, 0.07);
  color: var(--ice);
}

.support-attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 8px;
}

.support-attach-row:empty {
  display: none;
}

.support-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid rgba(111, 227, 255, 0.28);
  border-radius: 6px;
  background: rgba(111, 227, 255, 0.07);
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--ice);
}

.support-attach-chip button {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.support-attach-chip button:hover {
  color: #ff9a9a;
}

.support-form {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(4, 10, 19, 0.88);
}

.support-attach {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.support-attach:hover {
  border-color: rgba(111, 227, 255, 0.4);
  background: rgba(111, 227, 255, 0.06);
  color: var(--ice);
}

.support-attach .icon {
  width: 15px;
  height: 15px;
}

.support-input {
  flex: 1;
  min-height: 38px;
  max-height: 96px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 16, 29, 0.8);
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  resize: none;
}

.support-input::placeholder {
  color: var(--faint);
}

.support-input:focus {
  border-color: rgba(111, 227, 255, 0.42);
  outline: none;
}

.support-send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid rgba(111, 227, 255, 0.4);
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(111, 227, 255, 0.22), rgba(37, 104, 184, 0.22));
  color: var(--ice);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.support-send:hover {
  background: linear-gradient(160deg, rgba(111, 227, 255, 0.32), rgba(37, 104, 184, 0.32));
  border-color: rgba(155, 220, 255, 0.7);
}

.support-send:active {
  transform: scale(0.96);
}

.support-send:disabled {
  opacity: 0.45;
  cursor: default;
}

.support-send .icon {
  width: 16px;
  height: 16px;
}

.support-foot {
  padding: 0 14px 10px;
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.support-foot.is-error {
  color: #ff9a9a;
}

@keyframes supportIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes supportPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes supportTyping {
  0%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 720px) {
  .support-launcher {
    right: 16px;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 66px);
    width: 50px;
    height: 50px;
    padding: 0;
  }

  .support-launcher:hover,
  .support-launcher:focus-visible {
    width: 50px;
    padding: 0;
    gap: 0;
  }

  .support-launcher-icon {
    width: 32px;
    height: 32px;
  }

  .support-launcher-copy {
    display: none;
  }

  .support-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(78vh, 640px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .support-foot {
    padding-bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-launcher-dot,
  .support-typing i {
    animation: none;
  }
}
