.EezStudio_HomeTab {
    display: flex;
    flex-direction: column;
    overflow: hidden;

    .EezStudio_HomeTab_Header {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid @borderColor;

        .EezStudio_HomeTab_Tabs {
            display: flex;
            align-items: center;

            button {
                margin-right: 10px;
            }
        }

        .EezStudio_HomeTab_Navigation {
            flex: 1;

            display: flex;
            justify-content: center;
            padding: 10px;

            .EezStudio_HomeTab_NavigationItem {
                display: inline-flex;
                flex-direction: column;
                align-items: center;

                &:not(.selected) {
                    cursor: pointer;
                    &:hover {
                        border-bottom: 4px solid @borderColor;
                    }
                }
                text-transform: uppercase;
                font-size: 150%;
                margin: 0 30px;
                padding: 0px 10px;
                &.selected {
                    border-bottom: 4px solid @selectionBackgroundColor;
                }

                .badge {
                    margin-left: 10px;
                    transform: translateY(-2px);
                }

                .EezStudio_AttentionDiv {
                    bottom: 12px;
                    right: -4px;
                }

                .EezStudio_AttentionContainer {
                    width: 32px;
                    height: 32px;
                    .EezStudio_AttentionDiv {
                        bottom: 2px;
                    }
                }
            }
        }
    }

    .EezStudio_HomeTab_Body {
        display: flex;
        flex: 1;
        overflow: hidden;
    }
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// OPEN PROJECT

.EezStudio_HomeTab_Projects {
    flex: 1;
    display: flex;
    flex-direction: column;

    .sort-button {
        padding: 5px;
        background-color: field;
    }

    .EezStudio_HomeTab_Projects_Header {
        display: flex;
        align-items: center;
        width: 720px;
        margin: 0 auto;

        .EezStudio_SearchInput_Container {
            margin: 10px auto;
            max-width: 360px;
            border: 1px solid @borderColor;
            border-radius: 18px;
            padding: 5px 10px;
            font-size: 120%;
            /*
                box-shadow: 0 2px 5px 1px @borderColor;
                &:hover {
                    box-shadow: 0 2px 8px 1px @borderColor;
                }
                */
        }
    }

    .EezStudio_HomeTab_Projects_Body {
        flex: 1;
        justify-content: center;
        align-items: start;
        display: flex;
        overflow: hidden;
        position: relative;

        margin-bottom: 10px;

        & > div {
            margin: 0 10px;
            box-sizing: border-box;
            border: 1px solid @borderColor;
            border-radius: 10px;
            padding: 10px;
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 100%;
        }

        .EezStudio_HomeTab_Projects_Space {
            flex: 1;
            max-width: 240px;
            margin: 0;
            border: none;
        }

        .EezStudio_HomeTab_Projects_Actions {
            flex: 1;
            max-width: 240px;

            border: none;

            height: fit-content !important;
        }

        .EezStudio_ListContainer {
            flex: 3;
            max-width: 720px;

            padding: 0;

            .EezStudio_List {
                padding: 10px;

                .EezStudio_ListItem {
                    margin-bottom: 10px;
                    position: relative;
                    padding: 2px 2px 2px 3px;

                    img {
                        background-color: white;
                        border-radius: 6px;
                    }

                    .EezStudio_HomeTab_ProjectItem {
                        display: flex;
                        flex-direction: column;

                        div.project-name {
                            font-size: 110%;
                            overflow: hidden;
                            white-space: nowrap;
                            text-overflow: ellipsis;
                        }

                        div.project-folder {
                            white-space: normal;
                            font-size: 90%;
                        }
                    }
                }

                .EezStudio_ListItem:last-child {
                    margin-bottom: 0;
                }
            }
        }

        .EezStudio_HomeTab_Projects_ProjectInfo {
            flex: 2;
            max-width: 480px;
            min-height: 200px;

            overflow-y: auto;
            overflow-x: hidden;

            border: none;

            .EezStudio_HomeTab_Projects_ProjectInfo_Actions {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                margin-left: 80px;

                & > button {
                    min-width: 160px;
                    margin-bottom: 10px;
                }
            }
        }
    }
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// CREATE PROJECT AND EXAMPLES

.EezStudio_NewProjectWizard {
    flex: 1;
    display: flex;
    flex-direction: column;

    a {
        color: @textColor;
    }
    .selected {
        a {
            color: @selectionColor;
        }
    }

    &.disabled {
        pointer-events: none;
    }

    .EezStudio_NewProjectWizard_StaticField {
        border: var(--bs-border-width) solid var(--bs-border-color);
        border-radius: var(--bs-border-radius);
        padding: 0.375rem 0.75rem;
        background-color: @panelHeaderColor;
        overflow: auto;
    }

    .EezStudio_SearchInput_Container {
        flex: 0;
        margin: 10px auto;
        width: 360px;
        border: 1px solid @borderColor;
        border-radius: 18px;
        padding: 5px 10px;
        font-size: 120%;
        /*
        box-shadow: 0 2px 5px 1px @borderColor;
        &:hover {
            box-shadow: 0 2px 8px 1px @borderColor;
        }
        */
    }

    .EezStudio_NewProjectWizard_Body {
        flex: 1;
        justify-content: center;
        align-items: start;
        display: flex;
        overflow: hidden;
        position: relative;

        margin-bottom: 10px;

        .EezStudio_NewProjectWizard_NoProjects {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 150%;
            border: 0;
        }

        & > div {
            margin: 0 10px;
            box-sizing: border-box;
            border: 1px solid @borderColor;
            border-radius: 10px;
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 100%;
        }

        .EezStudio_NewProjectWizard_Space {
            flex: 1;
            max-width: 240px;
            margin: 0;
            border: none;
        }

        .EezStudio_SimpleTree {
            flex: 1;
            max-width: 240px;

            height: fit-content !important;

            .EezStudio_TreeRow {
                width: 100%;
                height: 24px;

                .EezStudio_TreeRowLabel,
                .EezStudio_TreeRowLabel_Triangle {
                    width: 100%;
                    display: inline-flex;
                    align-items: center;

                    width: 100%;

                    justify-content: space-between;

                    .badge {
                        margin-left: 5px;
                        margin-right: 5px;
                    }

                    .EezStudio_AttentionDiv {
                        bottom: 6px;
                        right: -6px;
                    }
                }
            }
        }

        .EezStudio_NewProjectWizard_ProjectTypes {
            flex: 3;
            max-width: 720px;

            display: flex;
            flex-direction: column;

            .EezStudio_NewProjectWizard_ProjectType {
                display: flex;
                margin-bottom: 10px;
                &:last-child {
                    margin-bottom: 0;
                }
                padding: 10px;
                border-bottom: 1px solid @borderColor;
                &:last-child {
                    border-bottom: none;
                }

                &.selected {
                    color: @selectionColor;
                    background-color: @selectionBackgroundColor;
                    border-bottom: 1px solid transparent;
                    .EezStudio_NewProjectWizard_ProjectType_Image.imageZoomEnabled {
                        > img,
                        & > svg {
                            cursor: zoom-in;
                        }
                    }
                }

                &:hover:not(.selected) {
                    color: @hoverColor;
                    background-color: @hoverBackgroundColor;
                }

                .EezStudio_NewProjectWizard_ProjectType_Image {
                    padding: 5px;
                    color: #333;
                    border-radius: 4px;
                    background-color: white;
                    margin-right: 5px;
                    align-self: flex-start;

                    > img,
                    & > svg {
                        /*object-fit: cover !important;*/
                        width: 160px !important;
                        height: 90px !important;
                    }
                }

                .EezStudio_NewProjectWizard_ProjectType_Details {
                    flex: 1;

                    .EezStudio_NewProjectWizard_ProjectType_Details_Title {
                        display: flex;
                        justify-content: space-between;
                        h6 {
                            margin-bottom: 0;
                        }
                    }

                    .EezStudio_NewProjectWizard_ProjectType_Details_Keywords {
                        span.badge {
                            margin-right: 5px;
                            font-size: 0.8em;
                            &:last-child {
                                margin-right: 0;
                            }
                        }
                    }

                    .EezStudio_NewProjectWizard_ProjectType_Details_Description {
                        margin-top: 10px;
                        opacity: 75%;
                    }

                    .EezStudio_NewProjectWizard_ProjectType_Details_InfoList {
                        margin-top: 10px;
                        .lighter {
                            opacity: 75%;
                        }
                        .bolder {
                            font-weight: bold;
                        }
                    }
                }
            }
        }

        .EezStudio_NewProjectWizard_ProjectProperties {
            flex: 2;
            max-width: 480px;
            min-height: 200px;

            overflow-y: auto;
            overflow-x: hidden;

            .EezStudio_NewProjectWizard_ProjectProperties_Section {
                position: relative;

                h6 {
                    background-color: @panelHeaderColor;
                    padding: 5px 10px;
                    text-transform: uppercase;
                    margin: 0;
                }

                & > div {
                    padding: 10px;
                }

                .markdown {
                    p {
                        line-height: 1.2;
                    }
                    & > p:last-child {
                        margin-bottom: 0;
                    }
                }
            }
        }
    }

    .EezStudio_NewProjectWizard_CreationStatus {
        margin-top: 10px;
    }

    .EezStudio_NewProjectWizard_CreateProjectProgress {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;

        background-color: @backgroundColor;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        .EezStudio_Loader {
            margin: 0;
        }

        & > * {
            margin: 20px;
        }
    }
}

.EezStudio_NewProjectWizard_ProjectType_Image_Zoomed_Container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: zoom-out;
    z-index: 1002;

    .EezStudio_NewProjectWizard_ProjectType_Image_Zoomed_Backface {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;

        background-color: #333;
        opacity: 80%;
    }

    .EezStudio_NewProjectWizard_ProjectType_Image_Zoomed_Image {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;

        display: flex;
        align-items: center;
        justify-content: center;

        > img,
        & > svg {
            background-color: white;
            position: absolute;
            width: auto !important;
            height: auto !important;
        }
    }
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// INSTRUMENTS

.EezStudio_HomeTab_Instruments {
    flex-grow: 1;
    display: flex;
    flex-direction: column;

    .EezStudio_HomeTab_Instruments_Header {
        .EezStudio_SearchInput_Container {
            flex: 0;
            margin: 10px auto;
            margin-bottom: 0;
            width: 360px;
            border: 1px solid @borderColor;
            border-radius: 18px;
            padding: 5px 10px;
            font-size: 120%;
            /*
            box-shadow: 0 2px 5px 1px @borderColor;
            &:hover {
                box-shadow: 0 2px 8px 1px @borderColor;
            }
            */
        }

        .EezStudio_ToolbarHeader {
            background-color: transparent;
            align-items: stretch;
            justify-content: center;
            padding: 10px;
            padding-bottom: 0;
            border: none;

            div {
                flex-grow: 1;
                display: flex;
                justify-content: flex-end;

                button {
                    margin-right: 10px;
                }

                button:last-child {
                    margin-right: 0;
                }
            }
        }
    }

    .EezStudio_HomeTab_Instruments_Body {
        flex: 1;
        justify-content: center;
        align-items: start;
        display: flex;
        overflow: hidden;
        position: relative;

        & > div {
            border: 1px solid @borderColor;
            border-radius: 10px;
            margin: 10px;
            &:last-child {
                margin-left: 0;
            }
        }

        .EezStudio_Instruments {
            flex: 1;
            height: calc(100% - 20px);
            overflow: auto;

            display: flex;
            flex-wrap: wrap;
            align-items: start;
            align-content: flex-start;

            &.EezStudio_Instruments_Size_S {
                .EezStudio_InstrumentComponentEnclosure {
                    width: 120px;
                    padding: 8px;
                    margin: 8px;

                    .EezStudio_InstrumentContent {
                        img {
                            width: 74px;
                            height: 74px;
                        }
                    }
                }

                .EezStudio_InstrumentLabel,
                .EezStudio_InstrumentConnectionState {
                    font-size: 90%;
                }

                .EezStudio_InstrumentConnectionState {
                    & > span:nth-child(1) {
                        width: 12px;
                        height: 12px;
                        border-radius: 6px;
                    }
                }
            }

            &.EezStudio_Instruments_Size_M {
                .EezStudio_InstrumentComponentEnclosure {
                    width: 180px;
                    padding: 12px;
                    margin: 12px;

                    .EezStudio_InstrumentContent {
                        img {
                            width: 156px;
                            height: 156px;
                        }
                    }
                }
            }

            &.EezStudio_Instruments_Size_L {
                .EezStudio_InstrumentComponentEnclosure {
                    width: 240px;
                    padding: 16px;
                    margin: 16px;

                    .EezStudio_InstrumentContent {
                        img {
                            width: 208px;
                            height: 208px;
                        }
                    }
                }
            }

            .EezStudio_InstrumentComponentEnclosure {
                .EezStudio_InstrumentContent {
                    width: 100%;
                    height: 100%;

                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;

                    text-align: center;

                    & > * {
                        flex-grow: 0;
                        flex-shrink: 0;
                        overflow-wrap: anywhere;
                    }

                    img {
                        display: block;
                        object-fit: contain;
                    }

                    .EezStudio_InstrumentLabel {
                        width: 100%;
                        white-space: nowrap;
                        overflow: hidden;
                        text-overflow: ellipsis;
                    }
                }

                &.selected {
                    background-color: @selectionBackgroundColor!important;
                    color: @selectionColor;
                }
            }
        }

        .EezStudio_HomeTab_Instruments_SelectedInstrument_Properties {
            flex: 0;
            min-width: 400px;

            display: flex;
            flex-direction: column;
            position: relative;

            height: calc(100% - 20px);
            overflow-y: auto;
            overflow-x: hidden;

            .EezStudio_HomeTab_Instruments_SelectedInstrument_Properties_Section {
                position: relative;

                h6 {
                    background-color: @panelHeaderColor;
                    padding: 5px 10px;
                    text-transform: uppercase;
                    margin: 0;
                }
            }

            .EezStudio_InstrumentToolbarEnclosure,
            .EezStudio_InstrumentPropertiesEnclosure,
            .EezStudio_InstrumentConnectionEnclosure {
                padding: 8px;
            }

            .EezStudio_PropertyList {
                max-width: 380px;

                .PropertyName {
                    width: 80px;
                    font-style: italic;
                }

                .StaticPropertyValue {
                    max-width: 290px;
                }
            }
        }
    }
}

.EezStudio_SelectInstrumentDialog_ConnectContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;

    & > h5 {
        margin-bottom: 20px;
    }
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// EXTENSIONS

.EezStudio_ExtensionsManager {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;

    .EezStudio_ExtensionsManager_Navigation {
        flex: 0;

        display: flex;
        justify-content: center;

        margin-bottom: 10px;

        padding: 10px;

        .EezStudio_ExtensionsManager_NavigationItem {
            &:not(.selected) {
                cursor: pointer;
                &:hover {
                    border-bottom: 4px solid @borderColor;
                }
            }
            text-transform: uppercase;
            font-size: 175%;
            margin: 0 30px;
            padding: 0px 10px;
            &.selected {
                border-bottom: 4px solid @selectionBackgroundColor;
            }

            .badge {
                margin-left: 10px;
                transform: translateY(-2px);
            }

            .EezStudio_AttentionDiv {
                bottom: unset;
                top: 2px;
                right: -8px;
            }
        }
    }

    .EezStudio_SearchInput_Container {
        flex: 0;
        margin: 10px auto;
        width: 360px;
        border: 1px solid @borderColor;
        border-radius: 18px;
        padding: 5px 10px;
        font-size: 120%;
        /*
        box-shadow: 0 2px 5px 1px @borderColor;
        &:hover {
            box-shadow: 0 2px 8px 1px @borderColor;
        }
        */
    }

    .EezStudio_ExtensionsManager_Body {
        flex: 1;
        justify-content: center;
        align-items: start;
        display: flex;
        overflow: hidden;
        position: relative;

        margin-bottom: 10px;

        .EezStudio_ExtensionsManager_NoExtensions {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 150%;
            border: 0;
        }

        & > div {
            margin: 0 10px;
            box-sizing: border-box;
            border: 1px solid @borderColor;
            border-radius: 10px;
            padding: 10px;
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 100%;
        }

        .EezStudio_ExtensionsManager_SubNavigation {
            flex: 1;
            flex-basis: 240px;
            max-width: 240px;

            padding: 10px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            > div:nth-child(1) {
                width: 140px;
            }

            .EezStudio_ExtensionsManager_ViewFilter {
                display: flex;

                font-size: 120%;

                & > .nav {
                    flex-grow: 0;
                    flex-shrink: 0;
                    padding: 4px;
                    width: 100%;

                    flex-direction: column;

                    & > .nav-item {
                        margin-bottom: 5px;
                    }

                    a {
                        display: flex;
                        justify-content: space-between;
                        width: 100%;
                        color: @textColor;
                        padding: 4px 8px;
                        &:hover:not(.active) {
                            background-color: @hoverBackgroundColor;
                        }
                        &.active {
                            color: @selectionColor;
                            background-color: @selectionBackgroundColor;
                        }

                        .EezStudio_AttentionContainer {
                            display: flex;
                            justify-content: space-between;
                            width: 100%;

                            .EezStudio_AttentionDiv {
                                bottom: unset;
                                top: 2px;
                                right: -2px;
                            }
                        }
                    }
                }

                & > div {
                    flex-grow: 1;
                    overflow: hidden;
                }
            }

            > div:nth-child(3) {
                margin-top: 5px;
                width: 100%;
                display: flex;
                justify-content: space-between;
                button {
                    margin-left: 4px;
                }
                .dropdown {
                    margin-right: 10px;
                }
            }

            .badge {
                min-width: 30px;
            }
        }

        .EezStudio_ExtensionsManager_MasterView {
            flex: 3;
            max-width: 720px;
            flex-basis: 720px;
            height: 100%;

            .EezStudio_ListItem {
                padding: 2px 2px 2px 4px;

                & > div:nth-child(2) {
                    white-space: unset;
                }
            }
        }

        .EezStudio_ExtensionsManager_DetailsView {
            flex: 3;
            max-width: 720px;
            min-height: 200px;
            flex-basis: 720px;

            .EezStudio_ExtensionsManager_DetailsView_Body {
                border-top: 1px solid @borderColor;
            }
        }
    }
}

.EezStudio_ExtensionsManager_SelectProjectExtensionDialog {
    width: 100%;
    height: 100%;
}

.EezStudio_ExtensionDetailsHeader {
    display: flex;
    flex-direction: row;
    padding: 10px;
    * {
        user-select: auto;
    }

    pre {
        font-family: inherit;
        font-size: 100%;
        white-space: pre-wrap;
    }
}

.EezStudio_ExtensionDetailsHeaderImageContainer {
    flex-grow: 0;
    flex-shrink: 0;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.EezStudio_ExtensionDetailsHeaderProperties {
    flex-grow: 1;
    flex-shrink: 0;
    width: 0;
}

.EezStudio_ExtensionDetailsHeaderPropertiesNameAndVersion {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// SETTINGS

.EezStudio_HomeSettingsBody {
    flex: 1;
    padding-top: 50px;
    padding-bottom: 100px;
    overflow: auto;
    .EezStudio_PropertyList {
        margin: auto;
        max-width: 640px;
    }
}

.EezStudio_HomeSettingsBar {
    position: absolute;
    bottom: 0;
    border: none !important;
    border-top: 1px solid @borderColor!important;
    justify-content: flex-end;
    padding: 6px;
}

.EezStudio_Settings_Databases {
    position: relative;
    width: 640px;
    height: 480px;
    border: 1px solid @borderColor;

    .EezStudio_Settings_Databases_List {
        .EezStudio_ToolbarHeader {
            background-color: @panelHeaderColor;
        }

        .EezStudio_Settings_Databases_List_Body {
            padding: 5px;
            overflow-x: hidden;
            overflow-y: auto;

            table {
                width: 100%;

                tbody > tr {
                    cursor: pointer;
                    font-size: 90%;

                    &.selected {
                        background-color: @selectionBackgroundColor;
                        color: @selectionColor;
                        .text-muted {
                            color: #ccc !important;
                        }
                        .EezStudio_Action {
                            color: white;
                        }
                        .EezStudio_Action:hover {
                            color: #aaa;
                        }
                    }

                    table {
                        width: 100%;
                    }

                    td {
                        position: relative;
                        padding: 2px 5px;
                    }

                    td:nth-child(1) {
                        width: 100%;
                    }

                    td:nth-child(2) {
                        white-space: nowrap;
                    }

                    .EezStudio_Icon {
                        visibility: hidden;
                    }

                    &:hover .EezStudio_Icon {
                        visibility: visible;
                    }
                }

                tbody > tr.session_free_mode {
                    td:nth-child(1) {
                        font-style: italic;
                        text-transform: uppercase;
                    }
                }
            }
        }
    }

    .EezStudio_Settings_Database_Details {
        padding: 10px;

        & > div {
            margin-bottom: 20px;
            &:last-child {
                margin-bottom: 0;
            }
        }

        .EezStudio_DatabaseCompactDiv {
            &.databaseCompactIsAdvisable {
                margin-top: 10px;
                border: 1px solid @borderColor;
                padding: 5px;
                background-color: @warningBackgroundColor;
                color: @warningColor;
            }

            & > div {
                margin-bottom: 5px;
            }
        }
    }
}

.EezStudio_ExportDialog {
    .modal-body {
        max-height: calc(100vh - 200px);
        overflow: auto;
    }

    .nav {
        margin-bottom: var(--bs-modal-padding);
    }

    .EezStudio_ListContainer {
        height: 240px;
        overflow-x: hidden;
        border-radius: 4px;
    }

    .EezStudio_ExportDialog_ArchiveMode {
        border: 1px solid @borderColor;
        padding: 10px;
        height: 240px;

        .EezStudio_ExportDialog_ArchiveOlderThen {
            margin-left: 10px;
            input {
                margin-top: 5px;
            }
        }

        .EezStudio_ExportDialog_RemoveHistoryAfterExport {
            margin-top: 20px;
        }
    }
}

.EezStudio_ImportDialog {
    .modal-body {
        & > div:nth-child(1) {
            margin-bottom: 5px;
        }
        & > div:nth-child(2) {
            border: 2px solid @borderColor;
            border-radius: 4px;
            padding: 10px;
            margin-bottom: 20px;
        }
        & > div:nth-child(3) {
            margin-bottom: 5px;
        }
        & > div:nth-child(4) {
            border: 1px solid @borderColor;
            border-radius: 4px;
            padding: 10px;
            min-height: 72px;
        }
    }
}
