﻿.fx-prototype {
    display: grid;
    grid-template-rows: auto auto 1fr; /* header + scrollable content */
    height: 100vh;
    min-height: 0; /* allow inner scrolling */
    box-sizing: border-box;
    max-width: 1250px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--nx-space-small);
    padding-right: var(--nx-space-small);
}

.fx-prototype-header {
    display: flex;
    align-items: center;
    gap: var(--nx-space);
    padding: var(--nx-space-small) var(--nx-space);
    border-bottom: var(--nx-border-width) solid var(--nx-border-color);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nx-secondary-bg);
    min-height: 30px;
    margin-bottom: var(--nx-space);
    flex-wrap: nowrap;
}

.fx-prototype-title {
    display: flex;
    gap: var(--nx-space-small);
    color: inherit;
    align-items: flex-end;
    flex-wrap: wrap;
    font-weight: 600;
}

.fx-prototype-menu {
    flex-wrap: wrap;
    width: auto;
    flex: 1;
    align-items: flex-end;
}

    .fx-prototype-menu * {
        margin: 0;
    }

    .fx-prototype-menu > .nx-input {
        max-width: 100px;
    }

.fx-prototype-closebutton {
    background: none;
    border: none;
    box-shadow: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    display: inline-flex;
    align-items: center;
}

    .fx-prototype-closebutton:hover {
        color: var(--nx-negative-fg);
    }

.fx-prototype-header-left {
    display: flex;
    align-items: center;
    gap: var(--nx-space-small);
    min-width: 0;
    flex: 0 0 auto;
}

.fx-prototype-tab-controlbox {
    display: flex;
    align-items: flex-end;
    min-width: 0;
    flex: 0 0 auto;
}

    .fx-prototype-tab-controlbox .nx-btn {
        margin: 0px;
    }

.fx-prototype-header-spacer {
    flex: 1 1 auto;
    min-width: 1rem;
}


.fx-prototype-tabs {
    display: flex;
    align-items: flex-end;
    min-width: 0;
    flex: 0 1 auto; /*Don't touch this*/
    white-space: nowrap;
    overflow: visible;
    position: relative;
}

.fx-prototype-tabs > .fx-prototype-tab {
    flex: 0 0 auto;
}

.fx-prototype-tabs-dropdown {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
}

.fx-prototype-tabs-dropdown-button {
    min-width: 3rem;
}

.fx-prototype-tabs-backdrop {
    position: fixed;
    inset: 0;
    z-index: 998;
    background: transparent;
    border: none;
    padding: 0;
}

.fx-prototype-tabs-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 999;
    min-width: 12rem;
    background: var(--nx-tertiary-bg);
    border: var(--nx-border-width) solid var(--nx-border-color);
    border-radius: var(--nx-border-radius);
    box-shadow: var(--nx-box-shadow);
    padding: var(--nx-space-small);
    display: flex;
    flex-direction: column;
    gap: var(--nx-space-small);
}

.fx-prototype-tabs-menuitem {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--nx-primary-fg);
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    margin-right: 0;
    border-radius: var(--nx-border-radius);
    cursor: pointer;
}

    .fx-prototype-tabs-menuitem:hover:not(.fx-prototype-tab-disabled) {
        background: var(--nx-muted-bg);
    }

.fx-prototype-tabs-menuitem-active {
    background: var(--nx-highlight-bg);
    color: var(--nx-highlight-fg);
}

.fx-prototype-header-title {
    display: flex;
    align-items: center;
    gap: var(--nx-space-small);
    flex: 0 0 auto;
    white-space: nowrap;
    margin-left: auto;
}

.fx-prototype-scroll {
    overflow: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    background: transparent;
    box-sizing: border-box;
    width: 100%;
    padding: 0.1rem;
}

.fx-prototype-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.fx-prototype-footer {
    display: flex;
    align-items: center;
    gap: var(--nx-space);
    padding: var(--nx-space-small) var(--nx-space);
    border-top: var(--nx-border-width) solid var(--nx-border-color);
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--nx-secondary-bg);
    min-height: 30px;
    flex-direction: row-reverse;
}

/* Prototype tab styling duplicated from FxTabContainer */
.fx-prototype-tab {
    position: relative;
    padding: 0.5rem 1.75rem;
    border: none;
    background: var(--nx-primary-bg);
    color: var(--nx-primary-fg);
    cursor: pointer;
    font-family: var(--nx-font);
    font-size: 0.85rem;
    font-weight: 500;
    clip-path: polygon(15px 0, 100% 0, calc(100% - 15px) 100%, 0% 100%);
    margin-left: -15px;
    margin-bottom: 0px;
    z-index: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

    .fx-prototype-tab:hover:not(.fx-prototype-tab-active):not(.fx-prototype-tab-disabled) {
        background: var(--nx-muted-bg);
    }

    .fx-prototype-tab.fx-prototype-tab-active {
        background: var(--nx-highlight-bg);
        color: var(--nx-highlight-fg);
        z-index: 1;
        font-weight: 600;
    }

    .fx-prototype-tab.fx-prototype-tab-disabled {
        background: var(--nx-muted-bg);
        color: var(--nx-muted-fg);
        cursor: not-allowed;
        opacity: 0.6;
    }

        .fx-prototype-tab.fx-prototype-tab-disabled:hover {
            background: var(--nx-muted-bg);
        }

.fx-prototype-tabs-wrap {
    position: relative;
    min-width: 0;
    flex: 0 1 auto;
}

.fx-prototype-tabs-measure {
    position: absolute;
    left: 0;
    top: 0;
    visibility: hidden;
    pointer-events: none;
    white-space: nowrap;
    display: flex;
    width: max-content;
    height: auto;
    overflow: hidden;
}
