/* =========================================================
   PiP Video Widget — Floating Picture-in-Picture Widget
   Matches propertystation.in design exactly
   ========================================================= */

.pip-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  z-index: 99998;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 12px 48px,
              rgba(255, 255, 255, 0.08) 0px 0px 0px 1px;
  background: rgb(10, 10, 10);
  transform: translateY(120%) scale(0.9);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
  font-family: 'Poppins', sans-serif;
}

.pip-widget.pip-visible {
  transform: translateY(0px) scale(1);
  opacity: 1;
}

/* ── Header ── */
.pip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px 8px 14px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  cursor: grab;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
}

.pip-header:active {
  cursor: grabbing;
}

.pip-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Badge (platform icon + label) ── */
.pip-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgb(255, 255, 255);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ── Close & Volume Buttons ── */
.pip-close,
.pip-volume {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: rgb(255, 255, 255);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  line-height: 1;
  font-family: Arial, sans-serif;
  padding: 0;
}

.pip-close:hover,
.pip-volume:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.pip-volume.muted {
  color: rgb(218, 165, 32);
}

/* ── Video Content Area ── */
.pip-content {
  width: 100%;
  aspect-ratio: 9 / 14;
  background: rgb(0, 0, 0);
  position: relative;
}

.pip-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  pointer-events: auto !important;
}

/* ── Navigation Bar ── */
.pip-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── Arrow Buttons ── */
.pip-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgb(255, 255, 255);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  padding: 0;
}

.pip-arrow:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

/* ── Dot Indicators ── */
.pip-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: width 0.3s, background 0.3s, border-radius 0.3s;
  flex-shrink: 0;
}

.pip-dot.active {
  background: rgb(218, 165, 32);
  width: 22px;
  border-radius: 10px;
}

/* ── Responsive: Mobile centered layout ── */
@media (max-width: 768px) {
  .pip-widget {
    /* Bottom-right corner */
    width: 58vw;
    max-width: 220px;
    right: 10px;
    bottom: 70px;
    left: auto;
    top: auto;
    transform: translateY(120%) scale(0.9);
    opacity: 0;
  }

  .pip-widget.pip-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .pip-header {
    padding: 6px 8px 6px 10px;
  }

  .pip-badge {
    font-size: 11px;
    gap: 4px;
  }

  .pip-close,
  .pip-volume {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }

  .pip-content {
    aspect-ratio: 9 / 16;
  }

  .pip-nav {
    padding: 7px 10px;
    gap: 8px;
  }

  .pip-arrow {
    width: 24px;
    height: 24px;
  }

  .pip-arrow svg {
    width: 13px;
    height: 13px;
  }

  .pip-dot {
    width: 6px;
    height: 6px;
  }

  .pip-dot.active {
    width: 18px;
  }
}

/* ── Extra small screens ── */
@media (max-width: 400px) {
  .pip-widget {
    width: 62vw;
    max-width: 200px;
  }
}
