/* ============================================================
   RFE Google Drive Upload v3.3
   FIX: button base styles removed so Elementor selectors always win
   NEW: overlay, preview-list styles
   ============================================================ */

.rfe-gdrive-wrapper {
    width: 100%;
    font-family: inherit;
}

.rfe-not-configured {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 12px;
}

/* ── Dropzone ──────────────────────────────────────────── */
.rfe-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 40px 24px;
    background-color: #f8faff;
    border: 2px dashed #c3d0f7;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .2s ease;
    outline: none;
    position: relative;
    box-sizing: border-box;
}
.rfe-dropzone.rfe-drag-over {
    background-color: #edf2ff;
    border-color: #4A6CF7;
    border-style: solid;
}

/* ── Dropzone icon ─────────────────────────────────────── */
.rfe-dz-icon { display: block; line-height: 0; pointer-events: none; }
.rfe-dz-icon svg,
.rfe-dz-icon img { width: 48px; height: 48px; color: #4A6CF7; stroke: #4A6CF7; display: block; }
.rfe-dz-icon i   { font-size: 48px; color: #4A6CF7; display: block; }

/* ── Dropzone texts ────────────────────────────────────── */
.rfe-dz-title {
    display: block; font-size: 16px; font-weight: 700;
    color: #1a2140; line-height: 1.3; pointer-events: none;
}
.rfe-dz-sub {
    display: block; font-size: 13px; color: #6b7280;
    line-height: 1.5; pointer-events: none;
}
.rfe-dz-meta { display: block; font-size: 11px; color: #9ca3af; pointer-events: none; }

/* ── Pick-files button ─────────────────────────────────── */
/*
 * FIX v3.3: NO hardcoded background/color here.
 * Elementor's {{WRAPPER}} .rfe-dz-btn selector sets these.
 * Only structural/behavioral properties remain here.
 */
.rfe-dz-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background-color: #4A6CF7;   /* fallback only — Elementor overrides */
    color: #ffffff;              /* fallback only */
    border: 0 solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 2;
    pointer-events: auto;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease,
                box-shadow .2s ease, transform .15s ease;
}
.rfe-dz-btn:hover { transform: translateY(-1px); }
.rfe-dz-btn:active { transform: translateY(0); }

/* ── File list ─────────────────────────────────────────── */
.rfe-file-list {
    list-style: none; margin: 12px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}

/* ── File item — 3-column grid ──────────────────────────
   [icon 28px] [info 1fr] [actions auto]  row 1
   [·········] [progress] [············]  row 2  */
.rfe-file-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color .2s ease;
}
.rfe-item--uploading { border-color: #93c5fd; }
.rfe-item--done      { border-color: #86efac; }
.rfe-item--error     { border-color: #fca5a5; }

/* Col 1 — file-type icon, spans both rows */
.rfe-file-type-icon {
    grid-column: 1; grid-row: 1 / 3;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rfe-file-type-icon svg,
.rfe-file-type-icon img,
.rfe-file-type-icon i {
    width: 22px; height: 22px;
    color: #4A6CF7; stroke: #4A6CF7; font-size: 22px; display: block;
}

/* Col 2 row 1 — name + size */
.rfe-file-info { grid-column: 2; grid-row: 1; min-width: 0; }
.rfe-file-name {
    display: block; font-size: 13px; font-weight: 600; color: #1a2140;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rfe-file-size { display: block; font-size: 11px; color: #9ca3af; margin-top: 1px; }

/* Col 3 row 1 — status badge + remove */
.rfe-file-actions {
    grid-column: 3; grid-row: 1;
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.rfe-file-status {
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 99px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
}
.rfe-file-status--queued    { background: #f3f4f6; color: #6b7280; }
.rfe-file-status--uploading { background: #dbeafe; color: #1d4ed8; }
.rfe-file-status--done      { background: #dcfce7; color: #166534; }
.rfe-file-status--error     { background: #fee2e2; color: #991b1b; }

.rfe-file-remove {
    background: none; border: none; cursor: pointer;
    color: #9ca3af; padding: 4px; line-height: 0;
    border-radius: 4px; flex-shrink: 0;
    transition: color .15s ease, background-color .15s ease;
    display: flex; align-items: center; justify-content: center;
}
.rfe-file-remove:hover { color: #ef4444; background: #fee2e2; }

/* Col 2 row 2 — progress bar */
.rfe-file-progress { grid-column: 2; grid-row: 2; padding-top: 5px; }
.rfe-progress-track {
    width: 100%; height: 4px;
    background: #e5e7eb; border-radius: 99px; overflow: hidden;
}
.rfe-progress-bar {
    height: 100%; background: #4A6CF7;
    border-radius: 99px; width: 0%; transition: width .15s ease;
}

/* ── Status message ────────────────────────────────────── */
.rfe-status { margin-top: 10px; font-size: 13px; color: #6b7280; min-height: 18px; }
.rfe-status--success { color: #166534; font-weight: 600; }
.rfe-status--error   { color: #991b1b; font-weight: 600; }

/* ── Editor preview list ───────────────────────────────── */
/* Class rfe-preview-list — JS never touches this (only .rfe-file-list) */
.rfe-preview-list {
    list-style: none; margin: 12px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
    opacity: .8;
    pointer-events: none;
}
.rfe-preview-label {
    font-size: 10px; color: #aaa;
    margin: 4px 0 0; padding: 0 2px;
}

/* ── Submit overlay ────────────────────────────────────── */
.rfe-submit-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 100;
    border-radius: inherit;
}
.rfe-submit-overlay__lottie {
    flex-shrink: 0;
}
.rfe-submit-overlay__text {
    font-size: 15px;
    font-weight: 600;
    color: #1a2140;
    text-align: center;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 480px) {
    .rfe-dropzone { padding: 28px 16px; }
    .rfe-dz-title { font-size: 14px; }
}

/* ── Inline validation (v3.31) ─────────────────────────────── */
.rfe-val-msg {
    display: block;
    font-size: 13px;
    color: #ef4444;
    margin-top: 4px;
    line-height: 1.4;
}

/* Red border on text fields — color can be overridden via Elementor style controls */
.rfe-field-invalid-text input,
.rfe-field-invalid-text textarea,
.rfe-field-invalid-text select {
    border-color: #ef4444 !important;
    outline-color: #ef4444 !important;
}

/* ── Floating label base styles (v3.36) ────────────────────── */
/* Active only when rfe_float_label_enable is on (JS adds .focused) */
.rfe-float-active .elementor-field-group:has(input[type=text]),
.rfe-float-active .elementor-field-group:has(input[type=email]),
.rfe-float-active .elementor-field-group:has(input[type=tel]),
.rfe-float-active .elementor-field-group:has(textarea) {
    position: relative;
}
.rfe-float-active .elementor-field-group:has(input[type=text]) .elementor-field-label,
.rfe-float-active .elementor-field-group:has(input[type=email]) .elementor-field-label,
.rfe-float-active .elementor-field-group:has(input[type=tel]) .elementor-field-label,
.rfe-float-active .elementor-field-group:has(textarea) .elementor-field-label {
    cursor: text;
    position: absolute;
    z-index: 10;
    pointer-events: none;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform-origin: left top;
    transition: transform 120ms ease-out, font-size 120ms ease-out, background-color 120ms ease-out;
}
/* Focused / filled state: label floats to top edge of the field border */
.rfe-float-active .elementor-field-group:has(input[type=text]).focused .elementor-field-label,
.rfe-float-active .elementor-field-group:has(input[type=email]).focused .elementor-field-label,
.rfe-float-active .elementor-field-group:has(input[type=tel]).focused .elementor-field-label,
.rfe-float-active .elementor-field-group:has(textarea).focused .elementor-field-label {
    padding: 0 4px;    /* small bg strip covers the border line */
    line-height: 1.2;
}

/* ── Image Choices validation (v3.38) ──────────────────────── */
/* No border/outline on cards — only show text message below */
.rfe-val-msg-after {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #ef4444;
    line-height: 1.4;
}
/* Acceptance checkbox: force message onto new line below the label.
 * The parent span.elementor-field-option uses display:flex which puts
 * all children in one row. We break out of that with width:100% + order. */
.elementor-field-type-acceptance .elementor-field-option {
    flex-wrap: wrap;
}
.elementor-field-type-acceptance .rfe-val-msg {
    width: 100%;
    margin-top: 6px;
    padding-left: 0;
    flex-basis: 100%;
    order: 99;
    /* display controlled by JS show/hide — no !important here */
}
