/* ===== PPTelegraf Font Family ===== */

@font-face {
  font-family: "PPTelegraf";
  src: url("./font-family/PPTelegraf-Regular.otf") format("opentype"),
       url("./font-family/PPTelegraf-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PPTelegraf";
  src: url("./font-family/PPTelegraf-Medium.otf") format("opentype"),
       url("./font-family/PPTelegraf-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PPTelegraf";
  src: url("./font-family/PPTelegraf-Semibold.otf") format("opentype"),
       url("./font-family/PPTelegraf-Semibold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
 
/* ===== Embeddable Chat Widget Styles ===== */

/* ---------- Container (anchors everything to bottom-right) ---------- */
#chatkit-widget-container {
  position: fixed;
  bottom: -3px;
  right: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  /* Prevent the container from blocking clicks on page elements behind it.
     The hidden panel uses visibility:hidden which preserves layout space,
     making the container appear as an invisible 400px-wide click blocker.
     pointer-events:none here lets clicks fall through to elements below;
     interactive children (toggle, open panel) override this explicitly. */
  pointer-events: none;
}

/* ---------- Floating toggle button ---------- */
#chatkit-widget-toggle {
  pointer-events: auto;
  padding: 14px 20px;
  border-radius: 10px 10px 0 0;
  border: solid 2px #AC7C1F;
  background: #FEF6E7;
  color: #000000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.2s;
  order: 2;
  font-size: 15px;
  font-weight: 600;
  font-family: "PPTelegraf", sans-serif;
  white-space: nowrap;
  margin-right: 20px;
}

#chatkit-widget-toggle:hover {
  background: #F7A70D;
  transform: translateY(-2px);
}

#chatkit-widget-toggle:focus-visible {
  outline: 3px solid #f7a600;
  outline-offset: 2px;
}

#chatkit-widget-toggle .sparkles-icon {
  font-size: 18px;
  color: #000000;
  line-height: 1;
}

/* ---------- Chat panel ---------- */
#chatkit-widget-panel {
  pointer-events: auto;
  width: 400px;
  height: 500px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 12px;
  margin-right: 20px;
  order: 1;

  /* animation */
  opacity: 1;
  transform: translateY(0) scale(1);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#chatkit-widget-panel.chatkit-widget-hidden {
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  visibility: hidden;
}

/* ---------- Panel header ---------- */
#chatkit-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #F7A70D;
  color: #000000;
  font-weight: 600;
  font-size: 15px;
  font-family: "PPTelegraf", sans-serif;
  flex-shrink: 0;
}

#chatkit-widget-close {
  background: none;
  border: none;
  color: #000000;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

#chatkit-widget-close:hover {
  opacity: 0.8;
}

/* ---------- Panel body (ChatKit lives here) ---------- */
#chatkit-widget-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#chatkit-embed {
  width: 100%;
  height: 100%;
  flex: 1;
}

/* ---------- Responsive: smaller screens ---------- */
@media (max-width: 480px) {
  #chatkit-widget-panel {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    border-radius: 12px;
    margin-right: 16px;
    bottom: -3px;
  }

  #chatkit-widget-container {
    bottom: -1px;
  }

  #chatkit-widget-toggle {
    margin-right: 16px;
  }
}
