@use "mixins";

/**
 * Copyright JS Foundation and other contributors, http://js.foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

 #red-ui-settings-tab-palette {
    height: 100%;
}

#red-ui-palette-editor {
    text-align: left;
    position: absolute;
    top: 0px;
    right: 0;
    bottom: 0;
    left:0;
    padding: 0;
    box-sizing:border-box;
    background: var(--red-ui-secondary-background);
    display: flex;
    flex-direction: column;

    .red-ui-tabs {
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .red-ui-editableList.scrollable {
        overflow-y: auto;
    }
    .red-ui-editableList-container {
        border: none;
        border-radius: 0;
        padding: 0px;


        li {
            // border: none;
            // border-top: 1px solid var(--red-ui-primary-border-color);
            padding: 0px;
            .red-ui-button {
                min-width: 60px;
            }

            .disabled {
                // background: var(--red-ui-secondary-background-inactive;//f3f3f3);

                .red-ui-palette-module-name {
                    font-style: italic;
                    color: var(--red-ui-tertiary-text-color);
                }
                .red-ui-palette-module-version {
                    color: var(--red-ui-tertiary-text-color);
                }
                .red-ui-palette-module-errors .fa-warning {
                    opacity: 0.5;
                }
                ul.red-ui-palette-module-error-list li {
                    color: var(--red-ui-tertiary-text-color);
                }


            }
            .red-ui-editableList-item-content {
                padding: 12px 16px;
            }
            &:last-child {
                // border-bottom: 1px solid var(--red-ui-primary-border-color);
            }
        }

    }
    .red-ui-palette-editor-tab {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .red-ui-palette-editor-toolbar {
        background: var(--red-ui-primary-background);
        box-sizing: border-box;
        padding: 8px 10px;
        border-bottom: 1px solid var(--red-ui-primary-border-color);
        text-align: right;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 3px 12px;
        .red-ui-palette-editor-toolbar-actions {
            flex-shrink: 0;
            flex-grow: 1;
        }
        .red-ui-palette-editor-catalogue-filter {
            width: unset;
            margin: 0;
            flex-shrink: 1;
            flex-grow: 1;
            font-size: 12px;
            height: 26px;
            padding: 1px;
        }
    }
    .red-ui-palette-module-shade-status {
        color: var(--red-ui-secondary-text-color);
    }
    .red-ui-palette-module-updated {
        margin-left: 10px;
    }
    .red-ui-palette-module-downloads {
        margin-left: 10px;
    }
    .red-ui-palette-module-link {
        margin-left: 5px;
    }

    .red-ui-palette-module-deprecated {
        cursor: pointer;
        color: var(--red-ui-text-color-error);
        font-size: 0.7em;
        border: 1px solid var(--red-ui-text-color-error);
        border-radius: 30px;
        padding: 2px 5px;
    }

    .red-ui-palette-module-description {
        margin-left: 20px;
        font-size: 0.9em;
        color: var(--red-ui-secondary-text-color);
    }
    .red-ui-palette-module-content {
        display: none;
        padding: 10px 3px;
    }
    i.fa.red-ui-palette-module-node-chevron {
        width: 8px;
        margin-right: 0;
        transform: rotate(0deg);
        transition: transform 0.2s ease-in-out;
    }
    .expanded {
        i.fa.red-ui-palette-module-node-chevron {
            transform: rotate(90deg);
        }
    }
    .red-ui-palette-module-set {
        border:1px solid var(--red-ui-secondary-border-color);
        border-radius: 0;
        padding: 5px;
        position: relative;
        &:not(:last-child) {
            border-bottom: none;
        }
        &:first-child {
            border-top-right-radius: 2px;
            border-top-left-radius: 2px;
        }
        &:last-child {
            border-bottom-right-radius: 2px;
            border-bottom-left-radius: 2px;
        }
    }

    .red-ui-palette-module-type {
        color: var(--red-ui-secondary-text-color);
        padding-left: 5px;
        font-size: 0.9em;
        @include mixins.enable-selection;
    }
    .red-ui-palette-module-type-swatch {
        display: inline-block;
        width: 12px;
        height: 12px;
        border-radius: 3px;
        vertical-align: middle;
        margin-right: 5px;
        background: var(--red-ui-primary-background);
        border: 1px dashed var(--red-ui-secondary-border-color);
    }
    .red-ui-palette-module-set-button-group {
        position: absolute;
        right: 4px;
        top: 4px;
    }

    .red-ui-palette-module-set-disabled {
        background: var(--red-ui-list-item-background-disabled);
        .red-ui-palette-module-type {
            color: var(--red-ui-secondary-text-color-disabled-active);
        }
    }
    .red-ui-palette-module-more {
        padding: 0 !important;
        margin-top: 10px;
        margin-bottom: 10px;
        background: var(--red-ui-tab-background-inactive);
        a {
            display: block;
            text-align: center;
            padding: 12px 8px;
            color: var(--red-ui-text-color-code);

            &:hover {
                text-decoration: none;
                background: var(--red-ui-tab-background-hover);
            }
        }
    }

}
.red-ui-palette-module-meta {
    color: var(--red-ui-secondary-text-color);
    position: relative;
    &.disabled {
        color: var(--red-ui-secondary-text-color-disabled);
    }

    .fa {
        width: 15px;
        text-align: center;
        margin-right: 5px;
    }
}
.red-ui-palette-module-name {
    color: var(--red-ui-primary-text-color);
    white-space: nowrap;
    @include mixins.enable-selection;
}
.red-ui-palette-module-version, .red-ui-palette-module-updated, .red-ui-palette-module-link, .red-ui-palette-module-downloads {
    font-style:italic;
    font-size: 0.8em;
    @include mixins.enable-selection;
}
.red-ui-palette-module-button-group {
    position: absolute;
    right: 0;
    bottom: 0;
    a {
        margin-left: 5px;
    }
}
.red-ui-palette-module-meta .fa-warning {
    color: var(--red-ui-text-color-warning);
}
ul.red-ui-palette-module-error-list {
    display: inline-block;
    list-style-type: none;
    margin: 0;
    font-size: 0.9em;
    li {
        border: none;
        background: none;
    }
}

.red-ui-palette-module-shade {
    @include mixins.shade;
    text-align: center;
    padding-top: 20px;
}
#red-ui-palette-module-install-shade {
    padding-top: 80px;
}
button.red-ui-palette-editor-upload-button {
    padding: 0;
    height: 25px;
    margin-top: -1px;

    input[type="file"] {
        opacity: 0;
        margin: 0;
        height: 0;
        width: 0;
    }
    .red-ui-settings-tabs-content & label {
        margin: 0;
        min-width: 0;
        padding: 2px 8px;
    }
    form {
        width: 0;
    }
}
.red-ui-palette-editor-upload {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 44px;
    padding: 20px;
    background: var(--red-ui-secondary-background);
    border-bottom: 1px var(--red-ui-secondary-border-color solid);
    box-shadow: 1px 1px 4px var(--red-ui-shadow);

    .placeholder-input {
        width: calc(100% - 180px);
        margin: 0;
    }
}
.red-ui-palette-editor-upload-buttons {
    float: right;
    button {
        margin-left: 10px;
    }
}

button.red-ui-update-status {
    width: auto;
    padding: 0 3px;
}
