/* Ara AI Chatbot Widget */
.zino-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  width: auto;
  max-width: none;
}

.zino-launcher {
  --zino-launcher-width: 96px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 0;
  transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.zino-launcher-image {
  position: relative;
  z-index: auto;
  display: block;
  width: var(--zino-launcher-width);
  line-height: 0;
  flex-shrink: 0;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.zino-launcher-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: var(--zino-launcher-width);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 6px 14px color-mix(in srgb, var(--primary-color, #22b0af) 55%, transparent))
    drop-shadow(0 0 18px color-mix(in srgb, var(--primary-color, #22b0af) 40%, transparent));
}

.zino-launcher-btn {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--zino-launcher-width);
  min-height: 26px;
  margin-top: -12px;
  padding: 4px 6px;
  border-radius: 7px;
  background: var(--primary-color, #22b0af);
  color: #fff;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  box-shadow:
    0 6px 16px color-mix(in srgb, var(--primary-color, #22b0af) 45%, transparent),
    0 0 12px color-mix(in srgb, var(--primary-color, #22b0af) 30%, transparent);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.zino-launcher-label {
  pointer-events: none;
  user-select: none;
}

.zino-launcher:hover,
.zino-launcher:focus-visible {
  transform: translateY(-4px);
  outline: none;
}

.zino-launcher:hover .zino-launcher-btn,
.zino-launcher:focus-visible .zino-launcher-btn {
  filter: brightness(1.06);
  box-shadow:
    0 12px 28px color-mix(in srgb, var(--primary-color, #22b0af) 55%, transparent),
    0 0 22px color-mix(in srgb, var(--primary-color, #22b0af) 38%, transparent);
}

.zino-launcher:hover .zino-launcher-image,
.zino-launcher:focus-visible .zino-launcher-image {
  transform: translateY(-2px);
  filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--primary-color, #22b0af) 50%, transparent));
}

.zino-launcher:active {
  transform: translateY(-1px);
}

.zino-launcher:active .zino-launcher-btn {
  transform: scale(0.98);
}

.zino-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  z-index: 3;
  width: min(390px, calc(100vw - 32px));
  max-width: min(390px, calc(100vw - 32px)) !important;
  min-width: 280px;
  height: 520px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 24px !important;
  box-shadow: 0 20px 60px rgba(3, 10, 21, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* Override global .glass-card { max-width: 100% } from portal-responsive */
.zino-widget .zino-panel.glass-card {
  width: min(390px, calc(100vw - 32px));
  max-width: min(390px, calc(100vw - 32px)) !important;
}

.zino-panel[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.zino-panel-open .zino-launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.96);
}

.zino-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  background: color-mix(in srgb, var(--primary-color, #22b0af) 14%, transparent);
  flex-shrink: 0;
  min-width: 0;
}

.zino-panel-brand {
  flex: 1;
  min-width: 0;
}

.zino-panel-brand strong {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-size: 15px;
}

.zino-brand-favicon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(3, 10, 21, 0.12);
}

.zino-panel-brand small {
  display: block;
  color: #475569;
  font-size: 11px;
  line-height: 1.3;
}

.zino-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.zino-lang-select {
  border-radius: 50px;
  border: 1px solid rgba(34, 176, 175, 0.35);
  background: rgba(255, 255, 255, 0.75);
  padding: 4px 8px;
  font-size: 11px;
  max-width: 96px;
}

.zino-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(34, 176, 175, 0.25);
  background: rgba(255, 255, 255, 0.7);
  color: #22b0af;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.zino-messages {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(34, 176, 175, 0.45) transparent;
}

.zino-messages::-webkit-scrollbar {
  width: 6px;
}

.zino-messages::-webkit-scrollbar-thumb {
  background: rgba(34, 176, 175, 0.45);
  border-radius: 999px;
}

.zino-messages::-webkit-scrollbar-track {
  background: transparent;
}

.zino-msg {
  display: flex;
}

.zino-msg-bot { justify-content: flex-start; }
.zino-msg-user { justify-content: flex-end; }

.zino-msg-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  color: #1e293b;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
}

.zino-msg-bot .zino-msg-bubble {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 16px rgba(3, 10, 21, 0.06);
}

.zino-msg-user .zino-msg-bubble {
  background: linear-gradient(135deg, rgba(34, 176, 175, 0.92), rgba(20, 130, 130, 0.95));
  color: #fff;
}

.zino-msg-bubble ul {
  margin: 0;
  padding-left: 18px;
}

.zino-msg-bubble li {
  margin-bottom: 4px;
}

.zino-msg-bubble a {
  color: #22b0af;
  font-weight: 600;
  text-decoration: underline;
}

.zino-msg-user .zino-msg-bubble a {
  color: #fff;
}

.zino-input-wrap {
  display: flex;
  gap: 8px;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
  position: relative;
  z-index: 4;
  min-width: 0;
}

.zino-input-wrap input {
  flex: 1;
  min-width: 0;
  border-radius: 50px;
  border: 1px solid rgba(34, 176, 175, 0.25);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 16px;
  outline: none;
  color: #0f172a;
  font-size: 16px;
}

.zino-send-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: linear-gradient(135deg, rgba(34, 176, 175, 0.95), rgba(18, 110, 110, 0.98)) !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: auto !important;
  position: relative;
  flex-shrink: 0;
}

.zino-send-btn i {
  color: #fff !important;
}

body.zino-panel-open {
  overflow: hidden;
}

.zino-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 21, 0.45);
  z-index: 99998;
  backdrop-filter: blur(2px);
}

body.zino-panel-open .zino-backdrop {
  display: block;
}

@media (max-width: 767px) {
  .zino-widget {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .zino-launcher {
    --zino-launcher-width: 82px;
  }

  .zino-launcher-btn {
    min-height: 24px;
    margin-top: -14px;
    padding: 4px 5px;
    font-size: 8px;
    border-radius: 6px;
  }

  .zino-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 3;
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
    height: min(88vh, 640px);
    border-radius: 24px 24px 0 0 !important;
  }

  .zino-widget .zino-panel.glass-card {
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
  }

  body.zino-panel-open .zino-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .zino-panel-header {
    padding-top: 16px;
  }

  .zino-lang-select {
    max-width: 88px;
    font-size: 10px;
  }

  .zino-msg-bubble {
    max-width: 92%;
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .zino-launcher {
    --zino-launcher-width: 72px;
  }

  .zino-launcher-btn {
    min-height: 22px;
    font-size: 7px;
  }

  .zino-panel {
    height: 92vh;
  }
}

/* Dark mode — readable header text */
html[data-theme="dark"] .zino-panel-brand strong,
body[data-background-color="dark"] .zino-panel-brand strong,
body[data-background-color="dark2"] .zino-panel-brand strong {
  color: #fff;
}

html[data-theme="dark"] .zino-panel-brand small,
body[data-background-color="dark"] .zino-panel-brand small,
body[data-background-color="dark2"] .zino-panel-brand small {
  color: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .zino-panel {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .zino-panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--primary-color, #22b0af) 22%, rgba(15, 23, 42, 0.95));
}

html[data-theme="dark"] .zino-msg-bot .zino-msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

html[data-theme="dark"] .zino-input-wrap {
  background: rgba(15, 23, 42, 0.55);
  border-top-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .zino-input-wrap input {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

html[data-theme="dark"] .zino-input-wrap input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

body[data-background-color="dark"] .zino-panel,
body[data-background-color="dark2"] .zino-panel {
  background: rgba(15, 23, 42, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-background-color="dark"] .zino-panel-header,
body[data-background-color="dark2"] .zino-panel-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--primary-color, #22b0af) 22%, rgba(15, 23, 42, 0.95));
}

body[data-background-color="dark"] .zino-msg-bot .zino-msg-bubble,
body[data-background-color="dark2"] .zino-msg-bot .zino-msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

body[data-background-color="dark"] .zino-input-wrap,
body[data-background-color="dark2"] .zino-input-wrap {
  background: rgba(15, 23, 42, 0.55);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body[data-background-color="dark"] .zino-input-wrap input,
body[data-background-color="dark2"] .zino-input-wrap input {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

body[data-background-color="dark"] .zino-input-wrap input::placeholder,
body[data-background-color="dark2"] .zino-input-wrap input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}
