/* demo.css — Demo interactive ediflo */

/* ---- Top bar ---- */
.demo-topbar { background: #fff; border-bottom: 2px solid #7366ab; padding: 0.5rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 52px; }
.demo-topbar img { height: 28px; }
.demo-topbar .demo-label { background: linear-gradient(135deg, #7366ab, #f59b1c); color: #fff; padding: 0.25rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.demo-progress { position: fixed; top: 52px; left: 0; right: 0; height: 3px; background: #eee; z-index: 99; }
.demo-progress-bar { height: 100%; background: linear-gradient(90deg, #7366ab, #f59b1c); transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1); width: 16.66%; }

/* ---- Sidebar ---- */
.demo-sidebar { position: fixed; top: 55px; left: 0; bottom: 0; width: 240px; background: #2d2d3a; padding-top: 1rem; z-index: 50; transition: transform 0.3s ease; }
.demo-sidebar .sidebar-item { display: flex; align-items: center; padding: 0.75rem 1.25rem; color: #b0b0c0; cursor: pointer; transition: all 0.2s ease; font-size: 0.92rem; border-left: 3px solid transparent; }
.demo-sidebar .sidebar-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.demo-sidebar .sidebar-item.active { background: rgba(115,102,171,0.2); color: #fff; border-left-color: #7366ab; }
.demo-sidebar .sidebar-item i { width: 24px; margin-right: 0.75rem; text-align: center; font-size: 1rem; }

/* ---- Main content ---- */
.demo-main { margin-left: 240px; margin-top: 55px; min-height: calc(100vh - 55px); background: #f5f6fa; padding: 1.5rem 2rem; }
.demo-screen { display: none; animation: fadeIn 0.3s ease; }
.demo-screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Stat cards ---- */
.stat-card { background: #fff; border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 12px rgba(0,0,0,0.06); text-align: center; }
.stat-card .stat-number { font-size: 2.2rem; font-weight: 700; color: #2d2d3a; line-height: 1.2; }
.stat-card .stat-label { font-size: 0.85rem; color: #6c757d; margin-top: 0.25rem; }
.stat-card.violet .stat-number { color: #7366ab; }
.stat-card.orange .stat-number { color: #f59b1c; }
.stat-card.green .stat-number { color: #06d6a0; }
.stat-card.red .stat-number { color: #f14668; }

/* ---- Bar chart ---- */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 0.5rem 0; }
.bar-chart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-chart .bar { width: 100%; border-radius: 4px 4px 0 0; transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1); }
.bar-chart .bar.emise { background: #7366ab; }
.bar-chart .bar.recue { background: #f59b1c; }
.bar-chart .bar-label { font-size: 0.7rem; color: #6c757d; }

/* ---- Invoice table ---- */
.invoice-table { width: 100%; background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow: hidden; }
.invoice-table thead th { background: #f8f9fa; padding: 0.75rem 1rem; font-size: 0.8rem; text-transform: uppercase; color: #6c757d; font-weight: 600; border-bottom: 1px solid #eee; text-align: left; }
.invoice-table tbody tr { cursor: pointer; transition: background 0.15s; }
.invoice-table tbody tr:hover { background: #f0eef7; }
.invoice-table tbody td { padding: 0.75rem 1rem; font-size: 0.9rem; border-bottom: 1px solid #f0f0f0; }
.direction-badge { font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600; }
.direction-badge.emise { background: #f0eef7; color: #7366ab; }
.direction-badge.recue { background: #fff4e0; color: #f59b1c; }

/* ---- Status tags ---- */
.status-tag { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 20px; font-weight: 600; display: inline-block; }
.status-tag.brouillon { background: #e8e8e8; color: #666; }
.status-tag.envoyee { background: #e0f0ff; color: #3298dc; }
.status-tag.recue { background: #e0fff6; color: #00d1b2; }
.status-tag.prise-en-charge { background: #fff4e0; color: #f59b1c; }
.status-tag.approuvee { background: #e0fbf0; color: #06d6a0; }
.status-tag.payee { background: #d0f5e8; color: #04b588; }
.status-tag.erreur { background: #ffe0e6; color: #f14668; }

/* ---- Detail panel ---- */
.detail-panel { position: fixed; top: 55px; right: 0; bottom: 0; width: 480px; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,0.12); z-index: 80; transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; padding: 1.5rem; }
.detail-panel.open { transform: translateX(0); }
.detail-panel .close-btn { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #6c757d; }

/* ---- Status timeline ---- */
.status-timeline { display: flex; align-items: flex-start; gap: 0; margin: 1.5rem 0; position: relative; }
.timeline-step { flex: 1; text-align: center; position: relative; }
.timeline-dot { width: 24px; height: 24px; border-radius: 50%; background: #e0e0e0; margin: 0 auto 0.5rem; display: flex; align-items: center; justify-content: center; transition: all 0.5s ease; position: relative; z-index: 2; }
.timeline-dot.reached { background: #06d6a0; }
.timeline-dot.reached i { color: #fff; font-size: 0.65rem; }
.timeline-step .timeline-label { font-size: 0.65rem; color: #999; transition: color 0.3s; }
.timeline-step .timeline-label.reached { color: #2d2d3a; font-weight: 600; }
.timeline-step .timeline-time { font-size: 0.6rem; color: #aaa; margin-top: 2px; }
.timeline-line { position: absolute; top: 12px; left: 50%; width: 100%; height: 2px; background: #e0e0e0; z-index: 1; }
.timeline-line.reached { background: #06d6a0; }
.timeline-step:last-child .timeline-line { display: none; }

/* ---- Wizard cards ---- */
.method-card { background: #fff; border: 2px solid #eee; border-radius: 12px; padding: 2rem 1.5rem; text-align: center; cursor: pointer; transition: all 0.25s ease; }
.method-card:hover { border-color: #7366ab; transform: translateY(-4px); box-shadow: 0 8px 24px rgba(115,102,171,0.15); }
.method-card i { font-size: 2.5rem; color: #7366ab; margin-bottom: 0.75rem; }
.method-card h4 { font-size: 1.1rem; font-weight: 700; color: #2d2d3a; }
.method-card p { font-size: 0.85rem; color: #6c757d; margin-top: 0.25rem; }

/* ---- Upload zone ---- */
.upload-zone { border: 2px dashed #bbb; border-radius: 12px; padding: 3rem; text-align: center; cursor: pointer; transition: all 0.3s; background: #fafafa; }
.upload-zone:hover, .upload-zone.dragover { border-color: #7366ab; background: #f0eef7; }
.upload-zone i { font-size: 3rem; color: #bbb; margin-bottom: 1rem; }

/* ---- AI parse results ---- */
.parse-result { display: flex; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid #f0f0f0; }
.parse-result .field-name { width: 140px; font-weight: 600; color: #6c757d; font-size: 0.85rem; }
.parse-result .field-value { flex: 1; font-size: 0.9rem; color: #2d2d3a; }
.parse-result .confidence { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 10px; }
.confidence.high { background: #e0fbf0; color: #06d6a0; }
.confidence.medium { background: #fff4e0; color: #f59b1c; }

/* ---- Processing steps ---- */
.process-step { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0; font-size: 0.95rem; color: #6c757d; }
.process-step.active { color: #2d2d3a; }
.process-step.done { color: #06d6a0; }
.process-step .step-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; }
.process-step .spinner { width: 20px; height: 20px; border: 2px solid #e0e0e0; border-top-color: #7366ab; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Confetti ---- */
.confetti-container { position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti-piece { position: absolute; width: 10px; height: 10px; top: -10px; animation: confettiFall 3s ease-out forwards; }
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

/* ---- API two-column layout ---- */
.api-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.api-endpoints { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.api-terminal { flex: 1; min-width: 0; }

/* Endpoint cards (sidebar) */
.endpoint-card { background: #fff; border: 2px solid #eee; border-radius: 10px; padding: 0.75rem 1rem; cursor: pointer; transition: all 0.2s ease; }
.endpoint-card:hover { border-color: #7366ab; background: #f9f8fc; }
.endpoint-card.active { border-color: #7366ab; background: #f0eef7; box-shadow: 0 2px 8px rgba(115,102,171,0.15); }
.endpoint-card code { font-size: 0.82rem; margin-left: 0.4rem; color: #2d2d3a; font-weight: 600; }
.endpoint-card p { font-size: 0.78rem; color: #6c757d; margin-top: 0.25rem; margin-bottom: 0; }
.endpoint-card .tag { font-size: 0.65rem !important; padding: 0.1rem 0.4rem; vertical-align: middle; }

@media (max-width: 1024px) {
    .api-layout { flex-direction: column; }
    .api-endpoints { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
    .endpoint-card { flex: 1; min-width: 180px; }
}

/* ---- Terminal ---- */
.terminal { background: #1e1e2e; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.terminal-bar { background: #313244; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 6px; }
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dot.r { background: #f38ba8; }
.terminal-dot.y { background: #f9e2af; }
.terminal-dot.g { background: #a6e3a1; }
.terminal-body { padding: 1.25rem; font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; font-size: 0.85rem; line-height: 1.6; color: #cdd6f4; min-height: 300px; overflow-x: auto; }
.terminal-body .prompt { color: #a6e3a1; }
.terminal-body .method { color: #f9e2af; }
.terminal-body .url { color: #89b4fa; }
.terminal-body .string { color: #a6e3a1; }
.terminal-body .key { color: #89b4fa; }
.terminal-body .number { color: #fab387; }
.terminal-body .status-ok { color: #a6e3a1; font-weight: 700; }
.terminal-body .comment { color: #6c7086; }
.terminal-body .cursor { display: inline-block; width: 8px; height: 16px; background: #cdd6f4; animation: blink 1s infinite; vertical-align: text-bottom; }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* ---- Email flow ---- */
.email-flow { display: flex; align-items: center; justify-content: center; gap: 0; margin: 2rem 0; flex-wrap: wrap; }
.email-flow-step { text-align: center; padding: 1rem; flex: 1; min-width: 140px; }
.email-flow-step .flow-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem; font-size: 1.4rem; }
.email-flow-arrow { color: #7366ab; font-size: 1.5rem; }

/* ---- Entity modal ---- */
.modal-card { border-radius: 12px; overflow: hidden; }
.entity-result { padding: 0.75rem 1rem; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; }
.entity-result:hover { background: #f0eef7; }

/* ---- CTA section ---- */
.demo-cta { background: linear-gradient(135deg, #7366ab 0%, #5f5494 100%); color: #fff; padding: 4rem 2rem; text-align: center; margin-left: 240px; }

/* ---- Tour tooltip ---- */
.tour-tooltip { position: fixed; top: 100px; left: 250px; background: #7366ab; color: #fff; padding: 0.75rem 1.25rem; border-radius: 8px; font-size: 0.85rem; z-index: 110; box-shadow: 0 4px 16px rgba(115,102,171,0.4); animation: tooltipPulse 2s ease infinite; }
.tour-tooltip::before { content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-right-color: #7366ab; border-left: none; }
@keyframes tooltipPulse { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* ---- Hamburger (mobile) ---- */
.demo-hamburger { display: none; background: none; border: none; font-size: 1.4rem; color: #2d2d3a; cursor: pointer; }

/* ---- Mobile responsive ---- */
@media (max-width: 768px) {
    .demo-sidebar { transform: translateX(-100%); }
    .demo-sidebar.open { transform: translateX(0); }
    .demo-main { margin-left: 0; }
    .demo-cta { margin-left: 0; }
    .demo-hamburger { display: block; }
    .detail-panel { width: 100%; }
    .tour-tooltip { display: none; }
}

/* ---- Progress bar animation ---- */
.progress-fill { height: 100%; background: linear-gradient(90deg, #7366ab, #06d6a0); border-radius: 4px; transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* ---- Inbox item ---- */
.inbox-item { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 1rem; margin: 0.75rem 0; animation: slideIn 0.5s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }

/* ---- Copy button ---- */
.copy-btn { background: none; border: 1px solid #ddd; border-radius: 6px; padding: 0.3rem 0.6rem; cursor: pointer; font-size: 0.8rem; color: #6c757d; transition: all 0.2s; }
.copy-btn:hover { border-color: #7366ab; color: #7366ab; }
.copy-btn.copied { border-color: #06d6a0; color: #06d6a0; }

/* ---- Section headers ---- */
.section-header { font-size: 1.15rem; font-weight: 700; color: #2d2d3a; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.section-header i { color: #7366ab; }

/* ---- Overlay ---- */
.sidebar-overlay { display: none; position: fixed; top: 55px; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 45; }
@media (max-width: 768px) { .sidebar-overlay.open { display: block; } }
