:host {
    /* this is used for styling ibgib components for multi-view coordination, so
     * that ibgib views that are looking at the same ibgib can be visibly shown
     * as doing so. */
    --ibgib-color: #ff00dd;
    --ibgib-color-translucent: #ff00dd10;
    --tjp-color: #00ffae;
    --tjp-color-translucent: #00ffae10;
    overflow: auto;
    --close-tab-button-width: 20px;
}

/* Basic layout and styling for the project component */
#project-component {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* width: 100%; */
    height: 100%;
    box-sizing: border-box;
    /* Use consistent padding */
    padding: 1%;

    /* ibgib styling */
    border: var(--tjp-color) 5px solid;
    box-shadow: 0 0 10px var(--tjp-color);
    border-radius: 5px;

    /* Optional: If using flexbox to control vertical alignment */
    /* justify-content: center;  Align content vertically */


    #project-header {
        display: flex;
        flex-direction: row;
        height: 4%;

        #project-header-tabs {
            overflow-x: auto;
            width: 90%;
            /* scrollbar-color: rgba(16, 237, 35, 0.241) rgb(28, 109, 239); */
            scrollbar-width: thin;
            scrollbar-gutter: stable;
            margin-bottom: -1%;
            font-size: small;

            /* header tab "button" (span) that has a child span (close "X" button) */
            span:has(span) {
                padding-right: calc(var(--close-tab-button-width) * 1.35);
            }

        }

        button {
            width: auto;
            height: 100%;
            aspect-ratio: 1/1 !important;

            color: var(--tjp-color-contrast);
            border-color: var(--tjp-color-contrast);
            background-color: var(--tjp-color);


            /* display: flex;
            flex-direction: column;
            justify-content: center; */

            /* span {
                position: relative;
                bottom: 3px;
            } */
        }

        button:hover {
            border-width: 2px;
            background-color: var(--button-hover-background-color);
            color: var(--button-hover-text-color);
            border-color: var(--button-hover-border-color);
        }

        .close-tab-button {
            cursor: pointer;
            box-sizing: border-box;
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: rgba(255, 0, 0, 0.7);
            color: white;
            border: none;
            border-radius: 50%;
            width: var(--close-tab-button-width);
            height: 20px;
            font-size: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1;
            /* Ensure button is above content */
        }

        .close-tab-button:hover {
            border-width: 3px;
            background-color: #ff00cf;
            color: var(--button-hover-text-color) !important;
            border-color: var(--button-hover-border-color);
            border-style: solid;
        }

        /* Add back the relative container for the button and popover */
        .add-button-container,
        .ellipsis-button-container {
            background-color: transparent;
            /* position: relative;
            display: inline-block; */
        }

        /* Keep the styles for the popover options */
        .add-popover-option,
        .ellipsis-popover-option {
            padding: 8px 15px;
            margin-bottom: 2px;
            cursor: pointer;
            transition: background-color 0.2s ease;
            background-color: var(--tab-background-color);
            color: var(--tab-text-color);
        }

        /* Keep the styles for the popover options */
        .add-popover-option:hover,
        .ellipsis-popover-option:hover {
            /* color: var(--tjp-color-contrast, #f0f0f0); */
            color: contrast-color(var(--tjp-color, #f0f0f0));
            background-color: var(--tjp-color, #f0f0f0);
        }

        /* Use anchor() for positioning */
        .add-popover,
        .ellipsis-popover {
            /* bottom: anchor(top); */
            /* Position the bottom of the popover at the top of the anchor */
            /* left: anchor(left); */
            /* Align the left of the popover with the left of the anchor */
            flex-direction: column;
            margin: 0px;
            /* padding: 5px 0; */
            border-radius: var(--border-radius, 4px);
            background-color: var(--background-color, #fff);
            border: 1px solid var(--border-color, #ccc);
            box-shadow: var(--box-shadow, 0 2px 5px rgba(0, 0, 0, 0.2));
            z-index: 10;
            /* Ensure it appears above other content */
        }

        /* #project-name {
            font-weight: bold;
        }

        #project-description {
            white-space: pre-wrap;
            font-style: italic;
        }

        #project-description.collapsed {
            display: none;
        } */
    }

    #project-content {
        display: flex;
        flex-direction: column;
        height: 91%;
        /* flex-grow: 1; */
        overflow: auto;

        :only-child {
            height: 100%;
            width: 100%;
            box-sizing: border-box;
        }
    }

    #project-footer {
        height: 5%;

        #ibgib-lens-bar {
            height: 100%;
            box-sizing: border-box;
            display: flex;
            flex-direction: row;
            justify-content: space-evenly;
            align-items: stretch;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: none;

            /* I'm sharing panel tab buttons with this */
            .lens-button {
                /* display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: center; */
                margin: calc(var(--tab-border-width) + 2) !important;
                box-sizing: border-box;
                border: var(--tab-border-width) var(--tab-border-style) var(--tab-border-color) !important;
                border-radius: 25px;
                min-width: 25%;
                /* unset the transform inherited from panel tab buttons */
                transform: unset;
            }

        }
    }

}

/* ibgib-raw,
ibgib-text-editor {
} */
