@import './theme.scss';

.c-portfolio-holdings-table {
    &--data {
        min-height: v-space(100);
    }

    &__table {
        position: relative;
        width: 100%;
        overflow-x: scroll;

        &--overlay-showing {
            min-height: v-space(60);
        }

        &--empty {
            cursor: default;
        }
    }

    &__table-row {
        transition: all $animation-duration;
        border-top: 0.1rem solid $grey-92;
        pointer-events: all;
        cursor: unset;

        width: $container-max-width;
        @media screen and (max-width: $screen-small) {
            width: $row-max-width-mobile;
        }

        &:first-of-type {
            border-top: 0.1rem solid transparent;
        }
        &:last-of-type {
            border-bottom: 0.1rem solid $grey-92;
        }

        // TODO: Uncomment when the feature is fixed
        // &--isExpandable {
        //     cursor: pointer;
        //     &:hover {
        //         border-top: 0.1rem solid $seafoam-20;

        //         & + li {
        //             border-top: 0.1rem solid $seafoam-20;
        //         }
        //     }
        //     & * {
        //         pointer-events: all;
        //     }
        // }

        &--isCollapsed {
            height: v-space(8);
        }

        &--empty {
            pointer-events: none;
            cursor: default;
        }
    }

    &__table-row-header {
        transition: all $animation-duration;
        cursor: default;
    }

    &__table-header {
        width: $container-max-width;
        padding-left: $container-padding-h;

        $securities: stock, bond, option, cash;
        @each $security in $securities {
            &--#{$security} {
                @extend %portfolio-holdings-#{$security}-grid;
            }

            &--#{$security}.c-portfolio-holdings-table__table-header--public {
                @extend %portfolio-holdings-#{$security}-grid--public;
            }
        }

        @media screen and (max-width: $screen-small) {
            padding-left: $container-padding-mobile;
            width: $row-max-width-mobile;
        }

        &--public {
            @media screen and (max-width: $screen-small) {
                width: $container-max-width-mobile;
                padding-right: v-space(2);
            }
        }

        &--cash {
            @media screen and (max-width: $screen-medium) {
                width: $row-max-width-mobile-cash;
                padding-right: v-space(2);
            }
        }

        &--option {
            @media screen and (max-width: $screen-medium) {
                width: $row-max-width-mobile-option;
            }
        }
    }

    &__pagination {
        padding: 0 var(--container-padding-h) var(--container-padding-v);
    }
}
