/* wwwroot/css/home-demo.css
 * Styles for the unauthenticated guided demo (wwwroot/js/demo.js).
 * Scoped under #demo-canvas so it never affects the rest of the app.
 */

body.demo-open { overflow: hidden; }

.demo-canvas {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    flex-direction: column;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #1c1c1c);
}
.demo-canvas.open { display: flex; }

/* ---- Top bar ---- */
.demo-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem 1rem;
    background: var(--bs-primary, #5b6cf0);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
    flex-wrap: wrap;
}
.demo-brand { font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.demo-nosave {
    font-weight: 500;
    font-size: .78rem;
    opacity: .9;
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: .15rem .6rem;
    margin-left: .35rem;
}
.demo-topbar-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.demo-progress { display: flex; gap: .4rem; align-items: center; }
.demo-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(255, 255, 255, .35);
    transition: all .25s ease;
}
.demo-dot.active { background: #fff; transform: scale(1.35); }
.demo-dot.done { background: rgba(255, 255, 255, .8); }

/* ---- Body / stage ---- */
.demo-body { flex: 1; overflow: hidden; display: flex; }
.demo-stage {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem clamp(1rem, 4vw, 3rem);
    padding-bottom: 9rem; /* clearance for the fixed coach */
}
.demo-loading { display: flex; justify-content: center; align-items: center; min-height: 50vh; }
.demo-dim { opacity: .4; filter: grayscale(.6); pointer-events: none; }

/* ---- Coach ---- */
.demo-coach {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(880px, calc(100% - 2rem));
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.1rem;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
    z-index: 20010;
}
[data-bs-theme="dark"] .demo-coach { background: rgba(30, 32, 40, .9); border-color: rgba(255, 255, 255, .12); }
.demo-coach-icon {
    flex: 0 0 auto;
    width: 42px; height: 42px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--bs-primary, #5b6cf0);
    color: #fff; font-size: 1.3rem;
}
.demo-coach-body { flex: 1; min-width: 0; }
.demo-coach-title { margin: 0 0 .15rem; font-weight: 700; font-size: 1rem; }
.demo-coach-text { font-size: .9rem; line-height: 1.35; }
.demo-coach-actions { flex: 0 0 auto; display: flex; gap: .4rem; }
.demo-coach-flash { animation: demoShake .35s ease; }
@keyframes demoShake { 0%,100%{transform:translateX(-50%);} 25%{transform:translateX(calc(-50% - 6px));} 75%{transform:translateX(calc(-50% + 6px));} }

/* ---- Welcome ---- */
.demo-welcome, .demo-finish { max-width: 720px; margin: 4vh auto; text-align: center; }
.demo-welcome-icon, .demo-finish-icon {
    width: 84px; height: 84px; margin: 0 auto 1rem;
    border-radius: 24px; display: grid; place-items: center;
    background: var(--bg-protein, rgba(126,128,229,.15));
    color: var(--macro-protein, #7e80e5); font-size: 2.4rem;
}
.demo-welcome h2, .demo-finish h2 { font-weight: 800; }
.demo-welcome p, .demo-finish p { color: var(--bs-secondary-color); font-size: 1.05rem; }
.demo-welcome-chips { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.5rem; }
.demo-welcome-chips span {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .45rem .9rem; border-radius: 999px;
    background: var(--bs-tertiary-bg, #f1f3f9);
    font-weight: 600; font-size: .85rem;
}
.demo-welcome-chips i { color: var(--bs-primary); }
.demo-finish-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---- Recipe library ---- */
.demo-recipe-img { height: 150px; object-fit: cover; }

/* ---- Nutrition glance ring ---- */
.demo-macro-ring {
    width: 190px; height: 190px; border-radius: 50%;
    margin: 0 auto;
    display: grid; place-items: center;
    background: conic-gradient(var(--bs-tertiary-bg,#eee) 0% 100%);
    position: relative;
}
.demo-macro-ring::after {
    content: ""; position: absolute; inset: 22px; border-radius: 50%;
    background: var(--bs-body-bg, #fff);
}
.demo-macro-ring-center { position: relative; z-index: 1; text-align: center; }
.demo-ring-cal { font-size: 2rem; font-weight: 800; line-height: 1; }
.demo-glance-bar { height: 8px; border-radius: 999px; margin-top: .35rem; }

/* ---- Launch button on the landing hero ---- */
.btn-hero-demo {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .85rem 1.5rem; border-radius: 999px;
    font-weight: 700; cursor: pointer;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-primary, #5b6cf0);
    border: 2px solid var(--bs-primary, #5b6cf0);
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn-hero-demo:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.15); }

/* Several real widgets append to <body> with Bootstrap's default stacking (~1070), which
   would sit behind the canvas overlay (z-index 20000). Lift them while the demo is open:
   - Select2 dropdown (ingredient picker / food search)
   - the calendar's day-summary popover (desktop) and slide-up panel (mobile) */
body.demo-open .select2-container { z-index: 20060 !important; }
body.demo-open .popover,
body.demo-open .day-logs-popover { z-index: 20060 !important; }
body.demo-open .mobile-day-logs-panel { z-index: 20060 !important; }

/* Inline (collapsible) entry details shown in the demo calendar day-summary popover. */
.demo-details-panel {
    border: 1px solid var(--bs-border-color, rgba(0,0,0,.12));
    border-left: 3px solid var(--bs-primary, #5b6cf0);
    border-radius: 10px;
    padding: .6rem .7rem;
    background: var(--bs-tertiary-bg, rgba(0,0,0,.03));
}
.demo-details-head { font-weight: 700; font-size: .82rem; margin-bottom: .25rem; }
.demo-details-cta {
    border-top: 1px dashed var(--bs-border-color, rgba(0,0,0,.15));
    padding-top: .4rem;
    color: var(--bs-secondary-color);
}
.demo-details-cta a { font-weight: 600; }

/* ---- Personalization intro ---- */
.demo-personalize { max-width: 680px; margin: 3vh auto; }
.demo-q { margin-bottom: 1.5rem; }
.demo-q-label { font-weight: 700; margin-bottom: .6rem; font-size: .95rem; }
.demo-choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.demo-choice {
    flex: 1 1 140px;
    display: flex; flex-direction: column; align-items: center; gap: .35rem;
    padding: 1rem .75rem; border-radius: 14px;
    border: 2px solid var(--bs-border-color, rgba(0,0,0,.12));
    background: var(--bs-body-bg, #fff);
    font-weight: 600; cursor: pointer;
    transition: border-color .15s ease, transform .12s ease, background .15s ease;
}
.demo-choice i { font-size: 1.6rem; color: var(--bs-primary, #5b6cf0); }
.demo-choice:hover { transform: translateY(-2px); }
.demo-choice.selected {
    border-color: var(--bs-primary, #5b6cf0);
    background: var(--bg-protein, rgba(126,128,229,.12));
}
.demo-goal-wrap { max-width: 240px; margin-inline: auto; }

@media (max-width: 768px) {
    .demo-topbar { gap: .5rem; padding: .5rem .65rem; }
    .demo-nosave { display: none; }
    .demo-brand { font-size: .9rem; }
    .demo-signup .mdi { margin: 0 !important; }
    .demo-stage { padding: 1rem; padding-bottom: 12rem; }
    .demo-coach { flex-wrap: wrap; gap: .6rem; bottom: .5rem; padding: .7rem .8rem; }
    .demo-coach-icon { width: 34px; height: 34px; font-size: 1.1rem; }
    .demo-coach-actions { width: 100%; justify-content: space-between; }
    .demo-coach-actions .btn { flex: 1; }
    .demo-welcome, .demo-finish, .demo-personalize { margin-top: 1.5vh; }
    .demo-finish-cta .btn { width: 100%; }
}

@media (max-width: 480px) {
    .demo-choice { flex: 1 1 100%; flex-direction: row; justify-content: flex-start; padding: .8rem 1rem; }
    .demo-choice i { font-size: 1.3rem; }
    .demo-progress { display: none; } /* save space; coach shows step context */
}
