/* ==========================================
   FLOATING CONTACT MODULE - Glassmorphism
   Branch: Yakub Kolasa (ул. Якуба Коласа 40)
   Phone: +375 (25) 919-98-18
   Telegram: https://telegram.me/RemTehMinsk
   Viber: viber://chat?number=%2B375259199818
   ========================================== */

:root {
  --rt-fc-bg: rgba(255, 255, 255, 0.12);
  --rt-fc-bg-open: rgba(255, 255, 255, 0.18);
  --rt-fc-border: rgba(255, 255, 255, 0.25);
  --rt-fc-blur: 16px;
  --rt-fc-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --rt-fc-radius: 20px;
  --rt-fc-radius-btn: 16px;
  --rt-fc-accent: #f5d90a;
  --rt-fc-ink: #101827;
  --rt-fc-zindex: 9500;
}

/* Toggle Button */
.rt-fc-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--rt-fc-zindex);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--rt-fc-bg);
  backdrop-filter: blur(var(--rt-fc-blur));
  -webkit-backdrop-filter: blur(var(--rt-fc-blur));
  border: 1px solid var(--rt-fc-border);
  border-radius: 999px;
  box-shadow: var(--rt-fc-shadow);
  color: var(--rt-fc-ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rt-fc-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}

.rt-fc-toggle:active {
  transform: translateY(0) scale(0.97);
}

.rt-fc-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.rt-fc-toggle-text {
  white-space: nowrap;
}

.rt-fc-toggle-icon {
  transition: transform 0.3s ease;
}

.rt-fc-toggle.active .rt-fc-toggle-icon {
  transform: rotate(180deg);
}

/* Panel */
.rt-fc-panel {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: calc(var(--rt-fc-zindex) - 1);
  width: 280px;
  max-width: calc(100vw - 48px);
  background: var(--rt-fc-bg-open);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--rt-fc-border);
  border-radius: var(--rt-fc-radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.rt-fc-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Panel Header */
.rt-fc-panel-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.rt-fc-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--rt-fc-ink);
  line-height: 1.3;
}

.rt-fc-panel-subtitle {
  margin: 3px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: rgba(16, 24, 39, 0.6);
  line-height: 1.3;
}

/* Action Buttons */
.rt-fc-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}

.rt-fc-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--rt-fc-radius-btn);
  text-decoration: none;
  color: var(--rt-fc-ink);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rt-fc-action:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(245, 217, 10, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateX(4px);
}

.rt-fc-action:active {
  transform: translateX(2px) scale(0.98);
}

.rt-fc-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rt-fc-action-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.rt-fc-action-icon--phone {
  background: linear-gradient(135deg, #10b981, #34d399);
}

.rt-fc-action-icon--telegram {
  background: linear-gradient(135deg, #2AABEE, #229ED9);
}

.rt-fc-action-icon--viber {
  background: linear-gradient(135deg, #7360F2, #592678);
}

.rt-fc-action-label {
  display: flex;
  flex-direction: column;
}

.rt-fc-action-label-main {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.rt-fc-action-label-sub {
  font-size: 11px;
  font-weight: 500;
  color: rgba(16, 24, 39, 0.55);
  line-height: 1.3;
}

/* Mobile Responsive */
@media (max-width: 575px) {
  .rt-fc-toggle {
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .rt-fc-toggle svg {
    width: 18px;
    height: 18px;
  }

  .rt-fc-panel {
    bottom: 72px;
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
    border-radius: 18px;
    padding: 6px;
  }

  .rt-fc-panel-header {
    padding: 12px 12px 8px;
  }

  .rt-fc-panel-title {
    font-size: 13px;
  }

  .rt-fc-panel-subtitle {
    font-size: 10px;
  }

  .rt-fc-actions {
    padding: 6px;
    gap: 5px;
  }

  .rt-fc-action {
    padding: 10px 12px;
    gap: 10px;
  }

  .rt-fc-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .rt-fc-action-icon svg {
    width: 18px;
    height: 18px;
  }

  .rt-fc-action-label-main {
    font-size: 13px;
  }

  .rt-fc-action-label-sub {
    font-size: 10px;
  }
}

/* Safe area for notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .rt-fc-toggle {
    bottom: calc(24px + env(safe-area-inset-bottom));
  }
  .rt-fc-panel {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 575px) {
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .rt-fc-toggle {
      bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .rt-fc-panel {
      bottom: calc(72px + env(safe-area-inset-bottom));
    }
  }
}

/* Ensure no conflict with callback button */
.callback-btn {
  z-index: 9400 !important;
}

/* Ensure no conflict with RSTBox popup */
.eb-inst {
  z-index: 10000 !important;
}

/* Override toggle text color to orange */
.rt-fc-toggle,
.rt-fc-toggle-text {
  color: #f97316 !important;
}
.rt-fc-toggle:hover,
.rt-fc-toggle:hover .rt-fc-toggle-text {
  color: #ea580c !important;
}


/* Salad green toggle icon + text */
.rt-fc-toggle svg {
  color: #22c55e !important;
}
.rt-fc-toggle-text {
  color: #22c55e !important;
  font-weight: 800 !important;
}

/* Viber: same tile size as Phone and Telegram, with a white glyph */
.rt-fc-action-icon--viber {
  width: 36px !important;
  height: 36px !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #7360F2, #592678) !important;
  overflow: hidden;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.rt-fc-action-icon--viber .fa-viber {
  color: #fff !important;
  font-size: 20px;
  line-height: 1;
}
@media (max-width: 575px) {
  .rt-fc-action-icon--viber {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
  }
  .rt-fc-action-icon--viber .fa-viber {
    font-size: 18px;
  }
}

/* Readability fix: keep action labels dark on light cards */
.rt-fc-action,
.rt-fc-action:visited,
.rt-fc-action:hover,
.rt-fc-action:focus,
.rt-fc-action:active {
  color: #101827 !important;
}

.rt-fc-action-label-main,
.rt-fc-action-label-sub {
  color: #101827 !important;
}
