/* ============================================================
   Bunny Stream Video Upload — front-end field styles
   ============================================================ */

/* Upload area */
.bunny-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.bunny-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--gf-color-primary, #0073aa);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.bunny-upload-label:hover {
    background: var(--gf-color-primary-darker, #001AB3);
}

/* Add a small upload icon before the label text */
.bunny-file-select-button::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.bunny-file-input {
    display: none !important;
}

.bunny-upload-container {
	border: 1px solid var(--gf-local-border-color, #686e77);
	background: var(--gf-local-bg-color, #f7f7f7);
	padding: 12px;
	border-radius: 4px;
}

.bunny-file-name {
    font-size: 13px;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* Hint line (allowed types / max size) */
.gfield_description.gform_fileupload_rules {
    font-size: 12px;
    color: #777;
    margin: 2px 0 8px;
}

/* ============================================================
   Progress bar
   ============================================================ */

.bunny-progress-wrap {
    margin-top: 10px;
}

.bunny-progress-track {
    position: relative;
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}

.bunny-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0073aa 0%, #00a0d2 100%);
    border-radius: 999px;
    transition: width 0.25s ease;

    /* Animated stripe overlay while uploading */
    background-size: 30px 30px;
    animation: bunny-stripe 0.6s linear infinite;
    background-image: linear-gradient(
        90deg,
        #0073aa 0%,
        #00a0d2 50%,
        #0073aa 100%
    );
}

/* Pulse the fill colour slightly while uploading */
@keyframes bunny-stripe {
    0%   { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

/* Stop animation once complete (JS adds .complete class) */
.bunny-progress-fill.complete {
    animation: none;
    background: #46b450;
    background-image: none;
}

.bunny-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.bunny-progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #0073aa;
}

.bunny-progress-bytes {
    font-size: 11px;
    color: #888;
}

/* ============================================================
   Status messages
   ============================================================ */

.bunny-upload-status {
    margin-top: 6px;
    font-size: 13px;
    min-height: 1.4em;
}

.bunny-upload-status.ready {
    color: #555;
}

.bunny-upload-status.success {
    color: #46b450;
    font-weight: 500;
}

.bunny-upload-status.error {
    color: #dc3232;
    font-weight: 500;
}

/* ============================================================
   Existing video preview (entry edit view)
   ============================================================ */

.bunny-upload-preview {
    margin-bottom: 12px;
}

.bunny-upload-preview iframe {
    display: block;
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 4px;
}
