/* ============================================================
   OCR live scan — 実際のアップロード処理中に表示する視覚効果
   ai-accounting.html の handleInvoiceUpload() 用 (2026-09-21 追加)。

   ホームページの components/landing/styles/ocr-demo-widget.css と
   同じデザイン言語(ダークガラス+スキャンライン+バラ色アクセント)だが、
   ここでは「ユーザーが実際にアップロードしたファイル」をスキャン対象
   として表示し、進捗は不確定(indeterminate)アニメーションのみを使う。
   実際のOCR処理はバックエンドから一括レスポンスのみで、途中の
   段階的な進捗は取得できないため、偽の完了率・偽の完了順序は
   一切表示しない(3つのステップは同時に「処理中」を示すだけ)。
   ============================================================ */

.ocr-live-bubble {
    max-width: 420px;
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 100%);
    border-radius: 24px;
    padding: 18px 20px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ocr-live-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 14px;
}

.ocr-live-header i {
    animation: ocr-live-spin 1s linear infinite;
}

.ocr-live-grid {
    display: grid;
    grid-template-columns: minmax(0, 120px) minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
}

@media (max-width: 480px) {
    .ocr-live-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ocr-live-scanbed {
    position: relative;
    background: #0f172a;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    aspect-ratio: 3 / 4;
    min-height: 110px;
}

@media (max-width: 480px) {
    .ocr-live-scanbed {
        aspect-ratio: 16 / 9;
        max-height: 150px;
    }
}

.ocr-live-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.85;
}

.ocr-live-fileicon {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    text-align: center;
    padding: 8px;
}

.ocr-live-fileicon i {
    font-size: 28px;
    color: #fb7185;
}

.ocr-live-scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #38bdf8 15%, #e0f2fe 50%, #38bdf8 85%, transparent);
    box-shadow: 0 0 12px 2px rgba(56, 189, 248, 0.85);
    animation: ocr-live-scan-sweep 2.4s ease-in-out infinite;
}

.ocr-live-progress-track {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

.ocr-live-progress-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, #fb7185, #38bdf8);
    animation: ocr-live-indeterminate 1.6s ease-in-out infinite;
}

.ocr-live-steps {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.ocr-live-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 7px 10px;
}

.ocr-live-step i {
    width: 16px;
    text-align: center;
    animation: ocr-live-pulse 1.4s ease-in-out infinite;
}

.ocr-live-step:nth-child(1) i { animation-delay: 0s; }
.ocr-live-step:nth-child(2) i { animation-delay: 0.25s; }
.ocr-live-step:nth-child(3) i { animation-delay: 0.5s; }

@keyframes ocr-live-scan-sweep {
    0% { top: 4%; }
    50% { top: 90%; }
    100% { top: 4%; }
}

@keyframes ocr-live-indeterminate {
    0% { left: -40%; }
    100% { left: 100%; }
}

@keyframes ocr-live-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.15); }
}

@keyframes ocr-live-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ocr-live-scanline,
    .ocr-live-progress-fill,
    .ocr-live-step i,
    .ocr-live-header i {
        animation: none !important;
    }
}
