/*
 * ==========================================================
 * CRUSHI VIDEO / BUNNY STREAM
 * ==========================================================
 */


/*
 * ==========================================================
 * VIDEO PLAYER
 * ==========================================================
 */

.brokenpinea-bunny-video {
    position: relative;

    display: block;

    box-sizing: border-box;

    width: min(100%, 420px);

    max-width: 100%;

    margin: 8px 0 12px;

    overflow: hidden;

    border-radius: 14px;

    background: #000;

    box-shadow:
        0 4px 16px
        rgba(0, 0, 0, 0.18);

    transition:
        width 0.25s ease,
        aspect-ratio 0.25s ease;
}


/*
 * Portrait
 */

.brokenpinea-bunny-video.is-portrait {
    width: min(100%, 240px);
}


/*
 * Square
 */

.brokenpinea-bunny-video.is-square {
    width: min(100%, 340px);
}


/*
 * Landscape
 */

.brokenpinea-bunny-video.is-landscape {
    width: min(100%, 420px);
}


/*
 * Bunny iframe
 */

.brokenpinea-bunny-video iframe {
    position: absolute;

    inset: 0;

    display: block;

    width: 100%;
    height: 100%;

    margin: 0;

    padding: 0;

    border: 0;

    background: #000;

    opacity: 1;

    visibility: visible;

    transition:
        opacity 0.22s ease;
}


/*
 * ==========================================================
 * PROCESSING STATE
 * ==========================================================
 *
 * Bunny's unfinished player stays hidden while the Crushi
 * processing overlay is visible.
 */

.brokenpinea-bunny-video.is-processing iframe {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/*
 * ==========================================================
 * PROCESSING OVERLAY
 * ==========================================================
 *
 * IMPORTANT:
 * This is intentionally transparent enough for the Bunny
 * thumbnail underneath to remain visible.
 */

.brokenpinea-bunny-processing-overlay {
    position: absolute;

    z-index: 5;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 10px;

    box-sizing: border-box;

    padding: 18px;

    color: #fff;

    text-align: center;

    background:
        rgba(0, 0, 0, 0.48);

    pointer-events: auto;
}


.brokenpinea-bunny-processing-overlay strong {
    display: block;

    margin: 0;

    font-size: 18px;

    font-weight: 700;

    line-height: 1.25;

    color: #fff;

    text-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.9);
}


.brokenpinea-bunny-processing-status {
    display: block;

    margin: 0;

    font-size: 12px;

    line-height: 1.35;

    color:
        rgba(255, 255, 255, 0.88);

    text-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.9);
}


/*
 * Spinner
 */

.brokenpinea-bunny-processing-spinner {
    display: block;

    box-sizing: border-box;

    width: 32px;
    height: 32px;

    margin-bottom: 2px;

    border: 4px solid
        rgba(255, 255, 255, 0.25);

    border-top-color:
        rgba(255, 255, 255, 0.95);

    border-radius: 50%;

    animation:
        brokenpinea-video-spin
        0.85s
        linear
        infinite;
}


@keyframes brokenpinea-video-spin {

    from {
        transform:
            rotate(0deg);
    }

    to {
        transform:
            rotate(360deg);
    }
}


/*
 * Processing progress bar
 */

.brokenpinea-bunny-processing-progress {
    display: block;

    width: min(80%, 220px);
    height: 5px;

    overflow: hidden;

    margin-top: 4px;

    border-radius: 999px;

    background:
        rgba(255, 255, 255, 0.25);
}


.brokenpinea-bunny-processing-progress-bar {
    display: block;

    width: 5%;
    height: 100%;

    border-radius: inherit;

    background:
        rgba(255, 255, 255, 0.95);

    transition:
        width 0.3s linear;
}


/*
 * ==========================================================
 * QUOTED VIDEO
 * ==========================================================
 */

.brokenpinea-bunny-video-quote {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    margin: 4px 0;

    padding: 6px 10px;

    border-radius: 999px;

    font-weight: 700;

    text-decoration: none;
}


/*
 * ==========================================================
 * QUICK REPLY VIDEO UPLOAD
 * ==========================================================
 */

.brokenpinea-bunny-upload {
    display: flex;

    align-items: center;

    gap: 10px;

    box-sizing: border-box;

    width: 100%;

    margin: 6px 0;

    padding: 9px 11px;

    border: 1px solid
        rgba(127, 127, 127, 0.22);

    border-radius: 10px;

    background:
        rgba(127, 127, 127, 0.06);
}


.brokenpinea-bunny-upload.is-done {
    opacity: 0.9;
}


.brokenpinea-bunny-upload.is-error {
    border-color:
        rgba(190, 60, 60, 0.55);
}


.brokenpinea-bunny-upload-icon {
    flex: 0 0 auto;

    font-size: 22px;

    line-height: 1;
}


.brokenpinea-bunny-upload-info {
    display: flex;

    flex: 1 1 auto;

    flex-direction: column;

    gap: 4px;

    min-width: 0;
}


.brokenpinea-bunny-upload-name {
    display: block;

    overflow: hidden;

    font-size: 12px;

    font-weight: 700;

    line-height: 1.3;

    white-space: nowrap;

    text-overflow: ellipsis;
}


.brokenpinea-bunny-upload-state {
    display: block;

    font-size: 11px;

    line-height: 1.3;

    opacity: 0.75;
}


.brokenpinea-bunny-progress {
    display: block;

    width: 100%;
    height: 4px;

    overflow: hidden;

    border-radius: 999px;

    background:
        rgba(127, 127, 127, 0.20);
}


.brokenpinea-bunny-progress-bar {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background: currentColor;

    opacity: 0.55;

    transition:
        width 0.15s linear;
}


/*
 * ==========================================================
 * MOBILE
 * ==========================================================
 */

@media (max-width: 700px) {

    .brokenpinea-bunny-video {
        width: 100%;

        border-radius: 11px;
    }


    .brokenpinea-bunny-video.is-portrait {
        width: min(100%, 360px);
    }


    .brokenpinea-bunny-video.is-square {
        width: 100%;
    }


    .brokenpinea-bunny-video.is-landscape {
        width: 100%;
    }


    .brokenpinea-bunny-processing-overlay {
        gap: 8px;

        padding: 16px;
    }


    .brokenpinea-bunny-processing-overlay strong {
        font-size: 17px;
    }


    .brokenpinea-bunny-processing-status {
        font-size: 12px;
    }


    .brokenpinea-bunny-processing-spinner {
        width: 30px;
        height: 30px;

        border-width: 3px;
    }


    .brokenpinea-bunny-processing-progress {
        width: min(84%, 280px);
    }


    .brokenpinea-bunny-upload {
        padding: 8px 9px;
    }


    .brokenpinea-bunny-upload-icon {
        font-size: 20px;
    }
}