/* Make sure stickers are not clickable when not in edit mode */
.diary-paper:not(.edit-mode) .sticker-instance {
    pointer-events: none;
}

/* --- 스티커 인스턴스 --- */
.sticker-instance {
    position: absolute;
    cursor: grab;
    user-select: none;
}

.sticker-instance.selected {
    outline: 1.5px dashed var(--accent-color);
    outline-offset: 2px;
}

.resize-handle,
.rotate-handle,
.flip-handle,
.reset-handle {
    position: absolute;
    width: 26px;
    height: 26px;
    background-color: white;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.resize-handle {
    bottom: -10px;
    right: -10px;
    cursor: nwse-resize;
}

.rotate-handle {
    top: -10px;
    right: -10px;
    cursor: pointer;
}

.rotate-handle:active {
    cursor: pointer;
}

.flip-handle {
    top: -10px;
    left: -10px;
    cursor: pointer;
}

.reset-handle {
    bottom: -10px;
    left: -10px;
    background-color: #15273f;
    border-color: #15273f;
    cursor: pointer;
}

.resize-handle::after,
.rotate-handle::after,
.flip-handle::after,
.reset-handle::after {
    font-size: 14px;
    font-weight: bold;
    color: var(--accent-color);
    line-height: 1;
}

.resize-handle::after {
    content: "\2922";
}

.rotate-handle::after {
    content: "\21BB";
}

.flip-handle::after {
    content: "\21C4";
    font-size: 12px;
}

.reset-handle::after {
    content: "";
    width: 16px;
    height: 16px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7v5h-5'/%3E%3Cpath d='M4 17v-5h5'/%3E%3Cpath d='M18.5 12A7 7 0 0 0 6.1 8.1'/%3E%3Cpath d='M5.5 12a7 7 0 0 0 12.4 3.9'/%3E%3C/svg%3E");
}

.sticker-instance.selected .resize-handle,
.sticker-instance.selected .rotate-handle,
.sticker-instance.selected .flip-handle,
.sticker-instance.selected .reset-handle {
    display: flex;
}

.sticker-instance[data-type="emoji"] {
    font-size: 35px;
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.1));
    line-height: 1;
}

.sticker-instance[data-type="image"] {
    width: 120px;
    border-radius: 8px;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    height: auto;
}

.sticker-instance[data-type="image"] img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    pointer-events: none;
    border-radius: 5px;
}

.sticker-instance[data-type="custom-sticker"] {
    width: 100px;
    border: none;
    box-shadow: none;
    filter: none;
    height: auto;
}

.sticker-instance[data-type="custom-sticker"] img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.sticker-instance[data-type="otomo"] {
    border: none;
    box-shadow: none;
    filter: none;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: visible;
}

.sticker-instance[data-type="otomo"] .sticker-content {
    position: absolute;
    display: block;
    inset: var(--otomo-scene-inset, -19.444%);
}

.sticker-instance[data-type="otomo"] .otomo-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

.sticker-instance.dragging {
    cursor: grabbing;
    opacity: 0.9;
}
