/*
 * VehicleWatch Melbourne
 * Modern media-selection UI
 */

.media-dropzone {
    position: relative;

    min-height: 158px !important;

    padding: 24px 20px !important;

    border: 2px dashed #94a3b8 !important;
    border-radius: 12px !important;

    background: #f8fafc !important;

    text-align: center;

    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.media-dropzone:hover,
.media-dropzone.dz-drag-hover {
    border-color: #2563eb !important;
    background: #eff6ff !important;

    box-shadow:
        inset 0 0 0 1px
        rgba(37, 99, 235, 0.08);
}

.media-dropzone .dz-message {
    margin: 12px 0 !important;

    color: #475569;
}

.media-dropzone .dz-message-icon {
    display: flex;

    width: 44px;
    height: 44px;

    margin: 0 auto 10px;

    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background: #e2e8f0;

    color: #334155;

    font-size: 23px;
}

.media-dropzone .dz-message-title {
    margin-bottom: 4px;

    color: #111827;

    font-size: 18px;
    font-weight: 900;
}

.media-dropzone .dz-message-subtitle {
    color: #475569;

    font-size: 14px;
    line-height: 1.4;
}

.media-dropzone .dz-message-limits {
    margin-top: 8px;

    color: #64748b;

    font-size: 12px;
    font-weight: 800;
}


/*
 * Selected-file cards.
 */

.media-dropzone.dz-started {
    padding: 18px !important;
}

.media-dropzone.dz-started .dz-message {
    display: block !important;

    margin: 0 0 14px !important;
    padding: 10px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: white;
}

.media-dropzone .dz-preview {
    position: relative !important;

    display: inline-flex !important;

    vertical-align: top;

    width: 170px;
    min-height: 218px !important;

    margin: 8px !important;

    flex-direction: column;

    overflow: hidden;

    border: 1px solid #dbe2ea;
    border-radius: 10px;

    background: white !important;

    box-shadow:
        0 2px 7px
        rgba(15, 23, 42, 0.08);
}

.media-dropzone .dz-preview .dz-image {
    width: 100% !important;
    height: 125px !important;

    border-radius: 0 !important;

    overflow: hidden;

    background: #e5e7eb !important;
}

.media-dropzone .dz-preview .dz-image img {
    display: block;

    width: 100% !important;
    height: 100% !important;

    object-fit: contain;

    filter: none !important;

    image-rendering: auto;
}

.media-dropzone .dz-preview:hover .dz-image img {
    filter: none !important;
}

.media-dropzone .dz-preview .dz-details {
    position: static !important;

    min-width: 0 !important;
    max-width: none !important;

    padding: 10px 11px 5px !important;

    opacity: 1 !important;

    color: #111827 !important;

    text-align: left !important;

    font-size: 12px !important;
    line-height: 1.35 !important;
}

.media-dropzone .dz-preview .dz-details .dz-filename {
    display: block;

    overflow: hidden;

    margin-bottom: 4px;

    white-space: nowrap;
    text-overflow: ellipsis;

    font-weight: 800;
}

.media-dropzone .dz-preview .dz-details .dz-filename span,
.media-dropzone .dz-preview .dz-details .dz-size span {
    padding: 0 !important;

    border: 0 !important;

    background: transparent !important;
}

.media-dropzone .dz-preview .dz-details .dz-size {
    margin: 0 !important;

    color: #64748b;

    font-size: 11px !important;
}


/*
 * Progress bar.
 */

.media-dropzone .dz-preview .dz-progress {
    position: static !important;

    width: auto !important;
    height: 5px !important;

    margin: 7px 11px 4px !important;

    border: 0 !important;
    border-radius: 999px !important;

    background: #e2e8f0 !important;

    overflow: hidden;
}

.media-dropzone .dz-preview .dz-progress .dz-upload {
    background: #2563eb !important;

    border-radius: 999px !important;
}


/*
 * Remove action.
 */

.media-dropzone .dz-preview .dz-remove {
    margin: auto 10px 9px;

    padding: 6px 8px;

    border-radius: 6px;

    background: #fef2f2;

    color: #b91c1c;

    text-decoration: none !important;

    font-size: 11px;
    font-weight: 800;
}

.media-dropzone .dz-preview .dz-remove:hover {
    background: #fee2e2;
}


/*
 * Hide Dropzone's oversized success/error marks.
 */

.media-dropzone .dz-success-mark,
.media-dropzone .dz-error-mark {
    display: none !important;
}

.media-dropzone .dz-preview.dz-error {
    border-color: #fca5a5;
}

.media-dropzone .dz-preview .dz-error-message {
    position: static !important;

    width: auto !important;

    margin: 4px 10px 8px;
    padding: 7px 8px !important;

    border-radius: 6px !important;

    opacity: 1 !important;

    background: #fef2f2 !important;

    color: #991b1b !important;

    font-size: 11px !important;
}

.media-dropzone .dz-preview .dz-error-message:after {
    display: none !important;
}


/*
 * Video cards use a dark thumbnail area.
 */

.video-dropzone .dz-preview .dz-image {
    background: #111827 !important;
}


/*
 * Mobile.
 */

@media (max-width: 600px) {

    .media-dropzone {
        min-height: 140px !important;

        padding: 18px 12px !important;
    }

    .media-dropzone .dz-message-title {
        font-size: 17px;
    }

    .media-dropzone .dz-preview {
        width: calc(50% - 12px);

        min-height: 200px !important;

        margin: 6px !important;
    }

    .media-dropzone .dz-preview .dz-image {
        height: 112px !important;
    }
}

@media (max-width: 390px) {

    .media-dropzone .dz-preview {
        width: 100%;

        margin: 7px 0 !important;
    }

    .media-dropzone .dz-preview .dz-image {
        height: 180px !important;
    }
}

/*
 * High quality photograph preview.
 *
 * Show the complete photograph rather than cropping it to
 * fill the preview card.
 */
.media-dropzone .dz-preview .dz-image {
    display: flex !important;

    align-items: center;
    justify-content: center;

    background: #f8fafc !important;
}

.video-dropzone .dz-preview .dz-image {
    background: #111827 !important;
}


/*
 * Video preview cards.
 *
 * Only one video is allowed, so give it enough room to provide
 * a genuinely useful frame preview.
 */

.video-dropzone .dz-preview {
    width: 320px !important;
    min-height: 270px !important;
}

.video-dropzone .dz-preview .dz-image {
    position: relative;

    width: 100% !important;
    height: 180px !important;

    display: flex !important;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    background: #111827 !important;
}

.video-dropzone .dz-preview .dz-image img {
    display: block;

    width: 100% !important;
    height: 100% !important;

    object-fit: contain;

    background: #111827;
}


/*
 * Used when the browser cannot decode the selected video
 * sufficiently to extract a local frame.
 */

.vw-video-fallback {
    width: 100%;
    height: 100%;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #111827,
            #1f2937
        );

    color: white;
}

.vw-video-fallback-inner {
    text-align: center;

    padding: 20px;
}

.vw-video-fallback-icon {
    margin-bottom: 8px;

    font-size: 38px;
    line-height: 1;
}

.vw-video-fallback-title {
    font-size: 15px;
    font-weight: 900;
}

.vw-video-fallback-subtitle {
    margin-top: 4px;

    color: #cbd5e1;

    font-size: 11px;
    line-height: 1.35;
}


@media (max-width: 600px) {

    .video-dropzone .dz-preview {
        width: 100% !important;

        margin:
            7px 0 !important;
    }

    .video-dropzone .dz-preview .dz-image {
        height: auto !important;

        aspect-ratio: 16 / 9;
    }
}


/*
 * Media section layout.
 */

.media-upload-section {
    margin-top: 8px;
}


/*
 * Compact media privacy notice.
 */

.media-privacy-note {
    display: flex;

    gap: 10px;

    align-items: flex-start;

    margin-top: 10px;

    padding: 11px 13px;

    border: 1px solid #e2e8f0;
    border-radius: 8px;

    background: #f8fafc;

    color: #475569;

    font-size: 12px;
    line-height: 1.5;
}

.media-privacy-icon {
    flex: 0 0 auto;

    margin-top: 1px;

    font-size: 15px;
}

.media-privacy-note strong {
    color: #334155;
}


/*
 * ==========================================================
 * VehicleWatch responsive selected-media containment
 * ==========================================================
 *
 * Keep Dropzone previews inside the available form width.
 * Video uses a full-width card because native mobile video
 * controls need substantially more room than photo thumbnails.
 */

.media-dropzone {
    width: 100%;
    max-width: 100%;
    min-width: 0;

    overflow: hidden;
}

.media-dropzone .dz-preview {
    max-width: 100% !important;
    min-width: 0 !important;

    box-sizing: border-box;
}

.media-dropzone .dz-preview .dz-details,
.media-dropzone .dz-preview .dz-filename,
.media-dropzone .dz-preview .dz-filename span,
.media-dropzone .dz-preview .dz-size {
    min-width: 0 !important;
    max-width: 100% !important;
}

.media-dropzone .dz-preview .dz-filename span {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/*
 * Video previews should be larger than photograph cards.
 */
.video-dropzone .dz-preview {
    width: 100% !important;
    max-width: 520px !important;
    min-height: 0 !important;

    margin:
        8px
        0 !important;
}


/*
 * Local HTML5 video preview.
 *
 * This covers video elements whether they are inserted
 * directly into the Dropzone card or inside .dz-image.
 */
.video-dropzone .dz-preview video,
.video-dropzone .dz-preview .dz-image video {
    display: block;

    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;
    max-height: 420px;

    margin: 0;

    object-fit: contain;

    background: #111827;
}


/*
 * Give the video preview itself a responsive widescreen area.
 */
.video-dropzone .dz-preview .dz-image {
    width: 100% !important;
    max-width: 100% !important;

    height: auto !important;

    aspect-ratio: 16 / 9;

    background: #111827 !important;
}

.video-dropzone .dz-preview .dz-image video {
    width: 100% !important;
    height: 100% !important;
}


/*
 * Mobile media layout.
 */
@media (max-width: 600px) {

    .media-dropzone {
        width: 100% !important;
        max-width: 100% !important;

        padding:
            14px
            10px !important;
    }

    .media-dropzone.dz-started {
        padding:
            10px !important;
    }

    .media-dropzone .dz-message {
        width: 100%;
        max-width: 100%;

        box-sizing: border-box;
    }


    /*
     * One video = one full-width card.
     *
     * Do not inherit the two-column photo-preview layout.
     */
    .video-dropzone .dz-preview {
        display: flex !important;

        width: 100% !important;
        max-width: 100% !important;

        min-height: 0 !important;

        margin:
            8px
            0 !important;
    }

    .video-dropzone .dz-preview .dz-image {
        width: 100% !important;
        max-width: 100% !important;

        aspect-ratio: 16 / 9;
    }

    .video-dropzone .dz-preview video {
        width: 100% !important;
        max-width: 100% !important;
    }

}


/*
 * Very narrow phones:
 * use one photograph preview per row too.
 */
@media (max-width: 420px) {

    .media-dropzone:not(.video-dropzone) .dz-preview {
        width: 100% !important;

        margin:
            7px
            0 !important;
    }

    .media-dropzone:not(.video-dropzone)
    .dz-preview
    .dz-image {
        height: 190px !important;
    }

}

