/* ============================================================
   tutorials-widget.css — Player Flutuante (Picture-in-Picture)
   Ajuda Contextual In-App — CryptoMinds Pro IA
   ============================================================ */

/* ── Botão Disparador no Cabeçalho das Ferramentas ───────── */
.btn-tutorial-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 19, 33, 0.85);
  border: 1px solid rgba(79, 185, 129, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #f0ece6;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  user-select: none;
  z-index: 10;
}

.btn-tutorial-trigger:hover {
  background: rgba(79, 185, 129, 0.15);
  border-color: #4FB981;
  color: #4FB981;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79, 185, 129, 0.25);
}

.btn-tutorial-trigger .pip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4FB981;
  box-shadow: 0 0 8px #4FB981;
  animation: pip-pulse 2s infinite;
}

@keyframes pip-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.btn-tutorial-trigger .pip-badge {
  background: rgba(238, 183, 20, 0.15);
  border: 1px solid rgba(238, 183, 20, 0.3);
  color: #EEB714;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
}

/* ── Container do Player Flutuante (PiP) ─────────────────── */
.pip-player-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  background: rgba(10, 19, 33, 0.95);
  border: 1px solid rgba(79, 185, 129, 0.4);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(79, 185, 129, 0.15);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease, width 0.3s ease;
  transform: translateY(120%) scale(0.9);
  opacity: 0;
  pointer-events: none;
}

.pip-player-widget.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Modo Minimizado */
.pip-player-widget.minimized {
  width: 280px;
}

.pip-player-widget.minimized .pip-body,
.pip-player-widget.minimized .pip-footer,
.pip-player-widget.minimized .pip-tabs {
  display: none !important;
}

/* ── Cabeçalho do PiP ────────────────────────────────────── */
.pip-header {
  padding: 10px 14px;
  background: rgba(1, 4, 9, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: grab;
}

.pip-header:active {
  cursor: grabbing;
}

.pip-title-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

.pip-title-icon {
  font-size: 14px;
  color: #4FB981;
}

.pip-title-text {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #f9fafb;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pip-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pip-btn-action {
  background: transparent;
  border: none;
  color: var(--text-muted, #9ca3af);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pip-btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pip-btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ── Abas de Tópicos (se houver mais de 1 vídeo na página) ── */
.pip-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
}

.pip-tab {
  flex: 1;
  padding: 6px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #9ca3af);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.pip-tab:hover {
  color: #fff;
}

.pip-tab.active {
  color: #4FB981;
  border-bottom-color: #4FB981;
  background: rgba(79, 185, 129, 0.08);
}

/* ── Corpo do Player ─────────────────────────────────────── */
.pip-body {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #010409;
}

.pip-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Rodapé do PiP ───────────────────────────────────────── */
.pip-footer {
  padding: 8px 12px;
  background: rgba(1, 4, 9, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pip-hint {
  font-size: 11px;
  color: var(--text-muted, #9ca3af);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pip-link-academy {
  font-size: 11px;
  font-weight: 600;
  color: #EEB714;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 0.2s;
}

.pip-link-academy:hover {
  color: #fce183;
}

@media (max-width: 600px) {
  .pip-player-widget {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
