@use "variables" as *;
@import "dotcms-theme/utils/theme-variables";
@import "dotcms-theme/utils/extends";
@import "mixins";

$device-list-item-height: 3.625rem;
$device-selector-grid-width: 31.49rem;
$device-list-item-media-height: 2.5rem;
$device-selector-height: 2.625rem;
$device-selector-name-margin: 0.375rem;

.dot-device-selector__panel {
    border-radius: $border-radius-md;
    border: 1px solid $color-palette-gray-300;
}

.dot-device-selector__header {
    display: flex;
    height: $device-selector-height;
    padding: $spacing-1 $spacing-3;
    justify-content: space-between;
    align-items: center;
    background: $color-palette-gray-200;
}

.dot-device-selector__header-title {
    font-size: $font-size-lmd;
    font-style: normal;
    line-height: 140%;
    color: $black;
}

.dot-device-selector__column {
    gap: $spacing-3;
    display: flex;
    flex-direction: column;
}

.device-list__button {
    all: unset;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: $spacing-1;
    color: $color-palette-gray-600;
    width: 100%;
}

.dot-device-selector__grid {
    display: grid;
    grid-template-columns: 1fr 0fr 1fr;
    width: $device-selector-grid-width;
    height: 22.75rem;
    overflow: auto;
}

.device-list {
    width: 100%;
    padding: $spacing-1 0;
    margin: 0;
    color: $color-palette-gray-600;
    overflow: auto;
}

.device-list-item {
    display: flex;
    list-style: none;
    height: $device-list-item-height;
    padding: $spacing-1 $spacing-3 $spacing-1 $spacing-3;
    gap: $spacing-1;
    cursor: pointer;

    &:hover {
        background-color: $color-palette-primary-100;
    }
}

.device-list-item__content {
    display: flex;
    flex-direction: column;
}

.device-list-item__dimensions {
    color: $color-palette-gray-600;
    font-size: $font-size-sm;
    font-weight: $font-weight-regular-bold;
}

.device-list-item__name {
    margin-bottom: $device-selector-name-margin;
    color: $black;
}

.device-list-item.device-list-item-media {
    height: $device-list-item-media-height;
}

.dot-device-selector__link--container {
    display: flex;
    cursor: pointer;
    flex-grow: 3;
    align-items: flex-end;
    justify-content: flex-end;
    gap: $spacing-3;
    a {
        text-decoration: underline;
    }
}

::ng-deep {
    .p-overlaypanel.dot-device-selector__overlayPanel {
        .p-overlaypanel-content {
            display: flex;
            gap: $spacing-3;
        }

        border-radius: $border-radius-md;
        margin-top: $spacing-3;
    }

    .dot-device-selector__divider {
        margin: 0;
        color: $color-palette-gray-300;
    }

    .dot-device-selector__link--container {
        .pi.pi-external-link {
            color: $color-palette-primary;
        }
    }

    .p-divider {
        &.p-component {
            color: $color-palette-gray-300;
            margin: 0;
        }
    }
}

.dot-device-selector-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    background-color: transparent;
}
