<?php
// URL do vídeo (pode vir de banco de dados, $_GET, etc.)
$youtube_url = "https://www.youtube.com/watch?v=LXb3EKWsInQ";

// Extrair ID do vídeo
parse_str(parse_url($youtube_url, PHP_URL_QUERY), $url_params);
$video_id = $url_params['v'] ?? '';
?>

<div class="row p-0 m-0">
  <div class="banner-video" style="position: relative; overflow: hidden;">
    <?php if ($video_id): ?>
      <iframe
        width="100%" height="100%"
        src="https://www.youtube.com/embed/<?php echo htmlspecialchars($video_id); ?>?autoplay=1&mute=1&controls=0&modestbranding=1&rel=0&loop=1&playlist=<?php echo htmlspecialchars($video_id); ?>"
        frameborder="0"
        allow="autoplay; encrypted-media; clipboard-write; gyroscope; picture-in-picture"
        allowfullscreen
        style="position: absolute; top: -10px; left: 0; width: 100%; ">
      </iframe>
    <?php else: ?>
      <p>Vídeo inválido ou não encontrado.</p>
    <?php endif; ?>

    <div class="texto" style="position: relative; z-index: 9;">
      <h1>Somos Inovação<br> <strong>qualidade e experiência.</strong></h1>
    </div>
  </div>
</div>
