@import "~scss/_mixins";

.layoutPreviewWrapper {
    position: absolute; top: 0px; right: 100%; opacity: 0; transition-property: opacity; transition-duration: 0.1s;
	transition-timing-function: linear; height: 100vh; background-color: var(--color-bg-primary); text-align: center; overflow: hidden;
}

.layoutPreviewWrapper.in { opacity: 0; }
.layoutPreviewWrapper.in {
	.layoutPreview { opacity: 0; }
}

.layoutPreviewWrapper.in.show { opacity: 1; }
.layoutPreviewWrapper.in.show {
	.layoutPreview { opacity: 1; }
}

.layoutPreviewWrapper.out { opacity: 0; }
.layoutPreviewWrapper.out {
	.layoutPreview { opacity: 0; }
}

.layoutPreviewWrapper.in.show { opacity: 1; }
.layoutPreviewWrapper.in.show {
	.layoutPreview { opacity: 1; }
}

.layoutPreviewWrapper {
    .layoutPreview { 
		transition: all 0.3s ease-in-out; margin: 0px auto; padding-top: 128px; text-align: left; color: var(--color-text-tertiary); 
		transform-origin: 50% 50%; min-height: 100%;
	}
    .layoutPreview {
        .layoutHeader { margin-bottom: 44px; }
        .titleWrapper { margin-bottom: 8px; }
		.titleWrapper {
			.iconObject { display: inline-block; }
		}
        .title { @include text-title; @include text-overflow-nw; }
        .description { @include text-header3; font-weight: 400; margin-bottom: 10px; }

        .featured { display: flex; align-items: center; gap: 0px 8px; flex-wrap: wrap; }
        .featured {
            .featuredItem { display: flex; align-items: center; gap: 0px 8px; max-width: 220px; }
            .featuredItem {
                .label { @include text-overflow-nw; }
                .bullet { flex-shrink: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--color-text-tertiary); }
            }
            .featuredItem:last-child {
                .bullet { display: none; }
            }
        }
    }

    .layoutPreview.featuredRelationLayoutColumn {
        .featured { flex-direction: column; gap: 10px 0px; padding-top: 36px; }
        .featured {
            dl { width: 100%; display: flex; align-items: center; @include text-overflow-nw; }
            dt { width: 35%; }
			dt {
				.label { width: 100%; @include text-overflow-nw; }
			}

            dd { width: 65%; }
            dd {
                .item { height: 12px; border-radius: 2px; background: var(--color-shape-secondary); }
            }

            dl:nth-child(even) {
                dd {
                    .item { width: 50%; }
                }
            }
        }
    }

    .layoutPreview:not(.isTask) {
        .titleWrapper {
			> .icon { width: 96px; height: 96px; border-radius: 20px; background: var(--color-shape-tertiary) url('~img/icon/sidebar/preview/icon.svg') 50% 50% no-repeat; }
			> .icon, > .iconObject { margin: 0px 0px 20px 0px; }
		}
    }

    .layoutPreview.isTask {
        .titleWrapper { display: flex; align-items: center; justify-content: flex-start; gap: 0px 8px; }
        .titleWrapper > .icon { width: 30px; height: 30px; flex-shrink: 0; }
        .title { @include text-header1; }
    }

    .layoutPreview.align0 {
        .layoutHeader { text-align: left; }
        .featured { justify-content: flex-start; }
    }
    .layoutPreview.align1 {
        .layoutHeader { text-align: center; }
        .titleWrapper,
        .featured { justify-content: center; }
    }
    .layoutPreview.align2 {
        .layoutHeader { text-align: right; }
        .featured { justify-content: flex-end; }
		.titleWrapper { justify-content: flex-start; flex-direction: row-reverse; }
    }

    .layoutPreview.layoutFormatList {
        .layoutHeader { text-align: left; }
        .titleWrapper,
        .featured { justify-content: flex-start; }

        .titleWrapper { display: flex; align-items: center; justify-content: flex-start; gap: 0px 8px; }
        .titleWrapper > .icon { width: 32px; height: 32px; background: transparent url('~img/icon/sidebar/preview/iconList.svg'); margin-bottom: 0px; }
        .title { @include text-header1; }

        .listHeader { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px;  }
        .listHeader {
            .left { display: flex; align-items: center; gap: 0px 20px; }
            .left {
                .view { height: 12px; width: 64px; border-radius: 2px; background-color: var(--color-shape-secondary); }
            }
            .right { display: flex; align-items: center; gap: 0px 4px; }
            .right {
                .icon { width: 28px; height: 28px; background-size: 20px; background-position: 50% 50%; background-repeat: no-repeat; }
                .icon.search { background-image: url('~img/icon/dataview/button/search.svg'); }
                .icon.filter { background-image: url('~img/icon/dataview/button/filter0.svg'); }
                .icon.sort { background-image: url('~img/icon/dataview/button/sort0.svg'); }
                .icon.settings { background-image: url('~img/icon/dataview/button/settings.svg'); }

                .buttonPlug { width: 70px; height: 28px; border-radius: 6px; margin-left: 12px; background-color: var(--color-shape-secondary); }
            }
        }
    }

    .layoutPreview.layoutFormatList.defaultViewGrid {
        .listHeader { border-bottom: 1px solid var(--color-shape-secondary); margin-bottom: 39px; }
    }

    .layoutPreview.layoutFormatList.defaultViewList {
        .listHeader { border-bottom: 1px solid var(--color-shape-secondary); margin-bottom: 22px; }
    }

    .layoutPreview.layoutFormatList.defaultViewBoard {
        .listHeader { border-bottom: 1px solid var(--color-shape-secondary); margin-bottom: 14px; }
    }

    .layoutPreview.layoutFormatList.defaultViewGallery {
        .listHeader { margin-bottom: 2px; }
    }

    .layoutPreview.layoutFormatList.defaultViewCalendar {
        .listHeader { margin-bottom: 8px; }
    }

    .layoutPreview.isFile {
        .layoutHeader { margin-bottom: 16px; }
        .filePreview { width: 90px; height: 36px; background: var(--color-shape-secondary); border-radius: 6px; margin-bottom: 38px;}
    }
}
