/* نگارخانه - استایل پیش‌نمایش کارت */

.cg-viewport {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    overflow: auto;
    border-radius: 8px;
    background-color: #e8eaf0;
    background-image:
        linear-gradient(45deg, #dfe2ea 25%, transparent 25%),
        linear-gradient(-45deg, #dfe2ea 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #dfe2ea 75%),
        linear-gradient(-45deg, transparent 75%, #dfe2ea 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.cg-card {
    position: relative;
    direction: ltr;
    overflow: hidden;
    box-sizing: border-box;
    flex: 0 0 auto;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    user-select: none;
}

.cg-card .cg-pattern {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cg-card .cg-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.cg-el {
    position: absolute;
    box-sizing: border-box;
    overflow: hidden;
}

.cg-editable .cg-el {
    cursor: move;
    touch-action: none;
}

.cg-text {
    display: flex;
    direction: rtl;
    line-height: 1.35;
}

.cg-textspan {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}

.cg-editable .cg-el:hover {
    outline: 1px dashed rgba(30, 136, 229, .7);
}

.cg-el.selected {
    outline: 1.5px solid #1e88e5;
    overflow: visible;
}

.cg-handle {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    background: #1e88e5;
    border: 1px solid #fff;
    cursor: nwse-resize;
    z-index: 5;
}

.cg-fixed {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cg-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #757575;
    font-size: 10px;
}

.cg-qr {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #000;
    font-size: 10px;
    font-weight: bold;
    border: 1px solid #000;
}

.cg-color {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cg-color input[type="color"] {
    width: 40px;
    height: 36px;
    padding: 0;
    border: 1px solid #bdbdbd;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}
