form[data-op3-element-options-type="video"] {
    .op3-element-options-property[data-op3-element-options-property-name="boxShadowInset"],
    .op3-element-options-property[data-op3-element-options-property-id="videoMagicOverlayBackgroundImage"],
    .op3-element-options-property[data-op3-element-options-property-id="backgroundImage"] {
        display: none;
    }

    // Hide alignment in advanced tab
    .op3-boxmodel-align-container {
        display: none;
    }

    &[data-op3-parent-options-property-value-video-magicoverlay="1"] {
        [data-op3-toolbar-nav-id="image"] {
            display: none;
        }

        [data-op3-element-options-property-id="videoBackground"],
        [data-op3-element-options-property-id="videoMute"],
        [data-op3-element-options-property-id="videoAutoplay"],
        [data-op3-element-options-property-id="videoLoop"] {
            display: none;
        }
    }

    /* Display image overlay options
       base on visible property switch */
    [data-op3-element-options-property-id="visible"] {
        &[data-op3-element-options-property-value="0"] {
            ~ [data-op3-element-options-property-name="backgroundImageUrl"],
            ~ [data-op3-element-options-property-id="videoIconVisible"],
            ~ [data-op3-element-options-property-id="op3Icon"],
            ~ [data-op3-element-options-property-id="fontSize"],
            ~ [data-op3-element-options-property-id="color"],
            ~ [data-op3-element-options-property-id="textShadowIcon"] {
                display: none;
            }
        }
    }

    /* Display magic overlay options
       base on magic overlay property switch */
    [data-op3-element-options-property-id="videoMagicOverlay"] {
        &[data-op3-element-options-property-value="0"] {
            ~ [data-op3-element-options-property-id="videoMagicOverlayBackgroundImageUrl"] {
                display: none;
            }
        }
    }

    // Hide filter widget unless visible=1 and videoIconVisible=1
    // (see below). We need this strong selector to override it's
    // default state.
    .op3-element-options-property[data-op3-element-options-property-name][data-op3-element-options-property-value]:not([data-op3-element-options-property-value=""]) ~ .op3-element-options-property-filter {
        display: none;
    }

    // Sticky Video
    [data-op3-element-options-property-name="videoSticky"] {
        &[data-op3-element-options-property-value="0"] ~ [data-op3-element-options-property-name] {
            display: none;
        }

        &[data-op3-element-options-property-value="1"] {
            ~ [data-op3-element-options-property-name] {
                display: flex;
            }

            ~ [data-op3-element-options-property-name="videoStickyDevices"] {
                ~ [data-op3-element-options-property-name] {
                    display: none;
                }
            }

            ~ [data-op3-element-options-property-name="videoStickyDevices"][data-op3-element-options-property-value="1"] {
                ~ [data-op3-element-options-property-name] {
                    display: flex;
                }
            }

            ~ [data-op3-element-options-property-name="top"],
            ~ [data-op3-element-options-property-name="left"],
            ~ [data-op3-element-options-property-name="bottom"],
            ~ [data-op3-element-options-property-name="right"] {
                display: none;
            }

            ~ [data-op3-element-options-property-name="videoStickyPosition"][data-op3-element-options-property-value="bottomright"] {
                ~ [data-op3-element-options-property-name="bottom"],
                ~ [data-op3-element-options-property-name="right"] {
                    display: flex;
                }
            }

            ~ [data-op3-element-options-property-name="videoStickyPosition"][data-op3-element-options-property-value="bottomleft"] {
                ~ [data-op3-element-options-property-name="left"],
                ~ [data-op3-element-options-property-name="bottom"] {
                    display: flex;
                }
            }

            ~ [data-op3-element-options-property-name="videoStickyPosition"][data-op3-element-options-property-value="topright"] {
                ~ [data-op3-element-options-property-name="top"],
                ~ [data-op3-element-options-property-name="right"] {
                    display: flex;
                }
            }

            ~ [data-op3-element-options-property-name="videoStickyPosition"][data-op3-element-options-property-value="topleft"] {
                ~ [data-op3-element-options-property-name="top"],
                ~ [data-op3-element-options-property-name="left"] {
                    display: flex;
                }
            }
        }
    }

    // Sticky preview
    [data-op3-element-options-property-id="videoStickyPreview"] {
        &[data-op3-element-options-property-value="0"] ~ [data-op3-element-options-property-name] {
            display: none !important;
        }

        &[data-op3-element-options-property-value="1"] ~ .op3-element-options-custom-html {
            display: none;
        }
    }

    // Video Play Icon
    [data-op3-element-options-property-name="visible"][data-op3-element-options-property-value="0"] ~ [data-op3-element-options-property-id="videoIconVisible"] {
        ~ .jquery-filter-button-active[data-op3-element-options-property-name] {
            display: none;
        }
    }

    [data-op3-element-options-property-name="visible"][data-op3-element-options-property-value="1"] ~ [data-op3-element-options-property-id="videoIconVisible"] {
        &[data-op3-element-options-property-value="0"] {
            ~ .jquery-filter-button-active[data-op3-element-options-property-name] {
                display: none;
            }
        }

        &[data-op3-element-options-property-value="1"] ~ .op3-element-options-property-filter {
            display: block;
        }
    }
}

// Hide all options so we can show only what's needed
[data-op3-element-options-property-id="videoSource"] {
    ~ [data-op3-element-options-property-id="code"],
    ~ [data-op3-element-options-property-id="videoUrlYoutube"],
    ~ [data-op3-element-options-property-id="videoUrlVimeo"],
    ~ [data-op3-element-options-property-id="videoUrlWistia"],
    ~ [data-op3-element-options-property-id="videoUrlSelfhosted"],
    ~ [data-op3-element-options-property-id="videoUrlUploaded"] {
        display: none;
    }

    &[data-op3-element-options-property-value="embed"] {
        ~ [data-op3-element-options-property-id="code"] {
            display: flex;
        }
    }

    &[data-op3-element-options-property-value="youtube"] {
        ~ [data-op3-element-options-property-id="videoUrlYoutube"] {
            display: flex;
        }
    }

    &[data-op3-element-options-property-value="vimeo"] {
        ~ [data-op3-element-options-property-id="videoUrlVimeo"] {
            display: flex;
        }
    }

    &[data-op3-element-options-property-value="wistia"] {
        ~ [data-op3-element-options-property-id="videoUrlWistia"] {
            display: flex;
        }
    }

    &[data-op3-element-options-property-value="selfhosted"] {
        ~ [data-op3-element-options-property-id="videoUrlSelfhosted"] {
            display: flex;
        }
    }

    &[data-op3-element-options-property-value="uploaded"] {
        ~ [data-op3-element-options-property-id="videoUrlUploaded"] {
            display: flex;
        }
    }
}

// Hide advanced options for custom embed code
[data-op3-parent-options-property-value-video-source="embed"] {
    [data-op3-content-item-name="video-video-advanced"] {
        display: none;
    }
}

// Hide all intergration options
.op3-element-options-property[data-op3-element-options-property-id="videoStartTime"],
.op3-element-options-property[data-op3-element-options-property-id="videoAutoplay"],
.op3-element-options-property[data-op3-element-options-property-id="videoMute"],
.op3-element-options-property[data-op3-element-options-property-id="videoLoop"],
.op3-element-options-property[data-op3-element-options-property-id="videoDownloadControls"],
.op3-element-options-property[data-op3-element-options-property-id="videoControls"],
.op3-element-options-property[data-op3-element-options-property-id="videoControls"] ~ .op3-element-options-custom-html .op3-options-group-notes,
.op3-element-options-property[data-op3-element-options-property-id="videoModestBranding"],
.op3-element-options-property[data-op3-element-options-property-id="videoRelated"],
.op3-element-options-property[data-op3-element-options-property-id="videoColor"],
.op3-element-options-property[data-op3-element-options-property-id="videoByline"],
.op3-element-options-property[data-op3-element-options-property-id="videoPortrait"],
.op3-element-options-property[data-op3-element-options-property-id="videoTitle"],
.op3-element-options-property[data-op3-element-options-property-id="videoSpeed"],
.op3-element-options-property[data-op3-element-options-property-id="videoBackground"] {
    display: none;
}

// Show options available on YouTube integration
[data-op3-parent-options-property-value-video-source="youtube"] {
    .op3-element-options-property[data-op3-element-options-property-id="videoStartTime"],
    .op3-element-options-property[data-op3-element-options-property-id="videoAutoplay"],
    .op3-element-options-property[data-op3-element-options-property-id="videoMute"],
    .op3-element-options-property[data-op3-element-options-property-id="videoLoop"],
    .op3-element-options-property[data-op3-element-options-property-id="videoControls"],
    .op3-element-options-property[data-op3-element-options-property-id="videoControls"] ~ .op3-element-options-custom-html .op3-options-group-notes,
    .op3-element-options-property[data-op3-element-options-property-id="videoModestBranding"],
    .op3-element-options-property[data-op3-element-options-property-id="videoRelated"] {
        display: flex;
    }
}

// Show options available on Vimeo integration
[data-op3-parent-options-property-value-video-source="vimeo"] {
    .op3-element-options-property[data-op3-element-options-property-id="videoAutoplay"],
    .op3-element-options-property[data-op3-element-options-property-id="videoMute"],
    .op3-element-options-property[data-op3-element-options-property-id="videoByline"],
    .op3-element-options-property[data-op3-element-options-property-id="videoPortrait"],
    .op3-element-options-property[data-op3-element-options-property-id="videoTitle"],
    .op3-element-options-property[data-op3-element-options-property-id="videoSpeed"],
    .op3-element-options-property[data-op3-element-options-property-id="videoBackground"],
    .op3-element-options-property[data-op3-element-options-property-id="videoColor"],
    .op3-element-options-property[data-op3-element-options-property-id="videoLoop"] {
        display: flex;
    }
}

// Show options available on Wistia integration
[data-op3-parent-options-property-value-video-source="wistia"] {
    .op3-element-options-property[data-op3-element-options-property-id="videoAutoplay"],
    .op3-element-options-property[data-op3-element-options-property-id="videoLoop"],
    .op3-element-options-property[data-op3-element-options-property-id="videoMute"],
    .op3-element-options-property[data-op3-element-options-property-id="videoSpeed"],
    .op3-element-options-property[data-op3-element-options-property-id="videoControls"],
    .op3-element-options-property[data-op3-element-options-property-id="videoControls"] ~ .op3-element-options-custom-html .op3-options-group-notes,
    .op3-element-options-property[data-op3-element-options-property-id="videoColor"] {
        display: flex;
    }
}

// Show options available on selfhosted & uploaded integrations
[data-op3-parent-options-property-value-video-source="selfhosted"],
[data-op3-parent-options-property-value-video-source="uploaded"] {
    .op3-element-options-property[data-op3-element-options-property-id="videoAutoplay"],
    .op3-element-options-property[data-op3-element-options-property-id="videoMute"],
    .op3-element-options-property[data-op3-element-options-property-id="videoLoop"],
    .op3-element-options-property[data-op3-element-options-property-id="videoDownloadControls"],
    .op3-element-options-property[data-op3-element-options-property-id="videoControls"],
    .op3-element-options-property[data-op3-element-options-property-id="videoControls"] ~ .op3-element-options-custom-html .op3-options-group-notes {
        display: flex;
    }
}

[data-op3-element-options-property-id="videoControls"] {
    &[data-op3-element-options-property-value="1"] {
        ~ .op3-element-options-custom-html {
            display: none !important;
        }
    }
}
