/* -- InspectVoice Demo — design tokens (motyw "korpo") ----------- */

:root {
    --iv-bg-primary: #F5F7F9;
    --iv-bg-secondary: #FFFFFF;
    --iv-bg-surface: #F0F2F5;
    --iv-border: rgba(0,0,0,0.15);
    --iv-text-primary: #111827;
    --iv-text-secondary: rgba(0,0,0,0.5);
    --iv-text-tertiary: rgba(0,0,0,0.35);
    --iv-accent: #1D9E75;
    --iv-accent-dark: #085041;
    --iv-accent-light: #E1F5EE;
    --iv-accent-text: #0F6E56;
    --iv-radius-md: 8px;
    --iv-radius-lg: 14px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--iv-bg-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--iv-text-primary);
}

h1:focus { outline: none; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 8px;
    margin: 16px;
}
.blazor-error-boundary::after { content: "Wystąpił błąd."; }

/* -- Top bar ------------------------------------------------------ */
.iv-demo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 24px;
    background: var(--iv-bg-secondary);
    border-bottom: 0.5px solid var(--iv-border);
    flex-wrap: wrap;
}
.iv-demo-brand { display: flex; align-items: center; gap: 8px; }
.iv-demo-brand-ico { height: 24px; width: auto; display: block; }
.iv-demo-brand-name { font-size: 16px; font-weight: 700; color: var(--iv-text-primary); }
.iv-demo-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(217,119,6,0.12);
    color: #92400e;
}

/* -- Generic components (subset of produkcyjnego design systemu) -- */
.iv-card {
    background: var(--iv-bg-secondary);
    border: 0.5px solid var(--iv-border);
    border-radius: var(--iv-radius-lg);
    padding: 16px;
}
.iv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: var(--iv-radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: 1.5px solid var(--iv-border);
    background: var(--iv-bg-secondary);
    color: var(--iv-text-primary);
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.iv-btn:hover:not(:disabled) { border-color: var(--iv-accent); }
.iv-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.iv-btn.primary { background: var(--iv-accent); border-color: var(--iv-accent); color: white; }
.iv-btn.primary:hover:not(:disabled) { opacity: 0.88; }
.iv-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
}
.iv-chip.green { background: var(--iv-accent-light); color: var(--iv-accent-text); }
.iv-chip.gray { background: var(--iv-bg-surface); color: var(--iv-text-tertiary); }
.iv-spin {
    width: 14px; height: 14px;
    border: 2px solid rgba(29,158,117,0.25);
    border-top-color: var(--iv-accent);
    border-radius: 50%;
    display: inline-block;
    animation: iv-spin-rot .7s linear infinite;
}
@keyframes iv-spin-rot { to { transform: rotate(360deg); } }

/* -- Demo page layout ---------------------------------------------- */
.iv-demo-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}
.iv-demo-intro { text-align: center; margin-bottom: 28px; }
.iv-demo-intro h1 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.iv-demo-intro p { font-size: 14px; color: var(--iv-text-secondary); margin: 0; }

/* Scenario grid */
.iv-sc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.iv-sc {
    padding: 16px 14px;
    border-radius: var(--iv-radius-lg);
    border: 0.5px solid var(--iv-border);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    background: var(--iv-bg-secondary);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.iv-sc:hover { border-color: rgba(29,158,117,0.45); box-shadow: 0 4px 16px -4px rgba(29,158,117,0.15); }
.iv-sc.sel { border-color: var(--iv-accent); background: rgba(29,158,117,0.06); }
.iv-sc-ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.iv-sc-title { font-size: 13px; font-weight: 600; }
.iv-sc-sub { font-size: 11px; color: var(--iv-text-secondary); margin-top: 2px; }

/* Detail panel */
.iv-detail { margin-top: 20px; }
.iv-step {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.iv-step-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--iv-accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.iv-step-title { font-size: 13px; font-weight: 600; }
.iv-step-sep { height: 1px; background: var(--iv-border); flex: 1; }
.iv-field-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 10px; margin-bottom: 4px; }
.iv-lbl { font-size: 10px; font-weight: 600; color: var(--iv-text-tertiary); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 4px; }
.iv-inp-ro {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: var(--iv-radius-md);
    border: 1.5px solid var(--iv-border);
    background: var(--iv-bg-surface);
    color: var(--iv-text-primary);
    box-sizing: border-box;
}
.iv-text-box {
    background: var(--iv-bg-surface);
    border: 1.5px solid var(--iv-border);
    border-radius: var(--iv-radius-md);
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--iv-text-primary);
}

/* Device broadcast simulation */
.iv-devices { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.iv-device-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--iv-radius-md);
    border: 0.5px solid var(--iv-border);
    background: var(--iv-bg-surface);
    font-size: 12px;
    transition: background 0.3s, border-color 0.3s;
}
.iv-device-row.live {
    background: var(--iv-accent-light);
    border-color: var(--iv-accent);
}
.iv-device-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--iv-text-tertiary);
    flex-shrink: 0;
    transition: background 0.3s;
}
.iv-device-row.live .iv-device-dot {
    background: var(--iv-accent);
    animation: iv-dot-pulse 1s ease-in-out infinite;
}
@keyframes iv-dot-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.iv-toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--iv-text-primary);
    color: white;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all .3s;
    z-index: 999;
}
.iv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
