/* Collage Page Styles */

.collage-container {
    max-width: 1400px;
    margin: 80px auto 4rem;
    padding: 0 20px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
}

.collage-header {
    text-align: center;
    margin-bottom: 2rem;
}

.collage-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Workspace Layout */
.workspace {
    display: flex;
    gap: 30px;
    min-height: 600px;
    flex-wrap: wrap;
    /* Stack on mobile */
}

/* Palette Sidebar */
.palette-container {
    flex: 0 0 250px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    height: 600px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.palette-container h3 {
    margin-top: 0;
    text-align: center;
    margin-bottom: 1rem;
}

.palette {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.sticker-source {
    width: 100%;
    height: auto;
    cursor: grab;
    transition: transform 0.2s;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.sticker-source:hover {
    transform: scale(1.05);
}

/* Canvas Area */
.canvas-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #e0e0e0;
    /* Background for the wrapper, not the canvas itself */
    border-radius: 8px;
    padding: 20px;
    min-height: 600px;
}

#collage-canvas {
    width: 800px;
    height: 600px;
    background: #fff;
    position: relative;
    /* Removed heavy shadow to make images pop more */
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s;
}

.placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 2rem;
    pointer-events: none;
    user-select: none;
}

/* Floating Controls Toolbar */
#item-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    padding: 10px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

#item-controls.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

#item-controls button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
}

#item-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

#item-controls input[type="range"] {
    width: 100px;
    cursor: pointer;
}

/* Dynamic Items on Canvas */
.canvas-item {
    position: absolute;
    cursor: grab;
    user-select: none;
    /* transition: transform 0.1s; */
    /* Floating effect */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease;
}

.canvas-item:active {
    cursor: grabbing;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.canvas-item.selected {
    /* No visible outline as requested */
    outline: none;
    /* Slightly higher lift to indicate selection */
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    z-index: 1000 !important;
    /* Bring to front when selected */
}

.canvas-item img {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    /* Let clicks pass to container */
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
}

.btn-primary {
    background: #000;
    color: #fff;
}

.btn-secondary {
    background: #fff;
    border: 1px solid #333;
    color: #333;
}

/* Responsive */
@media (max-width: 992px) {
    .workspace {
        flex-direction: column;
    }

    .palette-container {
        width: 100%;
        height: auto;
        max-height: 200px;
        flex: none;
    }

    .palette {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    #collage-canvas {
        width: 100%;
        height: 80vw;
        /* Aspect ratio roughly */
    }
}