/* JURiAL Anruf-Button — Ersatz fuer Elfsight "Click to Call"
   (Widget 828ac818-b655-4838-899d-2e5fdb053827).
   Alle Masse/Farben aus dem Original-Widget v1.11.1 vermessen.
   Anpassbar ueber die CSS-Variablen in .jurial-call. */

.jurial-call {
  --jc-button-bg: #e29a28;                     /* buttonBackgroundColor */
  --jc-button-bg-hover: #bd7e1a;               /* Original: 10% abgedunkelt */
  --jc-button-fg: #ffffff;                     /* buttonTextColor (Icon) */
  --jc-icon-size: 24px;                        /* buttonSize 60 / 2.5 */
  --jc-button-padding: 20px;                   /* buttonSize 60 / 3 */
  --jc-window-bg: rgb(252, 253, 253);          /* windowBackgroundColor */
  --jc-text: #323848;                          /* windowTextColor */
  --jc-text-90: rgba(50, 56, 72, 0.9);
  --jc-text-70: rgba(50, 56, 72, 0.7);
  --jc-phone: #e29a28;                         /* windowPhoneColor */
  --jc-phone-bg: rgba(226, 154, 40, 0.06);
  --jc-phone-bg-hover: rgba(226, 154, 40, 0.1);
  --jc-offset: 20px;                           /* Abstand zum Seitenrand */

  position: fixed;
  right: var(--jc-offset);
  bottom: var(--jc-offset);
  display: flex;
  z-index: -1;
  opacity: 0;
  transform: translateY(100%);
  transition: 0.3s ease all;
}

/* wird per JS gesetzt, sobald die Scroll-Schwelle erreicht ist */
.jurial-call.jurial-call-show {
  opacity: 1;
  transform: translateY(0);
  z-index: 999999999;
}

.jurial-call-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* ---------- Button ---------- */

.jurial-call-button {
  position: relative;
  z-index: 999999997;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--jc-button-padding);
  border-radius: 500px;
  background-color: var(--jc-button-bg);
  box-shadow: 0 0 0 0 rgba(52, 152, 219, 0), 0 5px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  text-decoration: none !important;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.jurial-call-button:hover {
  background-color: var(--jc-button-bg-hover);
}

/* Puls-Ringe (im Original ::before/::after mit Ripple-Animation) */
.jurial-call-button::before,
.jurial-call-button::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: -2px;
  bottom: -2px;
  border: 1px solid var(--jc-button-bg);
  border-radius: 500px;
  opacity: 0;
  z-index: 0;
}

.jurial-call-button.jurial-call-animate::before,
.jurial-call-button.jurial-call-animate::after {
  animation: jurial-call-ripple 1.5s linear infinite;
}

.jurial-call-button.jurial-call-animate::after {
  animation-delay: 0.5s;
}

.jurial-call-iconBox {
  position: relative;
  width: var(--jc-icon-size);
  height: var(--jc-icon-size);
}

.jurial-call-iconBox svg {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  width: 100%;
  height: 100%;
  fill: var(--jc-button-fg);
  transition: opacity 0.3s ease;
}

.jurial-call-icon-phone { opacity: 1; transform: translate3d(0, 0, 0); }
.jurial-call-icon-close { opacity: 0; }

.jurial-call-open .jurial-call-icon-phone { opacity: 0; }
.jurial-call-open .jurial-call-icon-close { opacity: 1; }

.jurial-call-button.jurial-call-animate .jurial-call-icon-phone {
  animation: jurial-call-wiggle 3000ms infinite;
}

/* ---------- Popup-Fenster ---------- */

.jurial-call-window {
  position: absolute;
  top: 0;
  right: 0;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  min-width: 260px;
  background-color: var(--jc-window-bg);
  box-shadow: 0 12px 24px 0 rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px 24px 32px;
  box-sizing: border-box;
  overflow: hidden;
  transition: 0.3s ease all;
}

.jurial-call-open .jurial-call-window {
  opacity: 1;
  visibility: visible;
  top: -12px;
  transform: translateY(calc(-100% - 4px));
  pointer-events: all;
}

.jurial-call-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.jurial-call-avatar {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 1;
  flex-grow: 0;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.jurial-call-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.jurial-call-name {
  font-size: 16px;                             /* windowNameFontSize */
  font-weight: 700;
  text-align: center;
  margin-top: 12px;
  color: var(--jc-text);
}

.jurial-call-caption {
  font-size: 11px;                             /* windowCaptionFontSize */
  text-align: center;
  text-transform: uppercase;
  margin-top: 4px;
  color: var(--jc-text-70);
}

.jurial-call-content {
  margin-top: 14px;
  font-size: 15px;                             /* windowTextFontSize */
  line-height: 1.357142;
  text-align: center;
  color: var(--jc-text-90);
}

.jurial-call-text {
  display: block;
  margin-bottom: 18px;
}

.jurial-call-phone {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  padding: 1.8px 18px;                         /* fontSize*0.1 / fontSize*1 */
  border-radius: 200px;
  background-color: var(--jc-phone-bg);
  color: var(--jc-phone);
  text-decoration: none;
  transition: 0.3s ease all;
}

.jurial-call-phone:hover {
  text-decoration: none !important;
  background-color: var(--jc-phone-bg-hover);
}

.jurial-call-phoneIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12.6px;                               /* phoneFontSize 18 * 0.7 */
  height: 12.6px;
  fill: currentColor;
}

.jurial-call-phoneText {
  font-size: 18px;                             /* windowPhoneFontSize */
  line-height: 1.4;
  font-weight: 700;
  margin-left: 7.2px;                          /* phoneFontSize * 0.4 */
  white-space: nowrap;
  text-decoration: none;
}

/* ---------- Animationen (1:1 aus dem Original) ---------- */

@keyframes jurial-call-ripple {
  0%   { transform: scale(0.6); opacity: 0; }
  50%  { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes jurial-call-wiggle {
  0%  { transform: rotateZ(0); }
  2%  { transform: rotateZ(6deg); }
  4%  { transform: rotateZ(-6deg); }
  6%  { transform: rotateZ(6deg); }
  8%  { transform: rotateZ(-6deg); }
  10% { transform: rotateZ(6deg); }
  12% { transform: rotateZ(-6deg); }
  14% { transform: rotateZ(6deg); }
  16% { transform: rotateZ(-6deg); }
  18% { transform: rotateZ(6deg); }
  20% { transform: rotateZ(-6deg); }
  22% { transform: rotateZ(6deg); }
  24% { transform: rotateZ(-6deg); }
  26% { transform: rotateZ(6deg); }
  28% { transform: rotateZ(-6deg); }
  30% { transform: rotateZ(6deg); }
  32% { transform: rotateZ(-6deg); }
  34% { transform: rotateZ(6deg); }
  36% { transform: rotateZ(-6deg); }
  38% { transform: rotateZ(6deg); }
  40% { transform: rotateZ(-6deg); }
  42% { transform: rotateZ(6deg); }
  44% { transform: rotateZ(-6deg); }
  46% { transform: rotateZ(6deg); }
  100% { transform: rotateZ(0); }
}

@media (prefers-reduced-motion: reduce) {
  .jurial-call-button.jurial-call-animate::before,
  .jurial-call-button.jurial-call-animate::after,
  .jurial-call-button.jurial-call-animate .jurial-call-icon-phone {
    animation: none;
  }
}
