/* Reusable file upload widget — Gmail/Dropbox-style.
   Native <input type="file"> is visually hidden; user interacts with either the
   empty-state "Choose a file" button or the selected-state chip. Supports an
   optional image-preview variant that shows a thumbnail when the selected file
   is an image. */

.file-upload { width: 100%; }

.file-upload input[type="file"] {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 0, 255, 0.4);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.55rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
    transition: all 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.file-upload-btn:hover {
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.08);
}

.file-upload-btn:focus-within {
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(255, 0, 255, 0.3);
}

.file-upload-btn-icon {
    font-size: 1rem;
    color: #00ffff;
}

.file-upload-btn-text { flex: 1; }

.file-upload-btn-hint {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
}

/* Selected state: chip with filename + size + remove */
.file-upload-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(0, 255, 255, 0.08);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #fff;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 0.88rem;
}

.file-upload-chip-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    flex-shrink: 0;
}

.file-upload-chip-icon {
    color: #00ffff;
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 255, 0.06);
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.file-upload-chip-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-upload-chip-name {
    overflow-wrap: anywhere;
}

.file-upload-chip-size {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.76rem;
}

.file-upload-chip-remove {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    width: 28px; height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.file-upload-chip-remove:hover {
    background: rgba(255, 60, 90, 0.18);
    color: #ff6080;
}

.file-upload-chip-remove:focus-visible {
    outline: 2px solid #00ffff;
    outline-offset: 1px;
}

/* ─── Media preview-card (ThemedClearableFileInput / [data-media-field]) ───
   Empty dropzone ↔ preview card. Used for event image, venue logo/cover, and
   the claim proof document. Distinct from the .file-upload chip above, which
   stays for the lightweight CSV picker. */

.media-field { width: 100%; }

.media-field-input,
.media-field-clear-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Empty state: dashed dropzone — compact horizontal row, sized to roughly
   match the preview-card height so toggling empty↔preview doesn't shift the
   form layout. */
.media-field-dropzone {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 0, 255, 0.4);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-family: Arial, sans-serif;
    transition: all 0.15s ease;
}

.media-field-dropzone:hover {
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.08);
}

.media-field:focus-within .media-field-dropzone {
    border-style: solid;
    box-shadow: 0 0 0 2px rgba(255, 0, 255, 0.3);
}

.media-field-dropzone-icon {
    font-size: 1.25rem;
    color: #00ffff;
    flex-shrink: 0;
    line-height: 1;
}

.media-field-dropzone-text {
    font-size: 0.88rem;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.media-field-dropzone-hint {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

/* Preview state: thumbnail + filename + actions */
.media-field-preview {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 0.85rem;
}

.media-field-preview-media {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--rave-dark, #1a0033);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 255, 255, 0.25);
}

.media-field-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-field-preview-icon {
    font-size: 2rem;
    color: #00ffff;
}

.media-field-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.media-field-preview-name {
    color: #fff;
    font-size: 0.88rem;
    font-family: Arial, sans-serif;
    overflow-wrap: anywhere;
}

.media-field-preview-size {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.76rem;
    font-family: Arial, sans-serif;
}

.media-field-preview-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.15rem;
    flex-wrap: wrap;
}

.media-field-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    padding: 0.32rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.15s ease;
}

.media-field-action-replace {
    border-color: rgba(0, 255, 255, 0.4);
    color: #00ffff;
}

.media-field-action-replace:hover {
    background: rgba(0, 255, 255, 0.12);
    border-color: #00ffff;
    color: #fff;
}

.media-field-action-remove {
    border-color: rgba(255, 80, 100, 0.4);
    color: #ff8090;
}

.media-field-action-remove:hover {
    background: rgba(255, 60, 90, 0.15);
    border-color: #ff6080;
    color: #fff;
}

.media-field-action-replace:focus-visible,
.media-field-action-remove:focus-visible,
.media-field-input:focus-visible + .media-field-clear-input + .media-field-dropzone {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .media-field-dropzone {
        padding: 0.7rem 0.85rem;
    }
    .media-field-dropzone-hint {
        display: none;
    }
    .media-field-preview-media {
        width: 88px;
        height: 64px;
    }
}

/* Slim, single-line layout on mobile — drops the format hint and tightens
   padding so the upload trigger doesn't dominate the form vertically. */
@media (max-width: 600px) {
    .file-upload-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.85rem;
        gap: 0.4rem;
    }
    .file-upload-btn-hint {
        display: none;
    }
    .file-upload-chip {
        padding: 0.45rem 0.6rem;
        gap: 0.5rem;
    }
    .file-upload-chip-thumb,
    .file-upload-chip-icon {
        width: 36px;
        height: 36px;
    }
    .file-upload-chip-icon {
        font-size: 1.15rem;
    }
}
