/* ========================================
   FILE UPLOAD ZONE (Drag & Drop) — structure
   Shared by registration templates AND post form layouts:
   Field_File renders .wpuf-file-upload-zone on both. Palette
   (border/background) comes from the reg-template / layout CSS.
   ======================================== */

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone:focus-within {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-content {
    text-align: center;
    padding: 20px;
    max-width: 75%;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-icon {
    display: flex;
    justify-content: center;
    align-items: center;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-icon svg {
    width: 48px;
    height: 48px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone:hover .wpuf-upload-icon svg {
    opacity: 0.8;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-title {
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    margin-top: 20px;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-instructions {
    font-weight: 400;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

/* Hidden trigger that preserves all functionality */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-trigger:hover {
    cursor: pointer;
}

form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-trigger:focus {
    outline: none;
}

/* The zone re-uses print_label() — neutralize the form's side-label float
   (30% column) inside the zone so title + instructions stack centered. */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-title .wpuf-label {
    float: none;
    width: auto;
    display: block;
    text-align: center;
}
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-title .wpuf-label label {
    font-weight: 400;
    font-size: 16px;
}

/* Long allowed-extension lists must wrap inside the zone, never overflow it */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-content {
    max-width: 90%;
    box-sizing: border-box;
    overflow: hidden;
}
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-upload-instructions {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* The full-zone trigger overlay must not swallow clicks on uploaded rows:
   lift the attachment list (and its delete buttons) above it. */
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone .wpuf-attachment-list,
form[class*="wpuf-form-layout"] .wpuf-fields .wpuf-file-upload-zone ~ .wpuf-attachment-list {
    position: relative;
    z-index: 11;
}

/* Modern upload progress — replaces the legacy Bootstrap striped bar shown
   while a file is uploading (upload.js .upload-item > .progress > .bar). */
.wpuf-attachment-upload-filelist .upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-top: 8px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.10);
}
.wpuf-attachment-upload-filelist .upload-item .filename {
    order: 1;
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.4;
    color: inherit;
    margin: 0;
}
.wpuf-attachment-upload-filelist .upload-item .progress {
    order: 2;
    flex: 0 0 120px;
    height: 6px;
    margin: 0;
    background: rgba(148, 163, 184, 0.30);
    border: 0 !important;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: none !important;
}
.wpuf-attachment-upload-filelist .upload-item .progress .bar {
    height: 100%;
    background: #3B82F6;
    border-radius: 999px;
    transition: width 0.2s ease;
}
