@import "./ngbBibliographyPanel.variables.scss";

ngb-bibliography-panel {
    position: relative;
    display: block;
    padding: 5px;

    ngb-panel-error-list {
        .layout-padding,
        .layout-padding > * {
            padding: 0 !important;
        }

        md-list-item,
        md-list-item .md-list-item-inner {
            min-height: $summary-section-title-height;
            line-height: $summary-section-title-height;
            font-size: $font-size;
        }
    }

    a {
        margin: 0;
        display: inline-block;
        text-decoration: none;
        color: rgb(51, 103, 214);
        cursor: pointer;
    }

    .empty-container {
        font-size: $font-size;
        width: 100%;
        text-align: center;
        z-index: 0;
        padding-top: 10px;
        padding-bottom: 10px;

        .no-records-warning {
            color: $bibliography-warning-color;
        }
    }

    .publication-container {
        font-size: $font-size;

        &:not(:last-child) {
            margin: 10px 0;
            border-bottom: 1px solid #dddddd;
        }

        .publication-title,
        .publication-authors,
        .publication-source {
            margin: 5px 0;
        }

        .publication-authors,
        .publication-source {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;

            span {
                white-space: nowrap;

                &:not(:last-child):after {
                    content: ',';
                    margin-right: 5px;
                }
            }
        }
    }

    .summary-button {
        .md-button {
            height: $summary-section-title-height;
            min-height: $summary-section-title-height;
            display: flex;
            align-items: center;
            text-transform: none;
            font-size: $font-size;
            border-radius: 10px;
            margin: 0;
            padding: 0;

            background: transparent;

            &:not([disabled]) {
                color: rgb(51, 103, 214);
            }

            &:hover,
            &:visited,
            &:active,
            &:focus {
                background: transparent;
            }

            &:hover .button-text,
            &:hover .md-select-value > span:not(.md-select-icon) {
                text-decoration: underline;
            }

            md-select {
                margin: 0;

                .md-select-value {
                    font-size: $font-size;
                }

                .md-select-value .md-select-icon {
                    width: 14px;
                }
            }

            md-select[disabled] .md-select-value {
                background: none;
            }
        }
    }

    .ngb-bibliography-section {
        margin: 5px 0 15px;

        .ngb-bibliography-section-title {
            display: flex;
            flex-direction: row;
            align-items: center;
            line-height: $summary-section-title-height;

            .section-name {
                font-weight: bold;
                text-transform: uppercase;
                margin-right: 10px;
                line-height: 1;
            }
        }
    }

    .summary-container {
        margin: 5px 0;
        font-size: calc($font-size + 1px);

        p {
            margin: 0;
        }
    }

    .loading-indicator {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
    }

    .header-container {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }

    .search-publications-container {
        margin: 10px 0;
        width: 100%;

        .search-publications-input {
            background: #fafafa;
        }

        .md-errors-spacer {
            display: none;
        }
    }

    .search-input-clear-button {
        ng-md-icon {
            position: absolute;
            top: 9px;
            right: 8px;
            fill: rgba(0,0,0,0.54);
        }
    }

    .bibliography-gene-select {
        display: flex;

        md-input-container {
            margin: 10px 0;
        }
    }
}

.llm-model-select {
    md-select-menu:not(.md-overflow) md-content {
        padding: 0;

        md-option {
            height: $summary-option-size;
            min-height: $summary-option-size;
            line-height: $summary-option-size;
        }
    }
}

.bibliography-gene-select-container {
    md-select-menu:not(.md-overflow) md-content {
        padding: 0;
    }

    md-select-menu[multiple] md-option.md-checkbox-enabled {
        padding-left: 30px;
        padding-right: 4px;
    }

    md-select-menu[multiple] md-option.md-checkbox-enabled .md-container {
        width: 14px;
        height: 14px;
    }

    md-select-menu[multiple] md-option.md-checkbox-enabled .md-icon {
        width: 14px;
        height: 14px;
        border-width: 1px;
    }

    md-select-menu[multiple] md-option.md-checkbox-enabled[selected] .md-icon:after {
        left: 3.66667px;
        top: 0.22222px;
        width: 5.66667px;
        height: 10.33333px;
        border-width: 2px;
    }

    md-select-menu.md-default-theme md-content md-option[selected],
    md-select-menu md-content md-option[selected] {
        color: rgba(33,33,33,0.87);
    }

    md-option {
        padding: 0 14px 0 0;
        height: $summary-option-size;
    }
}
