﻿/* Flat upload button shell */
.button_outer {
    background: #00C39A;
    border-radius: 0;
    height: 50px;
    width: 200px;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform .12s ease;
}

/* Clickable label */
.btn_upload {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    width: 100%;
    cursor: pointer;
    position: relative;
    z-index: 3;
    user-select: none;
}

/* Hide native file input UI (fixes "No file chosen") */
#upload_file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Progress bar layer */
.processing_bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: #019a69;
    z-index: 1;
    transition: width 3s;
}

/* Success check */
.success_box {
    display: none;
    width: 50px;
    height: 50px;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 4;
}

    .success_box:before {
        content: '';
        display: block;
        width: 9px;
        height: 18px;
        border-bottom: 6px solid #fff;
        border-right: 6px solid #fff;
        transform: rotate(45deg);
        position: absolute;
        left: 17px;
        top: 10px;
    }

/* States */
.file_uploading .processing_bar {
    width: 100%;
}

.file_uploading .btn_upload {
    opacity: .65;
    pointer-events: none;
}

.file_uploaded {
    width: 50px;
}

    .file_uploaded .success_box {
        display: block;
    }

    .file_uploaded .btn_upload {
        display: none;
    }

/* Preview */
.uploaded_file_view {
    max-width: 500px;
    text-align: center;
    position: relative;
    transition: opacity .2s;
    opacity: 0;
    border: 2px solid #ddd;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    .uploaded_file_view.show {
        opacity: 1;
    }
    /* <-- you were missing this */
    .uploaded_file_view img {
        max-width: 100%;
        height: auto;
        display: block;
    }

.error_msg {
    text-align: center;
    color: #f00;
}
