/* ==========================================
   EDU21.AI — FLOATING VIDEO WIDGET
   ========================================== */

/* === BURBUJA === */
.vw-bubble {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: visible;
  cursor: pointer;
  z-index: 9990;
  transition: transform 0.25s ease;
}

.vw-bubble:hover { transform: scale(1.08); }

/* Anillo pulsante */
.vw-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid rgba(103, 61, 230, 0.8);
  animation: vw-pulse 2.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes vw-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(103, 61, 230, 0.5); }
  50%       { box-shadow: 0 0 0 10px rgba(103, 61, 230, 0);   }
}

/* Contenedor circular de imagen */
.vw-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 6px 28px rgba(0,0,0,0.45);
}

/* Thumbnail */
.vw-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay hover */
.vw-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.vw-bubble:hover .vw-hover-overlay { opacity: 1; }

.vw-hover-icon {
  font-size: 20px;
  line-height: 1;
  color: #fff;
}

.vw-hover-label {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  padding: 0 6px;
  font-family: system-ui, sans-serif;
}

/* === BACKDROP === */
.vw-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 9991;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.vw-backdrop.vw-open {
  opacity: 1;
  pointer-events: all;
}

/* === MODAL === */
.vw-modal {
  position: relative;
  width: 90%;
  max-width: 640px;
  background: #131020;
  border: 1px solid rgba(103, 61, 230, 0.35);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.7);
  transform: scale(0.9) translateY(24px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vw-backdrop.vw-open .vw-modal {
  transform: scale(1) translateY(0);
}

/* Ratio 16:9 (horizontal — default) */
.vw-player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

/* Ratio 9:16 (vertical — Shorts/Reels) */
.vw-modal--vertical {
  max-width: 360px;
}
.vw-modal--vertical .vw-player-wrap {
  padding-top: 177.78%;
}

.vw-player-wrap iframe,
.vw-player-wrap > div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Botón cerrar */
.vw-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  font-family: system-ui, sans-serif;
}

.vw-close:hover { background: rgba(239, 68, 68, 0.85); }

/* === MOBILE === */
@media (max-width: 480px) {
  .vw-bubble { bottom: 88px; right: 14px; width: 64px; height: 64px; }
  .vw-inner  { width: 64px; height: 64px; }
  .vw-hover-label { font-size: 8px; }
  .vw-hover-icon  { font-size: 16px; }

  /* Vertical (Shorts) en mobile: alto fijo al viewport, ancho proporcional */
  .vw-modal--vertical {
    max-width: none;
    width: auto;
    height: 88vh;
    max-height: 88vh;
    aspect-ratio: 9 / 16;
  }
  .vw-modal--vertical .vw-player-wrap {
    padding-top: 0;
    height: 100%;
  }
}
