/**
 * YouTube Background Widget Styles
 * Izolované CSS bez globálních overrides
 */

/* ========== CONTAINER ========== */
.yt-bg-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
  /* Výška se nastavuje přes Elementor controls */
}

/* Fullwidth breakout - bezpečný způsob bez overflow: visible */
.yt-bg-fullwidth {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* ========== VIDEO WRAPPER ========== */
.yt-bg-video-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Rozměry se vypočítají v JS pro cover effect */
  width: 100%;
  height: 100%;
  pointer-events: none; /* Žádné klikání na video */
}

.yt-bg-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.yt-bg-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none; /* Blokuje YouTube UI interakce */
}

/* ========== LOADING STATE ========== */
.yt-bg-container.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: yt-bg-spin 0.8s linear infinite;
  z-index: 1;
}

@keyframes yt-bg-spin {
  to { transform: rotate(360deg); }
}

.yt-bg-container.loaded::before {
  display: none;
}

/* ========== RESPONSIVE ADAPTACE ========== */
/* Mobilní zařízení - žádné černé pruhy */
@media (max-width: 767px) {
  .yt-bg-container {
    /* Na mobilu se výška dynamicky přepočítává v JS podle zoom */
  }
  
  /* Zajistí, že video bude vždy cover, nikdy contain */
  .yt-bg-video-wrapper {
    min-width: 100%;
    min-height: 100%;
  }
}

/* ========== ELEMENTOR EDITOR ========== */
.elementor-editor-active .yt-bg-container {
  /* V editoru zobrazíme placeholder */
  min-height: 300px;
}

.elementor-editor-active .yt-bg-container::after {
  content: '▶ YouTube Background';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 2;
}