﻿.card-canvas {
    width: 100%;
    position: relative;
    overflow: hidden;
    container-type: inline-size;
    transition: aspect-ratio 0.3s ease, background-color 0.2s ease;
    background-size: cover;
    background-repeat: repeat;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    user-select: none;
    /* Allow vertical swipes on empty card area to scroll the canvas (so the
       whole card is reachable on mobile when the edit panel shrinks the
       viewport). Draggable elements re-assert `touch-action: none` so dragging
       them never turns into a scroll. */
    touch-action: pan-y;
}

.safe-zone-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    border: 2px dashed rgba(255, 0, 0, 0.5);
    pointer-events: none;
    z-index: 100;
}

.card-element {
    position: absolute;
    /* Keep drags on an element from being hijacked as a page scroll now that
       the canvas allows pan-y. Images/stickers do this via .image-wrapper. */
    touch-action: none;
}

/* Active (currently edited) element — subtle highlight so it's clear what's
   being edited. Temporary editor UI only; never rendered in preview/export. */
.card-element.active {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    background-color: rgba(59, 130, 246, 0.06);
    border-radius: 3px;
}

/* Selected decoration (chosen from the layer list) — decorations are click-through
   on the canvas, so this is the only cue showing which one is active. The dashed
   outline + glow keeps even hairline-thin decorations visible. Editor UI only. */
.card-decoration.selected {
    outline: 2px dashed #3b82f6;
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

/* Discreet "this can be edited" hint badge. Hidden by default, revealed on
   hover (pointer devices only). Excluded from read-only/preview rendering. */
.edit-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

@media (hover: hover) {
    .card-element:hover .edit-badge {
        opacity: 1;
    }
}

/*.main-title {
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    text-align: center;
    font-family: 'Georgia', serif;
    font-weight: bold;
    color: #d63384;
    line-height: 1.2;
    font-size: 10cqw;
    white-space: nowrap;
    z-index: 2;
}

.subtitle {
    top: 28%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    text-align: center;
    color: #444;
    font-size: 4.5cqw;
    z-index: 2;
}*/

/*.sticker-circle {
    width: 25%;
    height: auto;
    aspect-ratio: 1/1;
    background-color: #fff;
    border-radius: 50%;
    bottom: 10%;
    right: 10%;
    box-shadow: 0 0.5cqw 1cqw rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8cqw;
    z-index: 3;
    border: 0.5cqw solid #d63384;
}

.photo-frame {
    top: 40%;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    width: 60%;
    aspect-ratio: 4/3;
    background-color: white;
    padding: 2cqw;
    box-shadow: 0 1cqw 2cqw rgba(0,0,0,0.15);
    z-index: 1;
}

    .photo-frame img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }*/


.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #34d399;
    z-index: 20;
    border: 1px solid white;
    border-radius: 50%;
}

.top-left {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.top-right {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.bottom-left {
    bottom: -5px;
    left: -5px;
    cursor: nesw-resize;
}

.bottom-right {
    bottom: -5px;
    right: -5px;
    cursor: nwse-resize;
}

.top-middle {
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.bottom-middle {
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}

.middle-left {
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: w-resize;
}

.middle-right {
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    cursor: w-resize;
}

.preview-area {
    background-image: radial-gradient(#d1d5db 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: #f3f4f6;
    border-radius: 12px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Card parent container (shared between generator and personalize) */
.card-parent-container {
    background: white;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    position: relative;
}