/* ===== VKurse Mascot ===== */

/* Fix: Ohio preloader blocks clicks even when hidden */
.page-preloader.hidden {
  pointer-events: none !important;
}

/* Hide on mobile */
@media (max-width: 991px) {
  .vkm-wrapper { display: none !important; }
}

/* Wrapper — fixed position, uses CSS custom properties from inline style */
.vkm-wrapper {
  position: fixed;
  z-index: 2147483646;
  top: var(--vkm-offset-y, 50%);
  transform: translateY(-50%);
  pointer-events: none;
}

.vkm-wrapper > * {
  pointer-events: auto;
}

/* Horizontal position */
.vkm-pos-left {
  left: var(--vkm-offset-x, -40px);
}

.vkm-pos-right {
  right: var(--vkm-offset-x, -40px);
}

/* ===== Mascot image ===== */
.vkm-mascot {
  cursor: pointer;
  position: relative;
  width: var(--vkm-size, 180px);
  flex-shrink: 0;
  animation: vkmEntrance 0.8s ease-out forwards;
}

.vkm-mascot img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(2px 4px 12px rgba(0,0,0,0.2));
  transition: transform 0.3s ease;
}

.vkm-mascot:hover img {
  transform: scale(1.05);
}

/* Entrance: slide in + wobble (left) */
@keyframes vkmEntrance {
  0%   { opacity: 0; transform: translateX(-80px) rotate(0deg); }
  40%  { opacity: 1; transform: translateX(10px) rotate(3deg); }
  60%  { transform: translateX(-5px) rotate(-2deg); }
  80%  { transform: translateX(3px) rotate(1deg); }
  100% { opacity: 1; transform: translateX(0) rotate(0deg); }
}

.vkm-pos-right .vkm-mascot {
  animation-name: vkmEntranceRight;
}

@keyframes vkmEntranceRight {
  0%   { opacity: 0; transform: translateX(80px) rotate(0deg); }
  40%  { opacity: 1; transform: translateX(-10px) rotate(-3deg); }
  60%  { transform: translateX(5px) rotate(2deg); }
  80%  { transform: translateX(-3px) rotate(-1deg); }
  100% { opacity: 1; transform: translateX(0) rotate(0deg); }
}

/* Idle wobble after entrance */
.vkm-mascot.vkm-idle {
  animation: vkmIdle 3s ease-in-out infinite;
}

@keyframes vkmIdle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(2deg); }
  75%      { transform: rotate(-2deg); }
}

/* ===== Close mascot button ===== */
.vkm-close-mascot {
  position: absolute;
  top: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
  padding: 0;
}

.vkm-pos-left .vkm-close-mascot {
  right: -8px;
}

.vkm-pos-right .vkm-close-mascot {
  left: -8px;
}

.vkm-close-mascot:hover {
  color: #ff3d3d;
  background: #fff5f5;
}

/* ===== Bubbles (shared) ===== */
.vkm-bubble {
  position: absolute;
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  max-width: 300px;
  min-width: 220px;
  animation: vkmBubbleIn 0.35s ease-out forwards;
  top: -10px;
}

/* Position bubble to the right of mascot (left layout) */
.vkm-pos-left .vkm-bubble {
  left: calc(var(--vkm-size, 180px) + 12px);
}

/* Position bubble to the left of mascot (right layout) */
.vkm-pos-right .vkm-bubble {
  right: calc(var(--vkm-size, 180px) + 12px);
}

@keyframes vkmBubbleIn {
  0%   { opacity: 0; transform: scale(0.85) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Bubble tail — left position (arrow points left toward mascot) */
.vkm-pos-left .vkm-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 24px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #ffffff;
}

/* Bubble tail — right position (arrow points right toward mascot) */
.vkm-pos-right .vkm-bubble::before {
  content: '';
  position: absolute;
  right: -8px;
  top: 24px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid #ffffff;
}

/* Bubble close */
.vkm-bubble__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: #aaa;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.vkm-bubble__close:hover {
  color: #ff3d3d;
}

/* Bubble text */
.vkm-bubble__text {
  font-family: 'GolosText', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a1a;
  margin: 0 0 12px 0;
  padding-right: 16px;
}

/* Question mark button */
.vkm-bubble__question {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #ffffff;
  font-family: 'GolosText', Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.vkm-bubble__question:hover {
  background: #ff3d3d;
}

/* ===== Telegram bubble ===== */
#vkm-wrapper .vkm-bubble .vkm-telegram-btn,
#vkm-wrapper .vkm-bubble .vkm-telegram-btn:link,
#vkm-wrapper .vkm-bubble .vkm-telegram-btn:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  background-image: none !important;
  color: #ffffff !important;
  font-family: 'GolosText', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  border-radius: 24px;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  transform: translateY(0);
}

#vkm-wrapper .vkm-bubble .vkm-telegram-btn:hover,
#vkm-wrapper .vkm-bubble .vkm-telegram-btn:focus {
  background: #1a1a1a !important;
  background-color: #1a1a1a !important;
  background-image: none !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  opacity: 1 !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 4px 18px rgba(26, 26, 26, 0.45) !important;
}

#vkm-wrapper .vkm-bubble .vkm-telegram-btn:active {
  background: #1a1a1a !important;
  color: #ffffff !important;
  text-decoration: none !important;
  border: none !important;
  opacity: 1 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 10px rgba(26, 26, 26, 0.35) !important;
}

/* ===== Fade out ===== */
.vkm-wrapper.vkm-hiding {
  animation: vkmFadeOut 0.3s ease-out forwards;
}

@keyframes vkmFadeOut {
  0%   { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}
