/* ── wc-dropzone.css — Unified styles (frontend + admin) ─── */

/* ── Base / Dropzone overrides ──────────────────────── */

.dz-details { display: none; }

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

.dz-image img {
    transition: .3s !important;
    max-width: 120px !important;
}

.dropzone {
    min-height: 150px;
    border: 2px dashed rgba(0, 0, 0, 0.3);
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #666;
    font-family: Arial, sans-serif;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dropzone:hover {
    background: #f0f0f0;
    border-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.dropzone.dragover {
    background: #e0f7fa;
    border-color: #00acc1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.dropzone p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

.dropzone.dragover::before {
    font-size: 18px;
    color: #00acc1;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.dropzone .dz-preview.dz-image-preview { background: transparent; }

img.upload-icon {
    max-width: 100px !important;
    margin-bottom: .5em;
}

.dz-message p {
    font-size: 1.1rem !important;
}

/* ── Grid layout ────────────────────────────────────── */

#wc-dropzone-form:has(.dz-preview) {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    #wc-dropzone-form:has(.dz-preview) {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    #wc-dropzone-form:has(.dz-preview) {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── R031: Grid alignment — override Dropzone defaults ── */

/* Remove Dropzone's 16px margin that compounds with grid gap */
#wc-dropzone-form.dropzone .dz-preview {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center image within grid cell; make it the positioning anchor for marks */
#wc-dropzone-form.dropzone .dz-preview .dz-image {
    position: relative;
    margin: 0 auto;
}

/* Center success/error marks on .dz-image, not the full preview cell */
#wc-dropzone-form.dropzone .dz-preview .dz-success-mark,
#wc-dropzone-form.dropzone .dz-preview .dz-error-mark {
    top: 50%;
    left: 50%;
    margin-left: -27px;
    margin-top: -27px;
}

/* Center remove link under image */
#wc-dropzone-form.dropzone .dz-preview .dz-remove {
    display: block;
    text-align: center;
    margin-top: 4px;
}

/* ── R027: Styled progress bar ──────────────────────── */

/* Reposition progress bar below the image instead of centered overlay */
#wc-dropzone-form.dropzone .dz-preview .dz-progress {
    position: relative;
    top: auto;
    left: auto;
    margin: 6px 0 0;
    width: 100%;
    max-width: 120px;
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
}

/* Progress fill bar — accent color matching dragover state */
#wc-dropzone-form.dropzone .dz-preview .dz-progress .dz-upload {
    background: #00acc1;
    border-radius: 3px;
}

/* ── R029: Restored file visual indicator ───────────── */

/* Subtle green bottom border on restored / previously uploaded files */
#wc-dropzone-form.dropzone .dz-preview.dz-existing .dz-image {
    border-bottom: 3px solid #4caf50;
}

/* Persistent small checkmark tint for restored files */
#wc-dropzone-form.dropzone .dz-preview.dz-existing .dz-success-mark {
    opacity: 0.6;
}

/* ── Admin: Order images meta box ───────────────────── */

.wc-dropzone-order-images {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.wc-dropzone-order-image {
    position: relative;
    display: inline-block;
    text-align: center;
    width: 150px;
}

.wc-dropzone-order-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wc-dropzone-order-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wc-dropzone-order-image a {
    text-decoration: none;
    color: #0073aa;
    display: inline-block;
    margin-top: 5px;
}

.wc-dropzone-order-image a:hover {
    text-decoration: underline;
}

.wc-dropzone-delete-image {
    position: absolute;
    top: 10px;
    right: 5px;
    background: #f28b82;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.3s ease;
}

.wc-dropzone-delete-image:hover {
    background: red;
}

/* ── Admin: Modal overlay ───────────────────────────── */

.wc-dropzone-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.wc-dropzone-modal.hidden {
    display: none !important;
}

.wc-dropzone-modal-content {
    background: #fff;
    padding: 20px 30px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* ── Admin: Delete confirmation UI ──────────────────── */

.wc-dropzone-confirm-delete {
    text-align: center;
    margin-top: 4px;
}

.wc-dropzone-confirm-delete span {
    font-size: 11px;
    display: block;
    margin-bottom: 2px;
}

.wc-dropzone-confirm-yes {
    font-size: 11px;
    padding: 1px 6px;
    margin-right: 4px;
    cursor: pointer;
}

.wc-dropzone-confirm-no {
    font-size: 11px;
    padding: 1px 6px;
    cursor: pointer;
}
