/* ==========================================================================
    Swatches (Palette, Theory, Paintbox)
   ========================================================================== */

/* Palette Generator Swatches */
#palette-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
}
.color-item {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 60px;
}
.color-input-main {
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-global);
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
.color-input-main:hover {
    box-shadow: 0 0 6px var(--shadow-default);
    transform: scale(1.1);
}

/* Theory & Paintbox Swatches */
.theory-controls select {
    width: fit-content;
}

#theory-palette-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.swatch {
    width: 60px;
    height: 60px;
}

.swatch,
.paintbox-swatch {
    border-radius: var(--radius-global);
    border: 1px solid hsl(0, 0%, 100%, 0.1);
    cursor: grab;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    position: relative;
    overflow: hidden;
}

.swatch:hover,
.paintbox-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 0 6px var(--shadow-default);
}

#paintbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    justify-content: center;
}

.paintbox-swatch {
    width: auto;
    aspect-ratio: 1 / 1;
}

.paintbox-swatch.drag-over {
    border: 2px dashed var(--color-outline-drag-over) !important;
    background-color: hsla(211, 100%, 50%, 0.1);
}

/* Paintbox Controls & Bin */
#paintbox-bin {
    aspect-ratio: 1 / 1;
    border: 2px dashed var(--bin-border-color-default);
    border-radius: var(--radius-global);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bin-icon-color-default);
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    cursor: pointer;
}

#paintbox-bin svg {
    width: 60%;
    height: 60%;
    fill: currentColor;
}

#paintbox-bin.drag-over-bin {
    background-color: var(--bin-bg-drag-over);
    border-color: var(--bin-border-color-drag-over);
    color: var(--bin-icon-color-drag-over);
}

#paintbox-bin.pending-clear {
    border-color: var(--bin-border-color-pending-clear) !important;
    color: var(--bin-icon-color-pending-clear) !important;
}

.bin-click-notification {
    position: absolute;
    background-color: #222;
    color: #ddd;
    padding: 10px 15px;
    border-radius: var(--radius-global);
    box-shadow: 0 4px 12px hsl(0, 0%, 0%, 0.6);
    z-index: 1001;
    font-size: 0.9em;
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    border: 1px solid #444;
    transform: translateX(-50%);
    animation: fadeInBinNotification 0.4s ease-out;
    text-align: center;
}

@keyframes fadeInBinNotification {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Drag & Drop States */
.color-preview-box.drag-over {
    outline: 2px dashed var(--color-outline-drag-over);
    outline-offset: 2px;
    box-shadow: 0 0 10px var(--color-shadow-drag-over);
}

.dragging {
    opacity: 0.5;
}
