/* ============================================================
   Dropbox Videos — Frontend + Block Editor Styles
   ============================================================ */

/* --- Facade (thumbnail + play button) ---------------------- */
.dbv-video-block {
    margin: 1.5em auto;
    display: block;
    max-width: 100%;
    text-align: center;
}

.dbv-facade {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.dbv-facade:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}

.dbv-thumbnail {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.2s ease;
}

.dbv-thumbnail-placeholder {
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #1a1a1a;
}

.dbv-facade:hover .dbv-thumbnail,
.dbv-facade:focus .dbv-thumbnail {
    opacity: 0.85;
}

.dbv-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    pointer-events: none;
    transition: transform 0.15s ease;
}

.dbv-facade:hover .dbv-play-button,
.dbv-facade:focus .dbv-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.dbv-play-button svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.dbv-caption {
    margin: 0.5em 0 0;
    font-size: 0.875em;
    color: #555;
    text-align: center;
}

/* --- Inline video (replaces facade on click) --------------- */
.dbv-inline-video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    background: #000;
}

/* Reset any theme styles bleeding into the video element */
.dbv-video-block video,
.dbv-video-block video::-webkit-media-controls,
.dbv-video-block video::-webkit-progress-bar,
.dbv-video-block video::-moz-progress-bar {
    all: revert;
    display: block;
    width: 100%;
    height: auto;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.dbv-video-block {
    margin: 1.5em auto;
    display: block;
    max-width: 100%;
    text-align: center;
}

/* --- Block Editor Styles ------------------------------------ */
.dbv-block-editor-wrap {
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    padding: 16px;
    background: #f9f9f9;
}

.dbv-editor-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: #888;
    text-align: center;
}

.dbv-editor-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.dbv-editor-notice {
    color: #b56c00;
    font-style: italic;
}

.dbv-picker-label {
    font-weight: 600;
    margin-bottom: 8px;
}

.dbv-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.dbv-video-card {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    text-align: left;
    transition: border-color 0.15s;
}

.dbv-video-card:hover {
    border-color: #0073aa;
}

.dbv-video-card.is-selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.dbv-video-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

.dbv-card-no-thumb {
    width: 100%;
    height: 80px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.dbv-card-title {
    display: block;
    padding: 6px 8px;
    font-size: 0.8em;
    line-height: 1.3;
    color: #1e1e1e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dbv-editor-preview {
    margin-top: 16px;
    text-align: center;
}

.dbv-editor-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}
