/* ============================================================
   upload_popover.css — v3
   Fixed position popover, label-based, mobile-safe
   ============================================================ */

/* Hide file inputs — always invisible, triggered by labels */
#imageInput,
#fileInput,
#cameraInput,
#hiddenImageInput,
#hiddenFileInput { display: none !important; }

/* ── Popover — fixed to viewport, never clipped ───────────── */
#uploadPopover {
    display: none;
    position: fixed;
    bottom: 85px;
    right: 14px;
    width: 255px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 18px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.20);
    z-index: 99999;
    overflow: hidden;
}

#uploadPopover.open {
    display: block;
    animation: chipPopIn 0.18s cubic-bezier(0.34,1.46,0.64,1);
}

@keyframes chipPopIn {
    from { opacity:0; transform:scale(0.88) translateY(10px); }
    to   { opacity:1; transform:scale(1)    translateY(0); }
}

/* ── Options — each is a <label> so mobile opens picker natively */
.upload-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    cursor: pointer;
    width: 100%;
    color: #111;
    -webkit-tap-highlight-color: rgba(0,0,0,0.06);
    transition: background 0.1s;
    border: none;
    background: none;
    text-align: left;
    text-decoration: none;
    box-sizing: border-box;
}

.upload-option:not(:last-child) {
    border-bottom: 1px solid #f2f2f2;
}

.upload-option:active { background: #f0f0f0; }

/* Icon bubble */
.upload-option-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.upload-option-icon.cam { background:#dbeafe; color:#2563eb; }
.upload-option-icon.img { background:#dcfce7; color:#16a34a; }
.upload-option-icon.doc { background:#fee2e2; color:#dc2626; }

/* Text */
.upload-option-text strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}
.upload-option-text small {
    font-size: 11.5px;
    color: #6b7280;
}

/* ── + button active state ─────────────────────────────────── */
#bigPlusUploadBtn {
    transition: background 0.15s, transform 0.2s !important;
}
#bigPlusUploadBtn.popover-open {
    background: #1a73e8 !important;
    color: #fff !important;
    transform: rotate(45deg) !important;
}

/* ── Backdrop ──────────────────────────────────────────────── */
#uploadPopoverBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99998;
}
#uploadPopoverBackdrop.open { display: block; }

/* ── Hide old Bootstrap modal completely ───────────────────── */
#enhancedUploadModal { display: none !important; }

/* ── Analyzing spinner inside chips row (not blocking) ─────── */
.analyzing-status {
    font-size: 12px;
    color: #5f6368;
    padding: 4px 8px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
}
.analyzing-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid #1a73e8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: chipSpin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes chipSpin { to { transform: rotate(360deg); } }
