/* ── WCU Frontend v1.0.2 ─────────────────────────────────────────────────── */

/* ── Upload section ──────────────────────────────────────────────────────── */
.wcu-upload-section {
    margin-bottom: 16px;
}

.wcu-upload-label {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
}

.wcu-required-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #fff;
    background: #e74c3c;
    border-radius: 20px;
    padding: 2px 7px;
}

/* ── Preview thumbnails ──────────────────────────────────────────────────── */
.wcu-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.wcu-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(128,128,128,0.12);
    border: 1px solid rgba(128,128,128,0.22);
    flex-shrink: 0;
    animation: wcuPop .2s ease forwards;
}

@keyframes wcuPop {
    from { opacity: 0; transform: scale(.75); }
    to   { opacity: 1; transform: scale(1); }
}

.wcu-preview-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcu-preview-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    padding: 6px;
    text-align: center;
}

.wcu-preview-file-name {
    font-size: 9px;
    opacity: 0.6;
    word-break: break-all;
    line-height: 1.3;
}

.wcu-preview-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
}

.wcu-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255,255,255,0.2);
    border-top-color: rgba(255,255,255,0.85);
    border-radius: 50%;
    animation: wcuSpin .65s linear infinite;
}

@keyframes wcuSpin { to { transform: rotate(360deg); } }

/* Remove × */
.wcu-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(231,76,60,0.90);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
    opacity: 0;
    transform: scale(.7);
    transition: opacity .18s, transform .18s;
}

.wcu-preview-item:hover .wcu-preview-remove {
    opacity: 1;
    transform: scale(1);
}

.wcu-preview-remove:hover { background: #c0392b; }

/* ── Drop zone ───────────────────────────────────────────────────────────── */
/* Matches Image 2: white/light bordered pill row with icon + text + button  */
.wcu-dropzone {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border: 1.5px solid rgba(128,128,128,0.30) !important;
    border-radius: 8px !important;
    padding: 10px 16px !important;
    background: rgba(255,255,255,0.04) !important;
    cursor: default;
    transition: border-color .18s, background .18s;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.wcu-dropzone.wcu-drag-active {
    border-color: rgba(128,128,128,0.65) !important;
    background: rgba(128,128,128,0.08) !important;
}

/* Upload icon — force size so XStore cannot override */
.wcu-zone-icon {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    opacity: 0.55;
    color: inherit;
    /* Hard-coded so svg inside cannot be stretched by global rules */
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
}

/* Kill any XStore global svg stretching inside our zone icon */
.wcu-zone-icon svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block !important;
}

.wcu-zone-text {
    font-size: 13px;
    opacity: 0.55;
    white-space: nowrap;
    flex-shrink: 0;
}

/* CHOOSE FILES button — rendered as <label> */
label.wcu-choose-btn,
.wcu-choose-btn {
    display: inline-block !important;
    padding: 5px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    letter-spacing: .4px !important;
    text-align: center !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    color: inherit !important;
    background: transparent !important;
    border: 1.5px solid rgba(128,128,128,0.55) !important;
    border-radius: 5px !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: uppercase !important;
    transition: background .15s, border-color .15s !important;
    margin: 0 !important;
    flex-shrink: 0;
}

label.wcu-choose-btn:hover,
.wcu-choose-btn:hover {
    background: rgba(128,128,128,0.12) !important;
    border-color: rgba(128,128,128,0.75) !important;
}

label.wcu-choose-btn.wcu-btn-disabled,
.wcu-choose-btn.wcu-btn-disabled {
    opacity: 0.35 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Right side: file count / max info */
.wcu-zone-right {
    font-size: 12px;
    opacity: 0.45;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Progress bar ────────────────────────────────────────────────────────── */
.wcu-progress-wrap {
    height: 3px;
    background: rgba(128,128,128,0.18);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 6px;
}

.wcu-progress-bar {
    height: 100%;
    width: 0;
    background: currentColor;
    opacity: 0.6;
    border-radius: 99px;
    transition: width .25s ease;
}

/* ── Status / error ──────────────────────────────────────────────────────── */
.wcu-upload-status {
    font-size: 12px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 5px;
    display: none;
    word-break: break-word;
}

.wcu-upload-status.is-error {
    display: block;
    color: #e74c3c;
    background: rgba(231,76,60,0.08);
    border: 1px solid rgba(231,76,60,0.22);
}

/* ── Custom text fields ───────────────────────────────────────────────────── */
.wcu-fields-section { margin-top: 12px; }

.wcu-fields-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px;
}

.wcu-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wcu-field-wrap--full { grid-column: 1 / -1; }

.wcu-field-label {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    color: inherit;
}

.wcu-field-req { color: #e74c3c; font-size: 14px; line-height: 1; }

.wcu-field {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: inherit;
    background: transparent;
    border: 1.5px solid rgba(128,128,128,0.35);
    border-radius: 5px;
    outline: none;
    transition: border-color .18s;
    appearance: none;
    -webkit-appearance: none;
}

.wcu-field:focus { border-color: rgba(128,128,128,0.7); }
.wcu-field.wcu-field--invalid { border-color: #e74c3c; }
.wcu-field--textarea { resize: vertical; min-height: 76px; }

.wcu-char-counter { font-size: 11px; opacity: .5; text-align: right; }
.wcu-char-counter.over { color: #e74c3c; opacity: 1; font-weight: 700; }

.wcu-field-error { font-size: 12px; color: #e74c3c; display: none; }
.wcu-field-error.is-visible { display: block; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .wcu-zone-right { display: none; }
    .wcu-fields-grid { grid-template-columns: 1fr; }
    .wcu-field-wrap--full { grid-column: 1; }
    .wcu-preview-item { width: 68px; height: 68px; }
}
