/**
 * WP Clean YouTube Embeds - Frontend Stylesheet
 * Version: 2.1.0
 */

/* ==========================================================================
   1. CORREÇÃO DEFINITIVA DO ESPAÇO EM BRANCO (ASTRA, GUTENBERG, ELEMENTOR)
   ========================================================================== */
.ast-oembed-container,
.wp-block-embed__wrapper,
.elementor-widget-video .elementor-wrapper {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    position: relative !important;
}

.ast-oembed-container::before,
.wp-block-embed__wrapper::before,
.elementor-fit-aspect-ratio::before {
    content: none !important;
    display: none !important;
    padding: 0 !important;
    height: 0 !important;
}

.ast-oembed-container iframe,
.wp-block-embed__wrapper iframe {
    position: relative !important;
}

/* ==========================================================================
   2. CONTÊINER PRINCIPAL 16:9 PROPORCIONAL
   ========================================================================== */
.wp-cye-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    overflow: hidden !important;
    background-color: #000000 !important;
    border-radius: 8px !important;
    margin: 1.25rem auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   3. MOTOR DE RECORTE LETTERBOX (OVERSCAN / RECORTE DE FAIXAS PRETAS)
   ========================================================================== */
.wp-cye-engine-letterbox_crop .wp-cye-iframe-inner {
    position: absolute !important;
    top: calc(-1 * var(--wp-cye-crop-top, 16%)) !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% + var(--wp-cye-crop-top, 16%) + var(--wp-cye-crop-bottom, 16%)) !important;
    overflow: hidden !important;
}

.wp-cye-engine-top_crop .wp-cye-iframe-inner {
    position: absolute !important;
    top: calc(-1 * var(--wp-cye-crop-top, 16%)) !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100% + var(--wp-cye-crop-top, 16%)) !important;
    overflow: hidden !important;
}

.wp-cye-engine-overlay_mask .wp-cye-iframe-inner {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.wp-cye-iframe-inner iframe,
.wp-cye-iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* ==========================================================================
   4. MÁSCARAS COMPLEMENTARES (MODO MÁSCARA)
   ========================================================================== */
.wp-cye-mask-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--wp-cye-top-height, 70px);
    z-index: 10;
    pointer-events: auto;
    cursor: default;
    background: var(--wp-cye-top-bg, #000000);
}

.wp-cye-mask-bottom-left {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 180px;
    height: 52px;
    z-index: 15;
    background: #000000;
    pointer-events: auto;
    cursor: pointer;
}

.wp-cye-mask-bottom-right {
    position: absolute;
    bottom: 0;
    right: 0;
    width: var(--wp-cye-bottom-width, 340px);
    height: var(--wp-cye-bottom-height, 56px);
    z-index: 15;
    background: #000000;
    pointer-events: auto;
    cursor: pointer;
}

/* ==========================================================================
   5. CORTINA DE PAUSA LIMPA (ANTI-MINIATURAS E ANTI-REDIRECIONAMENTO)
   ========================================================================== */
.wp-cye-pause-curtain {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.wp-cye-container.wp-cye-is-paused .wp-cye-pause-curtain {
    display: flex;
    opacity: 1;
}

.wp-cye-pause-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    background: rgba(220, 38, 38, 0.95);
    padding: 16px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    transition: transform 0.2s ease, background 0.2s ease;
}

.wp-cye-pause-btn:hover {
    transform: scale(1.05);
    background: #ef4444;
}

/* ==========================================================================
   6. CONTROLES LIMPOS PERSONALIZADOS (100% LIVRE DE LINKS DO YOUTUBE)
   ========================================================================== */
.wp-cye-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.92) 100%);
    z-index: 25;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.wp-cye-container.wp-cye-is-playing:not(:hover) .wp-cye-controls {
    opacity: 0;
    pointer-events: none;
}

.wp-cye-btn-play,
.wp-cye-btn-vol,
.wp-cye-btn-fullscreen {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, color 0.15s ease;
}

.wp-cye-btn-play:hover,
.wp-cye-btn-vol:hover,
.wp-cye-btn-fullscreen:hover {
    color: #ef4444;
    transform: scale(1.1);
}

.wp-cye-scrubber-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: height 0.15s ease;
}

.wp-cye-scrubber-track:hover {
    height: 8px;
}

.wp-cye-scrubber-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #ef4444;
    border-radius: 4px;
}

.wp-cye-scrubber-handle {
    position: absolute;
    left: 0%;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}

.wp-cye-scrubber-track:hover .wp-cye-scrubber-handle {
    transform: translate(-50%, -50%) scale(1);
}

.wp-cye-time-display {
    color: #ffffff;
    font-size: 12px;
    font-family: monospace;
    white-space: nowrap;
}
