/* ══════════════════════════════════════════════════════════════════
   Media Uploader — GLOBAL STYLESHEET
   Shared by:
     • Components/MediaUploader.razor   (the shared upload component)
     • Pages/Posts/PostMediaForm.razor  (the product's image/video component)
   Origin: the inline <style> block in PostMediaForm.razor (lines 114-265)
   → extracted global so the shared component looks the same without
   copying CSS; the class names ".product-media-*" / ".media-preview-*" are unchanged
   so the product page's look & behavior do not change.

   Note: the drag-and-drop JS in wwwroot/js/azureUpload.js binds the drop event by the
   ".product-media-dropzone" selector → the shared component MUST keep this class.
   ══════════════════════════════════════════════════════════════════ */

.product-media-form {
    position: relative;
    width: 100%;
}

.product-media-dropzone {
    position: relative;
    width: 100%;
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    overflow: hidden;
    background: #ffffff;
    border: 1px dashed #d8dee8;
    border-radius: 6px;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.product-media-dropzone:hover {
    background: #f8fbff;
    border-color: #2486f7;
}

.product-media-dropzone.is-dragging {
    background: #f8fbff;
    border-color: #2486f7;
}

.product-media-file-input {
    display: none;
}

.product-media-dropzone .product-media-file-input {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.product-media-dropzone-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #4b5563;
    font-size: 14px;
    line-height: 18px;
    pointer-events: auto;
}

.product-media-primary-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.product-media-add-icon {
    color: #9ca3af;
}

.product-media-link,
.product-media-upload-link {
    position: relative;
    z-index: 3;
    padding: 0;
    border: 0;
    background: transparent;
    color: #2486f7;
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
}

.product-media-link:hover,
.product-media-upload-link:hover {
    color: #1479ed;
    text-decoration: underline;
}

.product-media-helper {
    color: #9ca3af;
    font-size: 12px;
}

.product-media-url-row,
.product-media-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.media-preview-grid {
    display: grid;
    /* A 120px-tall thumbnail ⇒ a minimum column width of 140px for balance (the product create/edit form ⇒ 2 columns) */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
}

.media-preview-card {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.media-preview-card.thumb-selected {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b;
}

.media-preview-visual {
    position: relative;
    /* Product image thumbnail height (create/edit page) */
    height: 120px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.02);
}

.media-preview-visual img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    /* The image is clickable to set it as the cover (see PostMediaForm) ⇒ change the cursor to make it clear */
    cursor: pointer;
}

.media-preview-visual img.media-preview-image-readonly {
    cursor: default;
}

.video-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
}

.media-cover-chip {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 10px;
}

/* The ⋮ menu at the top-right of the frame in the media card (PostMediaForm).
   Always visible so it is easy to find on mobile; a translucent white background so it stands out over images. */
.media-card-menu {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 3;
    line-height: 0;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.media-card-menu .mud-icon-button {
    padding: 2px;
    color: #212B36;
}
