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

.zeks-ai-widget {
  position: fixed;
  bottom: 24px;
  z-index: 999999;
  font-family: inherit;
  --shadow-lg: 0 24px 70px rgba(17, 24, 39, 0.28);
  --shadow-md: 0 14px 35px rgba(17, 24, 39, 0.2);
}

.zeks-ai-widget.zeks-ai-right {
  right: 24px;
}

.zeks-ai-widget.zeks-ai-left {
  left: 24px;
}

.zeks-ai-launcher {
  width: 66px;
  height: 66px;
  border: 0;
  border-radius: 24px;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--zeks-ai-primary), var(--zeks-ai-secondary));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.zeks-ai-launcher i {
  font-size: 25px;
  position: relative;
  z-index: 2;
}

.zeks-ai-launcher-glow {
  position: absolute;
  inset: -18px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.45), transparent 32%);
}

.zeks-ai-launcher:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 20px 50px rgba(17, 24, 39, 0.32);
}

.zeks-ai-panel {
  position: absolute;
  bottom: 82px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 120px);
  display: none;
  flex-direction: column;
  background: var(--zeks-ai-surface, #fff);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.55);
}

.zeks-ai-right .zeks-ai-panel {
  right: 0;
}

.zeks-ai-left .zeks-ai-panel {
  left: 0;
}

.zeks-ai-widget.active .zeks-ai-panel {
  display: flex;
  animation: zeksAiPanelIn .28s ease both;
}

@keyframes zeksAiPanelIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.zeks-ai-panel-head {
  padding: 17px 18px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.23), transparent 35%),
    linear-gradient(135deg, var(--zeks-ai-primary), var(--zeks-ai-secondary));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.zeks-ai-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.zeks-ai-avatar {
  width: 43px;
  height: 43px;
  border-radius: 16px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.18);
}

.zeks-ai-avatar i {
  font-size: 20px;
}

.zeks-ai-brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zeks-ai-brand small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  opacity: .9;
}

.zeks-ai-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}

.zeks-ai-close {
  width: 37px;
  height: 37px;
  border: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.zeks-ai-close:hover {
  background: rgba(255,255,255,.22);
  transform: rotate(4deg);
}

.zeks-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(circle at 20% 0%, rgba(237,34,36,.08), transparent 27%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  scrollbar-width: thin;
}

.zeks-ai-row {
  display: flex;
  margin: 0 0 12px;
}

.zeks-ai-row.from-user {
  justify-content: flex-end;
}

.zeks-ai-row.from-bot {
  justify-content: flex-start;
}

.zeks-ai-bubble {
  max-width: 86%;
  border-radius: 19px;
  padding: 12px 13px 8px;
  font-size: 14px;
  line-height: 1.75;
  word-break: break-word;
  position: relative;
}

.zeks-ai-bubble p {
  margin: 0 0 8px;
}

.zeks-ai-bubble p:last-child {
  margin-bottom: 0;
}

.zeks-ai-bubble ul {
  margin: 7px 0;
  padding-inline-start: 20px;
}

.zeks-ai-bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.zeks-ai-bubble.bot {
  background: rgba(255,255,255,.96);
  color: #111827;
  border-bottom-inline-start-radius: 6px;
  box-shadow: 0 8px 22px rgba(17,24,39,.07);
  border: 1px solid rgba(17,24,39,.05);
}

.zeks-ai-bubble.user {
  background: linear-gradient(135deg, var(--zeks-ai-primary), #9f1239);
  color: #fff;
  border-bottom-inline-end-radius: 6px;
  box-shadow: 0 10px 24px rgba(237,34,36,.24);
}

.zeks-ai-bubble.error {
  background: #fff1f2;
  color: #be123c;
}

.zeks-ai-meta {
  margin-top: 5px;
  font-size: 10px;
  opacity: .58;
  line-height: 1;
}

.zeks-ai-sources {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(17,24,39,.08);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.zeks-ai-sources span {
  font-size: 11px;
  opacity: .7;
}

.zeks-ai-sources a {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zeks-ai-bubble.typing {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 11px 13px;
}

.zeks-ai-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.zeks-ai-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
  animation: zeksAiDot 1s infinite ease-in-out;
}

.zeks-ai-dots i:nth-child(2) { animation-delay: .15s; }
.zeks-ai-dots i:nth-child(3) { animation-delay: .3s; }

@keyframes zeksAiDot {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: .9; }
}


.zeks-ai-form {
  padding: 12px 14px 13px;
  background: #fff;
  border-top: 1px solid rgba(17,24,39,.06);
}

.zeks-ai-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 18px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 5px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.zeks-ai-input-wrap:focus-within {
  border-color: var(--zeks-ai-primary);
  box-shadow: 0 0 0 4px rgba(237,34,36,.08);
}

.zeks-ai-input {
  flex: 1;
  height: 38px;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  padding: 0 10px !important;
  min-width: 0;
  box-shadow: none !important;
  font-size: 14px;
  color: #111827;
}

.zeks-ai-mic,
.zeks-ai-send {
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--zeks-ai-primary), var(--zeks-ai-secondary));
  transition: transform .2s ease, opacity .2s ease;
}

.zeks-ai-mic:hover,
.zeks-ai-send:hover {
  transform: translateY(-1px);
}

.zeks-ai-send:disabled {
  opacity: .7;
  cursor: not-allowed;
}

.zeks-ai-powered {
  margin-top: 7px;
  text-align: center;
  color: #9ca3af;
  font-size: 10px;
}

.zeks-ai-widget.is-ar .zeks-ai-send i {
  transform: rotate(180deg);
}

.zeks-ai-widget.is-en .zeks-ai-send i {
  transform: rotate(0deg);
}

@media (max-width: 480px) {
  .zeks-ai-widget {
    bottom: 16px;
  }
  .zeks-ai-widget.zeks-ai-right {
    right: 16px;
  }
  .zeks-ai-widget.zeks-ai-left {
    left: 16px;
  }
  .zeks-ai-panel {
    width: calc(100vw - 32px);
    height: 76vh;
    bottom: 78px;
    border-radius: 24px;
  }
  .zeks-ai-launcher {
    width: 60px;
    height: 60px;
    border-radius: 22px;
  }
  .zeks-ai-bubble {
    max-width: 91%;
  }
}


.zeks-ai-mic {
  background: #ffffff;
  color: var(--zeks-ai-primary);
  border: 1px solid #e5e7eb;
}

.zeks-ai-mic.listening {
  color: #fff;
  background: linear-gradient(135deg, var(--zeks-ai-primary), var(--zeks-ai-secondary));
  animation: zeksAiPulse 1s infinite;
}

@keyframes zeksAiPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
