@import '../../styles/z-index';

.CardDetail {
    .title {
        width: 100%;
        font-size: 32px;
        line-height: 40px;
    }

    .add-buttons {
        display: flex;
        flex-direction: column;
        min-height: 32px;
        color: rgba(var(--center-channel-color-rgb), 0.4);
        width: 100%;
        align-items: flex-start;

        .Button {
            display: none;
        }

        &:hover {
            .Button {
                display: flex;
            }
        }
    }

    .octo-propertylist {
        display: flex;
        flex-direction: column;
        width: 100%;
    }



    .octo-propertyvalue {
        font-size: 14px;
        padding: 4px 8px;
        min-height: 32px;
        display: flex;

        &:not(.URLProperty) {
            flex-wrap: wrap;
        }

        &.octo-propertyvalue--readonly {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        &:not(.octo-propertyvalue--readonly) {
            min-width: 180px;
            transition: background 100ms ease-out 0s;
            cursor: pointer;
            border-radius: 4px;

            &:hover {
                background-color: rgba(var(--center-channel-color-rgb), 0.08);
            }
        }

        .MenuWrapper {
            display: flex;
            align-items: center;
        }
    }

    .ValueSelector {
        padding: 4px 0;
        background-color: rgba(var(--center-channel-color-rgb), 0.08);
        width: auto;
    }

    .ValueSelector__menu {
        @include z-index(card-value-selector-menu);
        max-width: 100%;

        .value-menu-option {
            justify-content: space-between;
        }

        .label-container {
            max-width: 90%;
        }
    }

    .octo-propertyrow {
        max-width: 595px;
        display: flex;
        align-items: flex-start;
        margin: 6px 0;
        min-height: 32px;

        .Switch {
            margin-left: 8px;
            width: 40px;
            height: 24px;
            box-sizing: border-box;
            padding: 2px;

            .octo-switch-inner {
                width: 20px;
                height: 20px;
            }

            &.on {
                .octo-switch-inner {
                    transform: translateX(16px) translateY(0);
                }
            }
        }

        .Label {
            margin: 0 4px 0 0;
        }
    }

    .UserProperty {
        .react-select__value-container {
            padding: 0;
        }

        .react-select__control {
            margin-top: 0;
        }
    }

    .octo-propertyrow {
        .octo-propertyname {
            flex: 0 0 150px;
        }
    }

    .octo-propertyname {
        width: 150px;
        margin-right: 5px;
        color: rgba(var(--center-channel-color-rgb), 0.6);

        .Button {
            width: 100%;
            height: 100%;
            padding: 4px 8px;
            text-align: left;
            justify-content: unset;
        }

        &.add-property {
            margin: 8px 0 0;
            color: rgba(var(--center-channel-color-rgb), 0.4);
            position: relative;
        }
    }

    &.content-blocks {
        position: relative;

        &:hover,
        &:focus-within {
            .CardDetailContentsMenu {
                .Button {
                    opacity: 1;
                }
            }
        }

        .CardDetailContentsMenu {
            margin-left: 48px;

            .Button {
                opacity: 0;
                color: rgba(var(--center-channel-color-rgb), 0.6);
            }
        }
    }

    &.content.is-limited {
        flex: 1;
    }

    &__limited-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        font-size: 14px;
        position: relative;

        > :not(.CardDetail__limited-bg) {
            position: relative;
        }
    }

    &__limited-bg {
        filter: blur(12px);
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 100%;

        > svg {
            width: 100%;
            height: auto;

            > rect {
                fill: rgba(var(--center-channel-color-rgb));
            }
        }
    }

    &__limited-title {
        font-weight: bold;
        font-size: 22px;
        line-height: 28px;
    }

    &__limited-link {
        color: var(--link-color);
    }

    &__limited-button {
        margin-top: 24px;
    }
}
