/* ==========================================================================
   Shell: navigation, footer, editor chrome, code blocks, side lists.
   ========================================================================== */

.fc-shell { min-height: 100vh; display: flex; flex-direction: column; }
.fc-main { flex: 1; }

/* --- Top navigation ------------------------------------------------------- */
.fc-nav {
    position: sticky;
    top: 0;
    z-index: 1200;
    background: rgba(10, 11, 22, .86);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--fc-line);
}

.fc-nav__row { display: flex; align-items: center; gap: 28px; height: 68px; }

.fc-shell .fc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fc-text);
    text-decoration: none;
    font-family: var(--fc-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.02em;
}

.fc-brand svg { width: 26px; height: 26px; }
.fc-brand__version { font-family: var(--fc-mono); font-weight: 400; font-size: 11.5px; color: var(--fc-muted); letter-spacing: 0; }

.fc-nav__links { display: flex; gap: 4px; }

.fc-shell .fc-nav__links a {
    color: var(--fc-text-2);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
}

.fc-shell .fc-nav__links a:hover { color: var(--fc-text); background: var(--fc-bg-3); }
.fc-shell .fc-nav__links a.active { color: var(--fc-text); background: var(--fc-bg-3); }
.fc-nav__spacer { flex: 1; }

.fc-search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 10px 0 12px;
    min-width: 210px;
    background: var(--fc-bg-2);
    border: 1px solid var(--fc-line);
    border-radius: 10px;
    color: var(--fc-muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.fc-search:hover { border-color: var(--fc-line-2); color: var(--fc-text-2); }
.fc-search span { flex: 1; text-align: left; }
.fc-kbd { font-family: var(--fc-mono); font-size: 11px; border: 1px solid var(--fc-line-2); padding: 1px 6px; border-radius: 5px; }

/* Adapter selector (#490): a two-option segmented control. */
.fc-adapter {
    display: flex;
    flex: none;
    padding: 3px;
    gap: 2px;
    background: var(--fc-bg-3);
    border: 1px solid var(--fc-line);
    border-radius: 10px;
}

.fc-adapter__opt {
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--fc-text-2);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.fc-adapter__opt:hover { color: var(--fc-text); }
.fc-adapter__opt[aria-pressed="true"] { background: var(--fc-violet); color: #fff; }
.fc-adapter__short { display: none; }

/* Vertical margins only: .fc-wrap centres the note with auto side margins. It is a flex item of
   .fc-shell, where auto margins would shrink it to its text, hence the explicit width. */
.fc-adapter-note { width: 100%; box-sizing: border-box; margin-top: 0; margin-bottom: 0; padding-top: 10px; padding-bottom: 10px; color: var(--fc-muted); font-size: 13.5px; }
.fc-nav .fc-btn--sm { flex: none; white-space: nowrap; }

/* Markdown docs carry both adapters' setup; only the selected one shows. */
:root:not([data-adapter="fluentui"]) .adapter-fluentui,
:root[data-adapter="fluentui"] .adapter-mudblazor { display: none; }

.fc-shell .fc-iconbtn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--fc-text-2);
    border-radius: 10px;
    text-decoration: none;
}

.fc-shell .fc-iconbtn:hover { background: var(--fc-bg-3); color: var(--fc-text); }

/* --- Footer --------------------------------------------------------------- */
.fc-foot { border-top: 1px solid var(--fc-line); margin-top: 96px; }
.fc-foot__row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 0 40px; color: var(--fc-muted); font-size: 14px; }
.fc-foot__row nav { display: flex; gap: 24px; flex-wrap: wrap; }
.fc-shell .fc-foot__row a { color: var(--fc-text-2); text-decoration: none; }
.fc-shell .fc-foot__row a:hover { color: var(--fc-text); }

/* --- Editor window (the code half of every stage) ------------------------ */
.fc-editor {
    position: relative;
    background: var(--fc-panel);
    border: 1px solid var(--fc-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
}

.fc-editor__tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 8px 0 10px;
    height: 44px;
    border-bottom: 1px solid var(--fc-line);
    background: var(--fc-bg-2);
}

.fc-dots { display: flex; gap: 7px; margin-right: 14px; }
.fc-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--fc-line-2); }

.fc-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--fc-muted);
    padding: 0 14px;
    height: 44px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-tab.is-on { color: var(--fc-text); border-bottom-color: var(--fc-violet-2); }
.fc-tab svg { width: 14px; height: 14px; color: var(--fc-tk-dir); flex: none; }
.fc-editor__tabs .fc-copy { margin-left: auto; }

.fc-editor__status {
    display: flex;
    gap: 18px;
    align-items: center;
    height: 34px;
    padding: 0 16px;
    border-top: 1px solid var(--fc-line);
    background: var(--fc-bg-2);
    font-family: var(--fc-mono);
    font-size: 11.5px;
    color: var(--fc-muted);
}

.fc-live { display: flex; align-items: center; gap: 7px; color: var(--fc-text-2); }
.fc-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--fc-yellow); }
.fc-live.is-done i { background: var(--fc-mint); }
.fc-editor__status .fc-sp { flex: 1; }

/* --- Copy button ---------------------------------------------------------- */
.fc-copy {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--fc-muted);
    cursor: pointer;
    transition: color .2s, background .2s;
}

.fc-copy:hover { color: var(--fc-text); background: var(--fc-bg-3); }
.fc-copy.is-done { color: var(--fc-mint); }

/* --- Docs code block ------------------------------------------------------ */
.fc-block { margin: 0 0 22px; border: 1px solid var(--fc-line); border-radius: 14px; background: var(--fc-panel); overflow: hidden; }

.fc-block__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 6px 0 16px;
    border-bottom: 1px solid var(--fc-line);
    background: var(--fc-bg-2);
    font-family: var(--fc-mono);
    font-size: 11.5px;
    color: var(--fc-muted);
}

.fc-block .fc-code { padding: 14px 0; font-size: 13px; }
.fc-block .fc-code .cl { padding: 0 18px 0 calc(18px + (var(--ind, 0) + 4) * 1ch); text-indent: calc((var(--ind, 0) + 4) * -1ch); }
.fc-block .fc-code .cl::before { display: none; }

/* --- Side lists (demos and docs) ------------------------------------------ */
.fc-side { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; scrollbar-width: thin; padding-bottom: 24px; }
.fc-side__group { margin-bottom: 22px; }
.fc-side__label { font-size: 12.5px; font-weight: 600; color: var(--fc-muted); margin: 0 0 6px 12px; display: flex; gap: 8px; align-items: center; }

.fc-shell .fc-side a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 8px;
    color: var(--fc-text-2);
    text-decoration: none;
    font-size: 14.5px;
    line-height: 1.35;
}

.fc-shell .fc-side a:hover { color: var(--fc-text); background: var(--fc-bg-2); }
.fc-shell .fc-side a.active, .fc-shell .fc-side a[aria-current="page"] { color: var(--fc-text); background: var(--fc-bg-3); font-weight: 600; }
.fc-side a.active::after, .fc-side a[aria-current="page"]::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--fc-violet-2); flex: none; }
.fc-side__select { display: none; }

.fc-select {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--fc-line-2);
    background: var(--fc-bg-2);
    color: var(--fc-text);
    font: inherit;
    padding: 0 12px;
}

/* Level dots: filled = level reached. */
.fc-lv { display: inline-flex; gap: 3px; }
.fc-lv i { width: 6px; height: 6px; border-radius: 50%; background: var(--fc-line-2); }
.fc-lv i.is-on { background: var(--fc-mint); }

.fc-badge-start { font-size: 11px; font-weight: 600; background: var(--fc-mint); color: #062116; padding: 1px 7px; border-radius: 999px; }

/* --- Command palette (Cmd/Ctrl+K) ---------------------------------------- */
.fc-palette {
    width: min(640px, calc(100vw - 2rem));
    max-height: min(560px, calc(100vh - 8rem));
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    background: var(--fc-panel);
    color: var(--fc-text);
    border: 1px solid var(--fc-line-2);
    border-radius: 18px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .8);
    overflow: hidden;
    font-family: var(--fc-body);
}

.fc-palette__search { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--fc-line); flex-shrink: 0; }
.fc-palette__search-icon { color: var(--fc-muted) !important; flex-shrink: 0; }
.fc-palette__input { flex: 1; border: none; outline: none; background: transparent; font: inherit; font-size: 1rem; color: var(--fc-text); min-width: 0; }
.fc-palette__input::placeholder { color: var(--fc-muted); }
.fc-palette__results { overflow-y: auto; padding: 8px; flex: 1; }
.fc-palette__group-label { font-size: 12.5px; font-weight: 600; color: var(--fc-muted); padding: 10px 10px 4px; }

.fc-palette__row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--fc-text-2);
}

.fc-palette__row.is-selected { background: var(--fc-bg-3); color: var(--fc-text); }
.fc-palette__row-icon { color: var(--fc-muted) !important; flex-shrink: 0; }
.fc-palette__row.is-selected .fc-palette__row-icon { color: var(--fc-violet-2) !important; }
.fc-palette__row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fc-palette__row-title { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.fc-palette__row-desc { font-size: 12.5px; color: var(--fc-muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-palette__row-level { font-size: 12px; color: var(--fc-muted); flex-shrink: 0; }
.fc-palette__empty { padding: 28px 16px; text-align: center; color: var(--fc-muted); font-size: 14px; margin: 0; line-height: 1.6; }
.fc-palette__empty .fc-mono { color: var(--fc-text); font-family: var(--fc-mono); }
.fc-palette__footer { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--fc-line); font-size: 12px; color: var(--fc-muted); flex-shrink: 0; }
.fc-palette__footer .fc-kbd { margin-right: 4px; }
.fc-palette__count { margin-left: auto; font-family: var(--fc-mono); }

@media (max-width: 600px) {
    .fc-palette { top: 4vh; max-height: calc(100vh - 6rem); }
    .fc-palette__footer span:not(.fc-palette__count) { display: none; }
}

/* --- Not found ------------------------------------------------------------ */
.fc-notfound { padding: clamp(72px, 12vw, 160px) 0 0; display: grid; gap: 20px; justify-items: start; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1180px) {
    .fc-search span, .fc-search .fc-kbd { display: none; }
    .fc-search { min-width: 0; width: 40px; padding: 0; justify-content: center; }
    .fc-nav__row { gap: 16px; }
}

@media (max-width: 900px) {
    .fc-nav__links a:not(.fc-nav__keep) { display: none; }
}

@media (max-width: 860px) {
    .fc-side { position: static; max-height: none; overflow: visible; padding: 0; }
    .fc-side__group, .fc-side__nav { display: none; }
    .fc-side__select { display: block; }
}

@media (max-width: 680px) {
    .fc-nav .fc-btn--sm, .fc-brand__version { display: none; }
    .fc-code { font-size: 12px; }
}

/* Short visible labels; the full name stays the accessible one. */
@media (max-width: 480px) {
    .fc-nav__row { gap: 10px; }
    .fc-adapter__opt { padding: 0 8px; }
    .fc-adapter__short { display: inline; }
    .fc-adapter__full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
