/* ================= Tool Container (Workspace) ================= */
.palette-tool-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 80px;
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

/* ================= Header ================= */
.palette-header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.palette-header h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.palette-header p {
    color: var(--footer-text);
    font-size: 0.95rem;
}

/* ================= Workspace Grid Layout ================= */
.palette-workspace {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    width: 100%;
    background: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
}

/* ================= Upload Area ================= */
.palette-input-section {
    grid-column: 1 / -1;
    /* Spans full width across the grid */
    width: 100%;
}

.upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(13, 110, 253, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
}

.upload-area:hover,
.upload-area.dragover {
    background: rgba(13, 110, 253, 0.1);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* ================= Preview Section (Left Column) ================= */
.palette-preview-section {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    width: 100%;
}

#image-canvas {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
    cursor: crosshair;
}

.tool-actions {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.action-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ================= Output Section (Right Column) ================= */
.palette-output-section {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.palette-output-section label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2 Columns for the sidebar */
    gap: 12px;
}

.color-card {
    background-color: var(--nav-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.color-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.color-block {
    height: 50px;
    width: 100%;
}

.color-info {
    padding: 8px;
    display: flex;
    justify-content: center;
    background: var(--bg-color);
}

.copy-hex-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: monospace;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    padding: 4px;
    transition: color 0.2s;
}

.copy-hex-btn:hover {
    color: var(--primary-color);
}

/* ================= Mobile Adjustments ================= */
@media (max-width: 768px) {
    .palette-tool-container {
        padding: 20px;
    }

    .palette-workspace {
        grid-template-columns: 1fr;
        /* Stack elements on mobile */
    }

    .palette-preview-section {
        grid-column: 1;
    }

    .palette-output-section {
        grid-column: 1;
    }

    .color-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 Columns on mobile */
    }
}